 |
BARE2D
|
|
Go to the documentation of this file.
5 #include <rapidxml/rapidxml.hpp>
25 static void loadXML(std::string filepath);
32 static void saveXML(std::string filepath);
57 template <
typename T>
static T
getData(std::string dataType,
unsigned int key);
89 static void readXMLData(std::ifstream& file, std::string dataType);
98 template <
typename T>
static bool readValue(rapidxml::xml_node<>* parent, std::string valueName, T& variable);
static bool readValue(rapidxml::xml_node<> *parent, std::string valueName, T &variable)
Reads a value from a node. Templated for almost any primitive.
static XMLData getDataType(std::string dataType)
Provides a copy of some data type added by the addDataType function.
static void setData(XMLData *data)
Adds or overwrites data in the cache/sub-cache.
static Cache< unsigned int, XMLData > * getDataCache(std::string dataType)
Returns a cache for a certain type of data.
static Cache< std::string, Cache< unsigned int, XMLData > > m_storedData
static void loadXML(std::string filepath)
Loads all of the files from the filepath that end in .xml to the caches. Does not clear caches.
static std::unordered_map< std::string, std::function< XMLData *()> > m_dataTypingFunctions
static void addData(XMLData *data)
Adds a piece of data to the cache, in the appropriate sub-cache.
static unsigned int getDataCount(std::string dataType)
A singleton class that statically manages all XML data, including read and write operations.
static void clearCache()
Clears the various caches and subcaches that the class uses. Useful for refreshes.
This is a skeleton cache class. This can only be used by the ResourceManager or other classes who act...
static void addDataType()
Adds a type of data that can be read. Make sure that the custom data type's nodeName is set.
static void writeXMLData(std::ofstream &file, Cache< unsigned int, XMLData > *data)
Writes a single subcache of data to a single file.
static T getData(std::string dataType, unsigned int key)
Finds some data in the subcache.
static void readXMLData(std::ifstream &file, std::string dataType)
Reads a single subcache from a single file.
static void saveXML(std::string filepath)
Writes all of the currently cached data to the data's respective files in a folder at filepath....
Holds all the very basic information for XML data. Designed to be a base class from which a user can ...