1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/components/myguiplatform/myguidatamanager.hpp

59 lines
1.5 KiB
C++
Raw Normal View History

2015-05-01 01:15:25 +02:00
#ifndef OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIDATAMANAGER_H
#define OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIDATAMANAGER_H
2015-04-24 21:55:30 +02:00
#include <MyGUI_DataManager.h>
#include <filesystem>
2022-09-22 21:26:05 +03:00
#include <string>
namespace VFS
{
class Manager;
}
2022-07-07 19:34:18 +04:00
2015-05-01 01:15:25 +02:00
namespace osgMyGUI
2015-04-24 21:55:30 +02:00
{
2022-09-22 21:26:05 +03:00
class DataManager : public MyGUI::DataManager
{
public:
explicit DataManager(const std::string& path, const VFS::Manager* vfs);
void setResourcePath(const std::filesystem::path& path);
/** Get data stream from specified resource name.
@param _name Resource name (usually file name).
*/
MyGUI::IDataStream* getData(const std::string& _name) const override;
/** Free data stream.
@param _data Data stream.
*/
void freeData(MyGUI::IDataStream* _data) override;
/** Is data with specified name exist.
@param _name Resource name.
*/
bool isDataExist(const std::string& _name) const override;
/** Get all data names with names that matches pattern.
@param _pattern Pattern to match (for example "*.layout").
*/
const MyGUI::VectorString& getDataListNames(const std::string& _pattern) const override;
/** Get full path to data.
@param _name Resource name.
@return Return full path to specified data.
*/
2023-08-07 12:43:30 +02:00
std::string getDataPath(const std::string& _name) const override;
2022-09-22 21:26:05 +03:00
private:
std::filesystem::path mResourcePath;
const VFS::Manager* mVfs;
};
2015-04-24 21:55:30 +02:00
}
#endif