From 364298fae60d675d65e8456f58a27a5bcfce79cc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 6 Aug 2013 06:44:28 +0000 Subject: - special function json_as_pstring, that returns std::string directly from json core - json_register_memory_callbacks removed git-svn-id: http://svn.miranda-ng.org/main/trunk@5594 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/m_json.h | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'include/m_json.h') diff --git a/include/m_json.h b/include/m_json.h index 3d82fe276b..e635814299 100644 --- a/include/m_json.h +++ b/include/m_json.h @@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include +#pragma warning(disable:4190) + #ifdef __cplusplus typedef void JSONNODE; @@ -116,23 +118,11 @@ MIR_CORE_DLL(JSONNODE*) json_pop_back(JSONNODE * node, const char * name); MIR_CORE_DLL(int) json_equal(JSONNODE * node, JSONNODE * node2); #ifdef __cplusplus +#ifdef _XSTRING_ +MIR_CORE_DLL(std::string) json_as_pstring(const JSONNODE * node); +#endif } -class json_ptr -{ - char *data; - -public: - __inline json_ptr() : data(NULL) {} - __inline json_ptr(char *_p) : data(_p) {} - __inline ~json_ptr() { json_free(data); } - __inline char* operator = (char* _p) { if (data) json_free(data); data = _p; return data; } - __inline char* operator->() const { return data; } - __inline operator char*() const { return data; } -}; - -#define JSON_AS_STRING(A) ((char*)json_ptr(json_as_string(A))) - #endif #endif // MIM_LIBJSON_H -- cgit v1.2.3