Can TinyXml load Xml from string instead of file?

元气小坏坏 提交于 2019-12-09 05:11:58

问题


I'm using TinyXml library for my application but TiXmlDocument object just only can load Xml file. How can it load Xml from string. Could you tell me the way to do this. Thank you very much

Tu.


回答1:


Instead of calling TiXmlDocument::LoadFile() you can use TiXmlDocument::Parse()

TiXmlDocument doc;
doc.Parse((const char*)filedata, 0, TIXML_ENCODING_UTF8);

Check DotScene Loader with User Data Class



来源:https://stackoverflow.com/questions/2862892/can-tinyxml-load-xml-from-string-instead-of-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!