cocos2d读取xml文件
来源:互联网 发布:心蓝软件 手机 编辑:程序博客网 时间:2024/06/01 10:30
xml文件如下:
<data>
<p name="ZhangSan" age="10"/>
<p name="LiSi" age="11"/>
</data>
#include <tinyxml2/tinyxml2.h>
//#include <json/reader.h>
#include <json/document.h>
void myTestReadXml(){auto doc = new tinyxml2::XMLDocument();doc->Parse(FileUtils::getInstance()->getStringFromFile("data.xml").c_str());auto root = doc->RootElement();for (auto e = root->FirstChildElement(); e; e = e->NextSiblingElement()){std::string str;for (auto attr = e->FirstAttribute(); attr; attr = attr->Next()){str += attr->Name();str += ":";str += attr->Value();str += ",";}log("%s", str.c_str());}}
阅读全文
0 0
- cocos2d读取xml文件
- cocos2d读取xml文件
- Cocos2d-3.x_读取xml文件
- cocos2d XML读取
- cocos2d-x 中跨平台tinyxml读取xml文件方式
- Cocos2d-x XML文件读取操作与解析操作
- Cocos2d-x 游戏开发中读取XML文件拷贝
- 在cocos2d中在xml文件读取数据或者中文
- cocos2d-x 读取 文件
- cocos2d-x 读取文件
- cocos2d读取plist文件
- cocos2d绝对路径读取tmx文件
- cocos2d-x 读取plist文件
- Cocos2D文件读取I/O
- cocos2d-x plist文件读取
- cocos2d-x 读取.plist文件
- cocos2d-x -----文件的读取
- SAX 读取xml文件
- 【网络实验】IP identification字段与TSO,GRO
- http协议
- 2017-7-11
- Storm快速指南
- csdn博客备份脚本
- cocos2d读取xml文件
- Linux-centos-日志系统
- Codeforces 618C Constellation
- 零基础 Kotlin开发 Android 环境搭建
- 详解git fetch与git pull的区别
- h5粗略了解(含页面拖拽)
- 利用python进行T检验
- C++学习笔记九之函数指针
- css实用集合