1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/components/myguiplatform/myguidatamanager.hpp

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

59 lines
1.5 KiB
C++
Raw Normal View History

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