diff options
Diffstat (limited to 'src/mir_core/json')
-rw-r--r-- | src/mir_core/json/JSONNode.h | 4 | ||||
-rw-r--r-- | src/mir_core/json/internalJSONNode.h | 6 | ||||
-rw-r--r-- | src/mir_core/json/libJSON.cpp | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/mir_core/json/JSONNode.h b/src/mir_core/json/JSONNode.h index 487925b04f..27dbef2aee 100644 --- a/src/mir_core/json/JSONNode.h +++ b/src/mir_core/json/JSONNode.h @@ -93,7 +93,7 @@ public: void clear(void);
unsigned char type(void) const;
- json_string name(void) const;
+ const json_char* name(void) const;
void set_name(const json_string & newname);
#ifdef JSON_COMMENTS
void set_comment(const json_string & comment);
@@ -505,7 +505,7 @@ inline unsigned char JSONNode::type(void) const { JSON_CHECK_INTERNAL();
return internal -> type();
}
-inline json_string JSONNode::name(void) const {
+inline const json_char* JSONNode::name(void) const {
JSON_CHECK_INTERNAL();
return internal -> name();
}
diff --git a/src/mir_core/json/internalJSONNode.h b/src/mir_core/json/internalJSONNode.h index 8832bbd828..9ed7680a45 100644 --- a/src/mir_core/json/internalJSONNode.h +++ b/src/mir_core/json/internalJSONNode.h @@ -81,7 +81,7 @@ public: bool empty(void) const;
unsigned char type(void) const;
- json_string name(void) const;
+ const json_char* name(void) const;
void setname(const json_string & newname);
#ifdef JSON_COMMENTS
void setcomment(const json_string & comment);
@@ -260,8 +260,8 @@ inline unsigned char internalJSONNode::type(void) const { #endif
}
-inline json_string internalJSONNode::name(void) const {
- return _name;
+inline const json_char* internalJSONNode::name(void) const {
+ return _name.c_str();
}
inline void internalJSONNode::setname(const json_string & newname){
diff --git a/src/mir_core/json/libJSON.cpp b/src/mir_core/json/libJSON.cpp index 077af1b961..e3599e8936 100644 --- a/src/mir_core/json/libJSON.cpp +++ b/src/mir_core/json/libJSON.cpp @@ -266,9 +266,9 @@ MIR_CORE_DLL(int) json_empty(const JSONNODE * node){ return (int)(((JSONNode*)node) -> empty());
}
-MIR_CORE_DLL(json_char*) json_name(const JSONNODE * node){
- JSON_ASSERT_SAFE(node, JSON_TEXT("null node to json_name"), return toCString(EMPTY_CSTRING););
- return toCString(((JSONNode*)node) -> name());
+MIR_CORE_DLL(const json_char*) json_name(const JSONNODE * node){
+ JSON_ASSERT_SAFE(node, JSON_TEXT("null node to json_name"), return EMPTY_CSTRING;);
+ return ((JSONNode*)node) -> name();
}
#ifdef JSON_COMMENTS
|