1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00
OpenMW/apps/opencs/model/world/resources.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
955 B
C++
Raw Normal View History

2014-07-04 12:46:57 +02:00
#ifndef CSM_WOLRD_RESOURCES_H
#define CSM_WOLRD_RESOURCES_H
#include <map>
#include <string>
#include <string_view>
#include <vector>
2014-07-04 12:46:57 +02:00
2014-07-07 15:20:05 +02:00
#include "universalid.hpp"
namespace VFS
{
class Manager;
}
2014-07-04 12:46:57 +02:00
namespace CSMWorld
{
class Resources
{
std::map<std::string, int> mIndex;
std::vector<std::string> mFiles;
std::string mBaseDirectory;
2014-07-07 15:20:05 +02:00
UniversalId::Type mType;
2014-07-04 12:46:57 +02:00
2022-09-22 21:26:05 +03:00
public:
2014-07-07 15:20:05 +02:00
/// \param type Type of resources in this table.
Resources(const VFS::Manager* vfs, const std::string& baseDirectory, UniversalId::Type type,
2020-11-13 11:39:47 +04:00
const char* const* extensions = nullptr);
2014-07-04 12:46:57 +02:00
2020-11-13 11:39:47 +04:00
void recreate(const VFS::Manager* vfs, const char* const* extensions = nullptr);
2017-08-19 03:43:31 -04:00
2014-07-04 12:46:57 +02:00
int getSize() const;
std::string getId(int index) const;
int getIndex(const std::string& id) const;
int searchId(std::string_view id) const;
2014-07-07 15:20:05 +02:00
UniversalId::Type getType() const;
2014-07-04 12:46:57 +02:00
};
}
#endif