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 --- src/mir_core/commonheaders.h | 2 ++ src/mir_core/json/libJSON.cpp | 12 +++++------- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/mir_core/commonheaders.h b/src/mir_core/commonheaders.h index 4a76153e96..26e32aa1c8 100644 --- a/src/mir_core/commonheaders.h +++ b/src/mir_core/commonheaders.h @@ -36,6 +36,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include +#include + #include #include #include diff --git a/src/mir_core/json/libJSON.cpp b/src/mir_core/json/libJSON.cpp index e3599e8936..c8f7a0e3ff 100644 --- a/src/mir_core/json/libJSON.cpp +++ b/src/mir_core/json/libJSON.cpp @@ -152,13 +152,6 @@ MIR_CORE_DLL(json_char*) json_strip_white_space(const json_char * json){ } #endif -#ifdef JSON_MEMORY_CALLBACKS - MIR_CORE_DLL(void) json_register_memory_callbacks(json_malloc_t mal, json_realloc_t real, json_free_t fre){ - JSONMemory::registerMemoryCallbacks(mal, real, fre); - } -#endif - - /* stuff that's in class JSONNode */ @@ -283,6 +276,11 @@ MIR_CORE_DLL(json_char*) json_as_string(const JSONNODE * node){ return toCString(((JSONNode*)node) -> as_string()); } +MIR_CORE_DLL(std::string) json_as_pstring(const JSONNODE * node){ + JSON_ASSERT_SAFE(node, JSON_TEXT("null node to json_as_string"), return toCString(EMPTY_CSTRING);); + return ((JSONNode*)node) -> as_string(); +} + MIR_CORE_DLL(long) json_as_int(const JSONNODE * node){ JSON_ASSERT_SAFE(node, JSON_TEXT("null node to json_as_int"), return 0;); return ((JSONNode*)node) -> as_int(); -- cgit v1.2.3