summaryrefslogtreecommitdiff
path: root/libs/libjson/src/stdafx.cxx
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-11 12:04:28 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-11 12:04:28 +0300
commit322fece4cdb97f834c3c13b7bb3157ba6e4fa449 (patch)
treeab02c0681f9c9bb1adc1038b251f502dcdb49638 /libs/libjson/src/stdafx.cxx
parent4abcb6d6a611b10f32d803270b7f2480fbb6865e (diff)
parameters unification between JSON & HTTP
Diffstat (limited to 'libs/libjson/src/stdafx.cxx')
-rw-r--r--libs/libjson/src/stdafx.cxx36
1 files changed, 35 insertions, 1 deletions
diff --git a/libs/libjson/src/stdafx.cxx b/libs/libjson/src/stdafx.cxx
index 6f97ed9a4e..21194081bc 100644
--- a/libs/libjson/src/stdafx.cxx
+++ b/libs/libjson/src/stdafx.cxx
@@ -16,4 +16,38 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "stdafx.h" \ No newline at end of file
+#include "stdafx.h"
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const INT_PARAM &param)
+{
+ json.push_back(JSONNode(param.szName, param.iValue));
+ return json;
+}
+
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const INT64_PARAM &param)
+{
+ char tmp[100];
+ _i64toa_s(param.iValue, tmp, _countof(tmp), 10);
+ json.push_back(JSONNode(param.szName, tmp));
+ return json;
+}
+
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const BOOL_PARAM &param)
+{
+ json.push_back(JSONNode(param.szName, param.bValue));
+ return json;
+}
+
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const CHAR_PARAM &param)
+{
+ json.push_back(JSONNode(param.szName, param.szValue));
+ return json;
+}
+
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const WCHAR_PARAM &param)
+{
+ json.push_back(JSONNode(param.szName, ptrA(mir_utf8encodeW(param.wszValue)).get()));
+ return json;
+}