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