cocos2d-x中使用tinyxml遇到的问题及解决
2024-09-17 07:39:09
1.问题:
cocos2d-x集成tinyxml后在vs下运行正常,但是在Android下在读取xml文件时发生异常,读取时使用的是
LoadFile
函数
2. 解决方案:
先把xml文件内容读取到内存中然后在解析就没问题了
std::string xmlfilePath = FileUtils:getInstance()->fullPathForFilename("text.xml");
ssize_t len = 0;
unsigned char *data = FileUtils::getInstance()->getFileData(xmlfilePath.c_str());
tinyxml2::XMLDocument *doc = new tinyxml2::XMLDocument();
doc->Parse((cahr *)data, len);
...
最新文章
- YourSQLDba设置共享路径备份
- Ubuntu下编译内核
- 对C++/CLR的一些评价
- UIWebview 禁止某个方向滚动
- 10、第十节课jq420151012
- ie8 hack
- 期末考试--nyoj-757
- C语言中的static 具体分析
- LindDotNetCore~Mock对实际应用中的意义
- MySQL 关于性能的参数配置梳理
- 做ctf题对malloc的疑问
- python-request-各方法使用及格式
- OneinStack——PHP多版本共存
- 记一次SQL性能优化,查询时间从4000ms优化到200ms.
- P4556 [Vani有约会]雨天的尾巴
- mysql中表里的数据重新设置自增的id的方法
- GNU与Linux
- python标准库介绍——15 fileinput 模块详解
- 记js的一个奇葩问题!!!!!!!!!!!!
- java生成pdf