summaryrefslogtreecommitdiff
path: root/src/mir_core/json
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 /src/mir_core/json
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 'src/mir_core/json')
-rw-r--r--src/mir_core/json/libJSON.cpp12
1 files changed, 5 insertions, 7 deletions
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();