Library: Allow loading xml data from memory
This commit is contained in:
parent
752e9d0fb7
commit
a26c5736da
|
@ -89,6 +89,12 @@ bool Library::load(const char exename[], const char path[])
|
||||||
return (error == tinyxml2::XML_NO_ERROR) && load(doc);
|
return (error == tinyxml2::XML_NO_ERROR) && load(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Library::loadxmldata(const char xmldata[], std::size_t len)
|
||||||
|
{
|
||||||
|
tinyxml2::XMLDocument doc;
|
||||||
|
return (tinyxml2::XML_NO_ERROR == doc.Parse(xmldata, len)) && load(doc);
|
||||||
|
}
|
||||||
|
|
||||||
bool Library::load(const tinyxml2::XMLDocument &doc)
|
bool Library::load(const tinyxml2::XMLDocument &doc)
|
||||||
{
|
{
|
||||||
const tinyxml2::XMLElement * const rootnode = doc.FirstChildElement();
|
const tinyxml2::XMLElement * const rootnode = doc.FirstChildElement();
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
Library();
|
Library();
|
||||||
|
|
||||||
bool load(const char exename [], const char path []);
|
bool load(const char exename [], const char path []);
|
||||||
|
bool loadxmldata(const char xmldata[], std::size_t len);
|
||||||
bool load(const tinyxml2::XMLDocument &doc);
|
bool load(const tinyxml2::XMLDocument &doc);
|
||||||
|
|
||||||
/** get allocation id for function (by name) */
|
/** get allocation id for function (by name) */
|
||||||
|
|
Loading…
Reference in New Issue