From 95ee503b0f0a4cb434de65f2d9d7375356e39d74 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 29 Dec 2016 12:33:06 +0300 Subject: these operators better be not inlined --- protocols/Discord/src/utils.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'protocols/Discord/src/utils.cpp') diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp index a542a4a7c5..52eecea527 100644 --- a/protocols/Discord/src/utils.cpp +++ b/protocols/Discord/src/utils.cpp @@ -23,3 +23,23 @@ void CDiscordProto::SetAllContactStatuses(int status) if (!getByte(hContact, "ChatRoom")) setWord(hContact, "Status", (WORD)status); } + +///////////////////////////////////////////////////////////////////////////////////////// + +JSONNode& operator<<(JSONNode &json, const INT_PARAM ¶m) +{ + json.push_back(JSONNode(param.szName, param.iValue)); + return json; +} + +JSONNode& operator<<(JSONNode &json, const CHAR_PARAM ¶m) +{ + json.push_back(JSONNode(param.szName, param.szValue)); + return json; +} + +JSONNode& operator<<(JSONNode &json, const WCHAR_PARAM ¶m) +{ + json.push_back(JSONNode(param.szName, ptrA(mir_utf8encodeW(param.wszValue)).get())); + return json; +} -- cgit v1.2.3