Changeset View
Changeset View
Standalone View
Standalone View
source/ps/XML/Xeromyces.h
Show All 34 Lines | |||||
#include "lib/file/vfs/vfs.h" | #include "lib/file/vfs/vfs.h" | ||||
class RelaxNGValidator; | class RelaxNGValidator; | ||||
class WriteBuffer; | class WriteBuffer; | ||||
typedef struct _xmlDoc xmlDoc; | typedef struct _xmlDoc xmlDoc; | ||||
typedef xmlDoc* xmlDocPtr; | typedef xmlDoc* xmlDocPtr; | ||||
template <typename T> | |||||
class DataTree; | |||||
class DataTreeXMLImpl; | |||||
typedef DataTree<DataTreeXMLImpl> DataTreeXML; | |||||
class CXeromyces : public XMBFile | class CXeromyces : public XMBFile | ||||
{ | { | ||||
friend class TestXeroXMB; | friend class TestXeroXMB; | ||||
public: | public: | ||||
/** | /** | ||||
* Load from an XML file (with invisible XMB caching). | * Load from an XML file (with invisible XMB caching). | ||||
*/ | */ | ||||
PSRETURN Load(const PIVFS& vfs, const VfsPath& filename, const std::string& validatorName = ""); | PSRETURN Load(const PIVFS& vfs, const VfsPath& filename, const std::string& validatorName = "", const VfsPath& includePath = ""); | ||||
/** | /** | ||||
* Load from an in-memory XML string (with no caching). | * Load from an in-memory XML string (with no caching). | ||||
*/ | */ | ||||
PSRETURN LoadString(const char* xml, const std::string& validatorName = ""); | PSRETURN LoadString(const char* xml, const std::string& validatorName = ""); | ||||
/** | /** | ||||
* Convert the given XML file into an XMB in the archive cache. | * Convert the given XML file into an XMB in the archive cache. | ||||
Show All 15 Lines | public: | ||||
static bool AddValidator(const PIVFS& vfs, const std::string& name, const VfsPath& grammarPath); | static bool AddValidator(const PIVFS& vfs, const std::string& name, const VfsPath& grammarPath); | ||||
static bool ValidateEncoded(const std::string& name, const std::wstring& filename, const std::string& document); | static bool ValidateEncoded(const std::string& name, const std::wstring& filename, const std::string& document); | ||||
private: | private: | ||||
static RelaxNGValidator& GetValidator(const std::string& name); | static RelaxNGValidator& GetValidator(const std::string& name); | ||||
PSRETURN ConvertFile(const PIVFS& vfs, const VfsPath& filename, const VfsPath& xmbPath, const std::string& validatorName); | PSRETURN ConvertFile(const PIVFS& vfs, const VfsPath& filename, const VfsPath& xmbPath, const std::string& validatorName, const VfsPath& includePath); | ||||
bool ReadXMBFile(const PIVFS& vfs, const VfsPath& filename); | bool ReadXMBFile(const PIVFS& vfs, const VfsPath& filename); | ||||
static PSRETURN CreateXMB(const xmlDocPtr doc, WriteBuffer& writeBuffer); | static PSRETURN CreateXMB(const DataTreeXML& doc, WriteBuffer& writeBuffer); | ||||
shared_ptr<u8> m_XMBBuffer; | shared_ptr<u8> m_XMBBuffer; | ||||
}; | }; | ||||
#define _XERO_MAKE_UID2__(p,l) p ## l | #define _XERO_MAKE_UID2__(p,l) p ## l | ||||
#define _XERO_MAKE_UID1__(p,l) _XERO_MAKE_UID2__(p,l) | #define _XERO_MAKE_UID1__(p,l) _XERO_MAKE_UID2__(p,l) | ||||
Show All 10 Lines |
Wildfire Games · Phabricator