add Get????Version function of expat/jsoncpp

This commit is contained in:
2020-10-11 17:57:47 +08:00
parent 46bb78cefb
commit 225bf198b0
6 changed files with 20 additions and 2 deletions

View File

@@ -4,6 +4,8 @@
namespace hgl
{
const UTF8String GetJsoncppVersion();
/**
* 转换Json数据类型到普通UTF8字符串
*/

View File

@@ -25,6 +25,8 @@ namespace hgl
namespace xml
{
const UTF8String GetExpatVersion();
constexpr int XML_PARSE_BUFFER_SIZE=HGL_SIZE_1KB*128; ///<XML解析缓冲区大小
/**

View File

@@ -9,6 +9,11 @@ using namespace std;
namespace hgl
{
const UTF8String GetJsoncppVersion()
{
return UTF8String(JSONCPP_VERSION_STRING);
}
bool JsonToString(const Json::Value &jv_root,UTF8String &str,OSString &error_info)
{
Json::StreamWriterBuilder builder;

View File

@@ -9,6 +9,15 @@ namespace hgl
{
namespace xml
{
const UTF8String GetExpatVersion()
{
return( UTF8String::valueOf(XML_MAJOR_VERSION)+
UTF8String(U8_TEXT("."))+
UTF8String::valueOf(XML_MINOR_VERSION)+
UTF8String(U8_TEXT("."))+
UTF8String::valueOf(XML_MICRO_VERSION));
}
namespace
{
void XMLStartElement(ElementParse *ep,const XML_Char *name,const XML_Char **atts)