summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-06 06:44:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-06 06:44:28 +0000
commit364298fae60d675d65e8456f58a27a5bcfce79cc (patch)
treef58e4d86b844f1b33dab6d405ca8964664f2fad4 /include
parent300b0d6897c31b9250dd6a60746646b036986983 (diff)
- 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
Diffstat (limited to 'include')
-rw-r--r--include/m_json.h20
1 files changed, 5 insertions, 15 deletions
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 <m_core.h>
+#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