|
CBlueUI
C++ 跨平台跨框架的数据可视化工具
|
xml文件储存类。xml文件中大量重复标签,采用共享字符串的方式,减少内存占用 更多...
Public 成员函数 | |
| XmlStorageW (TransformTextProcW func=NULL) | |
| XmlStorageW (const char *file_utf8, TransformTextProcW func=NULL) | |
| XmlStorageW (const WCHAR *file, TransformTextProcW func=NULL) | |
| ~XmlStorageW () | |
| void | Clear () |
| 清空并释放内存 | |
| XMLItemW * | Root () |
| 跟节点 | |
| BeStringW | FileBaseName () const |
| 文件名称(不包含目录结构) | |
| int | LoadBuffer (const char *data, int len=-1, BOOL no_write=FALSE) |
| 加载xml格式数据 | |
| int | LoadBufferJson (const char *jsonText, int len=-1, BOOL to_xml=FALSE) |
| 加载json数据并转换为xml树结构 | |
| BeStringW | AddShareLabel (const char *str, int len, BOOL isKey=FALSE) |
| 自动检测文本是否在共享字符缓存中,不存在则新建字符串;存在则直接返回共享内存。 在xml和json文档中,存在大量重复的关键词。共享字符串可以减少内存占用 | |
静态 Public 成员函数 | |
| static void | SaveAsXmlFile (const XMLItemW *root, const char *filepath) |
xml文件储存类。xml文件中大量重复标签,采用共享字符串的方式,减少内存占用
| BUI::XmlStorageW::XmlStorageW | ( | TransformTextProcW | func = NULL | ) |
| BUI::XmlStorageW::XmlStorageW | ( | const char * | file_utf8, |
| TransformTextProcW | func = NULL |
||
| ) |
| BUI::XmlStorageW::XmlStorageW | ( | const WCHAR * | file, |
| TransformTextProcW | func = NULL |
||
| ) |
| BUI::XmlStorageW::~XmlStorageW | ( | ) |
自动检测文本是否在共享字符缓存中,不存在则新建字符串;存在则直接返回共享内存。 在xml和json文档中,存在大量重复的关键词。共享字符串可以减少内存占用
| str | : 字符串 |
| len | : 字符串长度 |
| isKey | : 是不是属性名称 |
| void BUI::XmlStorageW::Clear | ( | ) |
清空并释放内存
| BeStringW BUI::XmlStorageW::FileBaseName | ( | ) | const |
文件名称(不包含目录结构)
加载xml格式数据
| data | 数据 |
| len | 数据长度 |
| no_write | TRUE代表xmlText是不可写字符串,解析常量字符串时,需要标记为TRUE |
加载json数据并转换为xml树结构
| jsonText | 数据 |
| len | 数据长度 |
| to_xml | TRUE表示将json格式转换为紧凑的XML格式。FALSE表示保持json的树结构 |
| XMLItemW * BUI::XmlStorageW::Root | ( | ) |
跟节点
|
static |