|
TouchVG framework
|
JSON序列化类 更多...
#include <mgjsonstorage.h>
类 | |
| class | Impl |
| JSON序列化适配器类,内部实现类 更多... | |
Public 成员函数 | |
| MgJsonStorage () | |
| ~MgJsonStorage () | |
| MgStorage * | storageForRead (const char *content) |
| 给定JSON内容,返回存取接口对象以便开始读取 更多... | |
| MgStorage * | storageForWrite () |
| 返回存取接口对象以便开始写数据,写完可调用 stringify() 更多... | |
| MgStorage * | storageForRead (FILE *fp) |
| 给定JSON文件句柄,返回存取接口对象以便开始读取 更多... | |
| bool | save (FILE *fp, bool pretty=false) |
| 写数据到给定的文件 更多... | |
| MgStorage * | storageForRead (const MgJsonFile &file) |
| 给定JSON文件对象,返回存取接口对象以便开始读取 更多... | |
| bool | save (const MgJsonFile &file, bool pretty=false) |
| 写数据到给定的文件 更多... | |
| const char * | stringify (bool pretty=false) |
| 返回JSON内容 更多... | |
| void | clear () |
| 清除内存资源 更多... | |
| const char * | getParseError () |
| 返回 storageForRead() 中的解析错误,NULL表示没有错误 更多... | |
| void | setArrayMode (bool arr) |
| 设置是否使用数组模式,默认在对象中添加由名称和序号组成的子对象,true表示在数组中添加元素 更多... | |
| void | saveNumberAsString (bool str) |
| 设置是否在保存数值键值时加上引号 更多... | |
静态 Public 成员函数 | |
| static bool | toUTF8 (const char *infile, const char *outfile) |
| UTF-16/32编码的文件转换为UTF-8编码的文件,返回转换与否 更多... | |
| static bool | toUTF16 (const char *infile, const char *outfile) |
| UTF-8编码的文件转换为UTF-16LE编码的文件,返回转换与否 更多... | |
| static bool | parseInt (const char *str, int &value) |
| static bool | parseFloat (const char *str, float &value) |
| static bool | parseFloat (const char *str, double &value) |
Private 属性 | |
| Impl * | _impl |
JSON序列化类