summaryrefslogtreecommitdiff
path: root/protocols/Weather/src/stdafx.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-01-25 15:45:00 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-01-25 15:45:00 +0300
commit049450602d7d1b8f3ae655d08b49f8a45d6235ba (patch)
tree6cd6d50020c7df250d1f33cad8b0cb7e232ff975 /protocols/Weather/src/stdafx.h
parent5d1174129a88c6b527da0ebccfab3eff8d8474ac (diff)
Weather: fixed station search
Diffstat (limited to 'protocols/Weather/src/stdafx.h')
-rw-r--r--protocols/Weather/src/stdafx.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h
index 583e564abc..098b92f7f8 100644
--- a/protocols/Weather/src/stdafx.h
+++ b/protocols/Weather/src/stdafx.h
@@ -46,6 +46,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_history.h>
#include <m_icolib.h>
#include <m_ignore.h>
+#include <m_json.h>
#include <m_langpack.h>
#include <m_netlib.h>
#include <m_options.h>
@@ -178,3 +179,20 @@ const wchar_t *GetDefaultText(int c);
// function from multiwin module
void UpdateMwinData(MCONTACT hContact);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// utils
+
+class JsonReply
+{
+ JSONNode *m_root = nullptr;
+ int m_errorCode = 0;
+
+public:
+ JsonReply(MHttpResponse *);
+ ~JsonReply();
+
+ __forceinline int error() const { return m_errorCode; }
+ __forceinline JSONNode &data() const { return *m_root; }
+ __forceinline operator bool() const { return m_errorCode == 200; }
+};