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>
|
|
|
|
|
2022-05-17 00:58:24 +02:00
|
|
|
#include <string>
|
|
|
|
|
2022-07-18 20:49:50 +02:00
|
|
|
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
|
|
|
{
|
|
|
|
|
|
|
|
class DataManager : public MyGUI::DataManager
|
|
|
|
{
|
|
|
|
public:
|
2022-07-18 20:54:00 +02:00
|
|
|
explicit DataManager(const std::string& path, const VFS::Manager* vfs);
|
2015-04-24 21:55:30 +02:00
|
|
|
|
2022-07-18 23:34:12 +04:00
|
|
|
void setResourcePath(const std::string& path);
|
2022-07-07 19:34:18 +04:00
|
|
|
|
2015-04-24 21:55:30 +02:00
|
|
|
/** Get data stream from specified resource name.
|
|
|
|
@param _name Resource name (usually file name).
|
|
|
|
*/
|
2021-12-16 19:48:10 +01:00
|
|
|
MyGUI::IDataStream* getData(const std::string& _name) const override;
|
2015-04-24 21:55:30 +02:00
|
|
|
|
|
|
|
/** Free data stream.
|
|
|
|
@param _data Data stream.
|
|
|
|
*/
|
2020-10-16 22:18:54 +04:00
|
|
|
void freeData(MyGUI::IDataStream* _data) override;
|
2015-04-24 21:55:30 +02:00
|
|
|
|
|
|
|
/** Is data with specified name exist.
|
|
|
|
@param _name Resource name.
|
|
|
|
*/
|
2021-12-16 19:48:10 +01:00
|
|
|
bool isDataExist(const std::string& _name) const override;
|
2015-04-24 21:55:30 +02:00
|
|
|
|
|
|
|
/** Get all data names with names that matches pattern.
|
|
|
|
@param _pattern Pattern to match (for example "*.layout").
|
|
|
|
*/
|
2021-12-16 19:48:10 +01:00
|
|
|
const MyGUI::VectorString& getDataListNames(const std::string& _pattern) const override;
|
2015-04-24 21:55:30 +02:00
|
|
|
|
|
|
|
/** Get full path to data.
|
|
|
|
@param _name Resource name.
|
|
|
|
@return Return full path to specified data.
|
|
|
|
*/
|
2021-12-16 19:48:10 +01:00
|
|
|
const std::string& getDataPath(const std::string& _name) const override;
|
2015-04-24 21:55:30 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string mResourcePath;
|
2022-07-07 19:34:18 +04:00
|
|
|
|
|
|
|
const VFS::Manager* mVfs;
|
2015-04-24 21:55:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|