diff options
author | George Hazan <ghazan@miranda.im> | 2017-12-28 18:57:03 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-12-28 18:57:03 +0300 |
commit | 6872a9a9b1f032ede5471a8a03abc76e7c7259d9 (patch) | |
tree | 59c6e96e8c6f52ba2b6c69cf3b52bc86a8ffb48e | |
parent | 16133fc3ddb4952e78a20078ece5440766b76f73 (diff) | |
parent | f6c14ec9ec02d5eec251f20463aeb2e091978cd7 (diff) |
two missing operators added to json wrapper
-rw-r--r-- | include/m_json.h | 17 | ||||
-rw-r--r-- | libs/libjson/src/libjson.def | 2 | ||||
-rw-r--r-- | libs/libjson/src/libjson64.def | 2 | ||||
-rw-r--r-- | libs/libjson/src/stdafx.cxx | 12 | ||||
-rw-r--r-- | libs/win32/libjson.lib | bin | 65242 -> 65902 bytes | |||
-rw-r--r-- | libs/win64/libjson.lib | bin | 65846 -> 66538 bytes |
6 files changed, 33 insertions, 0 deletions
diff --git a/include/m_json.h b/include/m_json.h index dfbc293022..9211e408fb 100644 --- a/include/m_json.h +++ b/include/m_json.h @@ -144,11 +144,28 @@ public: __forceinline JSONNode* Parse(LPCSTR text) { return (m_node = json_parse(text)); }
};
+struct NULL_PARAM : public PARAM
+{
+ __forceinline NULL_PARAM(LPCSTR _name) : PARAM(_name)
+ {}
+ ;
+};
+
+struct JSON_PARAM : public PARAM
+{
+ JSONNode node;
+ __forceinline JSON_PARAM(LPCSTR _name, JSONNode _node) :
+ PARAM(_name), node(_node)
+ {}
+};
+
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const INT_PARAM ¶m);
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const INT64_PARAM ¶m);
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const BOOL_PARAM ¶m);
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const CHAR_PARAM ¶m);
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const WCHAR_PARAM ¶m);
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const NULL_PARAM ¶m); +LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const JSON_PARAM ¶m); #endif // __cplusplus
diff --git a/libs/libjson/src/libjson.def b/libs/libjson/src/libjson.def index fcb01c7578..027b0fd092 100644 --- a/libs/libjson/src/libjson.def +++ b/libs/libjson/src/libjson.def @@ -199,3 +199,5 @@ json_write_formatted @191 ??6@YGAAVJSONNode@@AAV0@ABUINT64_PARAM@@@Z @196 NONAME
??6@YGAAVJSONNode@@AAV0@ABUINT_PARAM@@@Z @197 NONAME
??6@YGAAVJSONNode@@AAV0@ABUWCHAR_PARAM@@@Z @198 NONAME
+??6@YGAAVJSONNode@@AAV0@ABUJSON_PARAM@@@Z @199 NONAME
+??6@YGAAVJSONNode@@AAV0@ABUNULL_PARAM@@@Z @200 NONAME
diff --git a/libs/libjson/src/libjson64.def b/libs/libjson/src/libjson64.def index e9512805bd..e22d9f62ac 100644 --- a/libs/libjson/src/libjson64.def +++ b/libs/libjson/src/libjson64.def @@ -199,3 +199,5 @@ json_write_formatted @191 ??6@YAAEAVJSONNode@@AEAV0@AEBUINT64_PARAM@@@Z @196 NONAME
??6@YAAEAVJSONNode@@AEAV0@AEBUINT_PARAM@@@Z @197 NONAME
??6@YAAEAVJSONNode@@AEAV0@AEBUWCHAR_PARAM@@@Z @198 NONAME
+??6@YAAEAVJSONNode@@AEAV0@AEBUJSON_PARAM@@@Z @199 NONAME
+??6@YAAEAVJSONNode@@AEAV0@AEBUNULL_PARAM@@@Z @200 NONAME
diff --git a/libs/libjson/src/stdafx.cxx b/libs/libjson/src/stdafx.cxx index 21194081bc..b16af99abd 100644 --- a/libs/libjson/src/stdafx.cxx +++ b/libs/libjson/src/stdafx.cxx @@ -51,3 +51,15 @@ LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const WCHAR_PARAM ¶m) json.push_back(JSONNode(param.szName, ptrA(mir_utf8encodeW(param.wszValue)).get()));
return json;
}
+
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const NULL_PARAM ¶m) +{ + json.push_back(JSONNode(param.szName, nullptr)); + return json; +}
+
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const JSON_PARAM ¶m) +{ + json.push_back(JSONNode(param.szName, param.node)); + return json; +} diff --git a/libs/win32/libjson.lib b/libs/win32/libjson.lib Binary files differindex 7cef888308..b7787d39d1 100644 --- a/libs/win32/libjson.lib +++ b/libs/win32/libjson.lib diff --git a/libs/win64/libjson.lib b/libs/win64/libjson.lib Binary files differindex 3db9115e65..75de0f2cab 100644 --- a/libs/win64/libjson.lib +++ b/libs/win64/libjson.lib |