Rename the class Json to avoid symbol conflicts with Jsoncpp
[platform/core/context/context-provider.git] / common / shared / CtxJson1.cpp
similarity index 76%
rename from common/shared/Json.cpp
rename to common/shared/CtxJson1.cpp
index 2f8a1b8..461448b 100644 (file)
@@ -22,7 +22,7 @@
 #include <iomanip>
 #include <json-glib/json-glib.h>
 #include <Types.h>
-#include <Json.h>
+#include <CtxJson1.h>
 
 #define PATH_DELIM     '.'
 #define MAX_PRECISION 15
@@ -86,30 +86,30 @@ static double __string_to_double(const char* in)
        return out;
 }
 
-SO_EXPORT Json::Json() :
+SO_EXPORT CtxJson1::CtxJson1() :
        __jsonNode(NULL)
 {
        JsonObject *obj = json_object_new();
-       IF_FAIL_VOID_TAG(obj, _E, "Json object construction failed");
+       IF_FAIL_VOID_TAG(obj, _E, "CtxJson1 object construction failed");
 
        __jsonNode = json_node_new(JSON_NODE_OBJECT);
        if (!__jsonNode) {
                json_object_unref(obj);
-               _E("Json object construction failed");
+               _E("CtxJson1 object construction failed");
        }
 
        json_node_set_object(__jsonNode, obj);
        json_object_unref(obj);
 }
 
-SO_EXPORT Json::Json(const Json &j)
+SO_EXPORT CtxJson1::CtxJson1(const CtxJson1 &j)
        : __jsonNode(NULL)
 {
        __jsonNode = json_node_copy(j.__jsonNode);
-       IF_FAIL_VOID_TAG(__jsonNode, _E, "Json object construction failed");
+       IF_FAIL_VOID_TAG(__jsonNode, _E, "CtxJson1 object construction failed");
 }
 
-SO_EXPORT Json::Json(const char *s)
+SO_EXPORT CtxJson1::CtxJson1(const char *s)
        : __jsonNode(NULL)
 {
        if (s) {
@@ -119,7 +119,7 @@ SO_EXPORT Json::Json(const char *s)
        }
 }
 
-SO_EXPORT Json::Json(const std::string &s)
+SO_EXPORT CtxJson1::CtxJson1(const std::string &s)
        : __jsonNode(NULL)
 {
        if (s.empty()) {
@@ -129,12 +129,12 @@ SO_EXPORT Json::Json(const std::string &s)
        }
 }
 
-SO_EXPORT Json::~Json()
+SO_EXPORT CtxJson1::~CtxJson1()
 {
        __release();
 }
 
-void Json::__parse(const char *s)
+void CtxJson1::__parse(const char *s)
 {
        gboolean result;
        JsonParser *parser = NULL;
@@ -157,7 +157,7 @@ CATCH:
                g_object_unref(parser);
 }
 
-void Json::__release()
+void CtxJson1::__release()
 {
        if (__jsonNode) {
                json_node_free(__jsonNode);
@@ -165,22 +165,22 @@ void Json::__release()
        }
 }
 
-SO_EXPORT bool Json::valid()
+SO_EXPORT bool CtxJson1::valid()
 {
        return (__jsonNode != NULL);
 }
 
-SO_EXPORT Json& Json::operator=(const Json &j)
+SO_EXPORT CtxJson1& CtxJson1::operator=(const CtxJson1 &j)
 {
        __release();
        __jsonNode = json_node_copy(j.__jsonNode);
        if (!__jsonNode) {
-               _E("Json object copy failed");
+               _E("CtxJson1 object copy failed");
        }
        return *this;
 }
 
-SO_EXPORT Json& Json::operator=(const char *s)
+SO_EXPORT CtxJson1& CtxJson1::operator=(const char *s)
 {
        __release();
        if (s) {
@@ -191,7 +191,7 @@ SO_EXPORT Json& Json::operator=(const char *s)
        return *this;
 }
 
-SO_EXPORT Json& Json::operator=(const std::string &s)
+SO_EXPORT CtxJson1& CtxJson1::operator=(const std::string &s)
 {
        __release();
        if (s.empty()) {
@@ -202,19 +202,19 @@ SO_EXPORT Json& Json::operator=(const std::string &s)
        return *this;
 }
 
-SO_EXPORT bool Json::operator==(const Json &rhs)
+SO_EXPORT bool CtxJson1::operator==(const CtxJson1 &rhs)
 {
        return __nodeEq(__jsonNode, rhs.__jsonNode);
 }
 
-SO_EXPORT bool Json::operator!=(const Json &rhs)
+SO_EXPORT bool CtxJson1::operator!=(const CtxJson1 &rhs)
 {
        return !operator==(rhs);
 }
 
-char* Json::__strDup()
+char* CtxJson1::__strDup()
 {
-       IF_FAIL_RETURN_TAG(__jsonNode, NULL, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(__jsonNode, NULL, _E, "CtxJson1 object not initialized");
 
        JsonGenerator *jgen = NULL;
        char *output = NULL;
@@ -238,7 +238,7 @@ CATCH:
        return NULL;
 }
 
-SO_EXPORT std::string Json::str()
+SO_EXPORT std::string CtxJson1::str()
 {
        std::string output;
        char *_s = __strDup();
@@ -301,9 +301,9 @@ static JsonObject* __traverse(JsonNode *jnode, const char *path, bool force)
        return jobj;
 }
 
-SO_EXPORT bool Json::set(const char *path, const char *key, Json &val)
+SO_EXPORT bool CtxJson1::set(const char *path, const char *key, CtxJson1 &val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val.__jsonNode, false, _E, "Invalid parameter");
 
        JsonObject *jobj = __traverse(__jsonNode, path, true);
@@ -314,19 +314,19 @@ SO_EXPORT bool Json::set(const char *path, const char *key, Json &val)
 
        json_object_set_member(jobj, key, val.__jsonNode);
        val.__jsonNode = NULL;
-       val = Json();
+       val = CtxJson1();
 
        return true;
 }
 
-SO_EXPORT bool Json::set(const char *path, const char *key, int val)
+SO_EXPORT bool CtxJson1::set(const char *path, const char *key, int val)
 {
        return set(path, key, static_cast<int64_t>(val));
 }
 
-SO_EXPORT bool Json::set(const char *path, const char *key, int64_t val)
+SO_EXPORT bool CtxJson1::set(const char *path, const char *key, int64_t val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key, false, _E, "Invalid parameter");
 
        JsonObject *jobj = __traverse(__jsonNode, path, true);
@@ -339,14 +339,14 @@ SO_EXPORT bool Json::set(const char *path, const char *key, int64_t val)
        return true;
 }
 
-SO_EXPORT bool Json::set(const char *path, const char *key, double val)
+SO_EXPORT bool CtxJson1::set(const char *path, const char *key, double val)
 {
        return set(path, key, __double_to_string(val));
 }
 
-SO_EXPORT bool Json::set(const char *path, const char *key, std::string val)
+SO_EXPORT bool CtxJson1::set(const char *path, const char *key, std::string val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key, false, _E, "Invalid parameter");
 
        JsonObject *jobj = __traverse(__jsonNode, path, true);
@@ -360,10 +360,10 @@ SO_EXPORT bool Json::set(const char *path, const char *key, std::string val)
        return true;
 }
 
-SO_EXPORT bool Json::set(const char *path, const char *key, GVariant *val)
+SO_EXPORT bool CtxJson1::set(const char *path, const char *key, GVariant *val)
 {
 #if JSON_CHECK_VERSION(0, 14, 0)
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        const gchar *typeStr = g_variant_get_type_string(val);
@@ -372,7 +372,7 @@ SO_EXPORT bool Json::set(const char *path, const char *key, GVariant *val)
        json_node_t *node = json_gvariant_serialize(val);
        IF_FAIL_RETURN_TAG(node, false, _E, "GVariant manipulation failed");
 
-       Json gvarJson;
+       CtxJson1 gvarJson;
        gvarJson.set(NULL, GVAR_TYPES, std::string(typeStr));
        json_object_set_member(json_node_get_object(gvarJson.__jsonNode), GVAR_VALUES, node);
 
@@ -383,9 +383,9 @@ SO_EXPORT bool Json::set(const char *path, const char *key, GVariant *val)
 #endif
 }
 
-SO_EXPORT bool Json::get(const char *path, const char *key, Json *val)
+SO_EXPORT bool CtxJson1::get(const char *path, const char *key, CtxJson1 *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        JsonObject *jobj = NULL;
@@ -421,9 +421,9 @@ static JsonNode* __get_value_node(JsonNode *jnode, const char *path, const char
        return node;
 }
 
-SO_EXPORT bool Json::get(const char *path, const char *key, int *val)
+SO_EXPORT bool CtxJson1::get(const char *path, const char *key, int *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        int64_t v;
@@ -436,9 +436,9 @@ SO_EXPORT bool Json::get(const char *path, const char *key, int *val)
        return false;
 }
 
-SO_EXPORT bool Json::get(const char *path, const char *key, int64_t *val)
+SO_EXPORT bool CtxJson1::get(const char *path, const char *key, int64_t *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_value_node(__jsonNode, path, key);
@@ -457,9 +457,9 @@ SO_EXPORT bool Json::get(const char *path, const char *key, int64_t *val)
        return true;
 }
 
-SO_EXPORT bool Json::get(const char *path, const char *key, double *val)
+SO_EXPORT bool CtxJson1::get(const char *path, const char *key, double *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_value_node(__jsonNode, path, key);
@@ -479,9 +479,9 @@ SO_EXPORT bool Json::get(const char *path, const char *key, double *val)
        return true;
 }
 
-SO_EXPORT bool Json::get(const char *path, const char *key, std::string *val)
+SO_EXPORT bool CtxJson1::get(const char *path, const char *key, std::string *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_value_node(__jsonNode, path, key);
@@ -497,14 +497,14 @@ SO_EXPORT bool Json::get(const char *path, const char *key, std::string *val)
        return true;
 }
 
-SO_EXPORT bool Json::get(const char *path, const char *key, GVariant **val)
+SO_EXPORT bool CtxJson1::get(const char *path, const char *key, GVariant **val)
 {
 #if JSON_CHECK_VERSION(0, 14, 0)
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        bool ret;
-       Json gvarJson;
+       CtxJson1 gvarJson;
        ret = get(path, key, &gvarJson);
        IF_FAIL_RETURN(ret, false);
 
@@ -512,7 +512,7 @@ SO_EXPORT bool Json::get(const char *path, const char *key, GVariant **val)
        ret = gvarJson.get(NULL, GVAR_TYPES, &gvarTypes);
        IF_FAIL_RETURN(ret, false);
 
-       Json gvarValues;
+       CtxJson1 gvarValues;
        ret = gvarJson.get(NULL, GVAR_VALUES, &gvarValues);
        IF_FAIL_RETURN(ret, false);
 
@@ -529,9 +529,9 @@ SO_EXPORT bool Json::get(const char *path, const char *key, GVariant **val)
 #endif
 }
 
-SO_EXPORT bool Json::remove(const char *path, const char *key)
+SO_EXPORT bool CtxJson1::remove(const char *path, const char *key)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key, false, _E, "Invalid parameter");
 
        JsonObject *jobj = __traverse(__jsonNode, path, true);
@@ -568,9 +568,9 @@ static JsonArray* __get_array(JsonNode *jnode, const char *path, const char *key
        return json_node_get_array(node);
 }
 
-SO_EXPORT int Json::getSize(const char *path, const char *key)
+SO_EXPORT int CtxJson1::getSize(const char *path, const char *key)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, -1, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, -1, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key, -1, _E, "Invalid parameter");
 
        JsonArray *jarr = __get_array(__jsonNode, path, key, false);
@@ -579,9 +579,9 @@ SO_EXPORT int Json::getSize(const char *path, const char *key)
        return json_array_get_length(jarr);
 }
 
-SO_EXPORT bool Json::append(const char *path, const char *key, Json &val)
+SO_EXPORT bool CtxJson1::append(const char *path, const char *key, CtxJson1 &val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val.__jsonNode, false, _E, "Invalid parameter");
 
        JsonArray *arr = __get_array(__jsonNode, path, key, true);
@@ -589,19 +589,19 @@ SO_EXPORT bool Json::append(const char *path, const char *key, Json &val)
 
        json_array_add_element(arr, val.__jsonNode);
        val.__jsonNode = NULL;
-       val = Json();
+       val = CtxJson1();
 
        return true;
 }
 
-SO_EXPORT bool Json::append(const char *path, const char *key, int val)
+SO_EXPORT bool CtxJson1::append(const char *path, const char *key, int val)
 {
        return append(path, key, static_cast<int64_t>(val));
 }
 
-SO_EXPORT bool Json::append(const char *path, const char *key, int64_t val)
+SO_EXPORT bool CtxJson1::append(const char *path, const char *key, int64_t val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key, false, _E, "Invalid parameter");
 
        JsonArray *arr = __get_array(__jsonNode, path, key, true);
@@ -611,14 +611,14 @@ SO_EXPORT bool Json::append(const char *path, const char *key, int64_t val)
        return true;
 }
 
-SO_EXPORT bool Json::append(const char *path, const char *key, double val)
+SO_EXPORT bool CtxJson1::append(const char *path, const char *key, double val)
 {
        return append(path, key, __double_to_string(val));
 }
 
-SO_EXPORT bool Json::append(const char *path, const char *key, std::string val)
+SO_EXPORT bool CtxJson1::append(const char *path, const char *key, std::string val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key, false, _E, "Invalid parameter");
 
        JsonArray *arr = __get_array(__jsonNode, path, key, true);
@@ -642,9 +642,9 @@ static JsonNode* __get_array_elem(JsonNode *jnode, const char *path, const char
        return node;
 }
 
-SO_EXPORT bool Json::setAt(const char *path, const char *key, int index, Json &val)
+SO_EXPORT bool CtxJson1::setAt(const char *path, const char *key, int index, CtxJson1 &val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(val.__jsonNode && key && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -656,19 +656,19 @@ SO_EXPORT bool Json::setAt(const char *path, const char *key, int index, Json &v
        json_node_set_object(node, obj);
        json_node_free(val.__jsonNode);
        val.__jsonNode = NULL;
-       val = Json();
+       val = CtxJson1();
 
        return true;
 }
 
-SO_EXPORT bool Json::setAt(const char *path, const char *key, int index, int val)
+SO_EXPORT bool CtxJson1::setAt(const char *path, const char *key, int index, int val)
 {
        return setAt(path, key, index, static_cast<int64_t>(val));
 }
 
-SO_EXPORT bool Json::setAt(const char *path, const char *key, int index, int64_t val)
+SO_EXPORT bool CtxJson1::setAt(const char *path, const char *key, int index, int64_t val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -679,14 +679,14 @@ SO_EXPORT bool Json::setAt(const char *path, const char *key, int index, int64_t
        return true;
 }
 
-SO_EXPORT bool Json::setAt(const char *path, const char *key, int index, double val)
+SO_EXPORT bool CtxJson1::setAt(const char *path, const char *key, int index, double val)
 {
        return setAt(path, key, index, __double_to_string(val));
 }
 
-SO_EXPORT bool Json::setAt(const char *path, const char *key, int index, std::string val)
+SO_EXPORT bool CtxJson1::setAt(const char *path, const char *key, int index, std::string val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -697,9 +697,9 @@ SO_EXPORT bool Json::setAt(const char *path, const char *key, int index, std::st
        return true;
 }
 
-SO_EXPORT bool Json::getAt(const char *path, const char *key, int index, Json *val)
+SO_EXPORT bool CtxJson1::getAt(const char *path, const char *key, int index, CtxJson1 *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -716,9 +716,9 @@ SO_EXPORT bool Json::getAt(const char *path, const char *key, int index, Json *v
        return true;
 }
 
-SO_EXPORT bool Json::getAt(const char *path, const char *key, int index, int *val)
+SO_EXPORT bool CtxJson1::getAt(const char *path, const char *key, int index, int *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val && index >= 0, false, _E, "Invalid parameter");
 
        int64_t v;
@@ -730,9 +730,9 @@ SO_EXPORT bool Json::getAt(const char *path, const char *key, int index, int *va
        return false;
 }
 
-SO_EXPORT bool Json::getAt(const char *path, const char *key, int index, int64_t *val)
+SO_EXPORT bool CtxJson1::getAt(const char *path, const char *key, int index, int64_t *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -754,9 +754,9 @@ SO_EXPORT bool Json::getAt(const char *path, const char *key, int index, int64_t
        return true;
 }
 
-SO_EXPORT bool Json::getAt(const char *path, const char *key, int index, double *val)
+SO_EXPORT bool CtxJson1::getAt(const char *path, const char *key, int index, double *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -780,9 +780,9 @@ SO_EXPORT bool Json::getAt(const char *path, const char *key, int index, double
        return true;
 }
 
-SO_EXPORT bool Json::getAt(const char *path, const char *key, int index, std::string *val)
+SO_EXPORT bool CtxJson1::getAt(const char *path, const char *key, int index, std::string *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson1 object not initialized");
        IF_FAIL_RETURN_TAG(key && val && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -801,13 +801,13 @@ SO_EXPORT bool Json::getAt(const char *path, const char *key, int index, std::st
        return true;
 }
 
-bool Json::__getMembers(json_node_t *node, std::list<std::string> &list)
+bool CtxJson1::__getMembers(json_node_t *node, std::list<std::string> &list)
 {
        IF_FAIL_RETURN(node, false);
        list.clear();
 
        JsonObject *jobj = json_node_get_object(node);
-       IF_FAIL_RETURN_TAG(jobj, false, _E, "Getting Json object failed");
+       IF_FAIL_RETURN_TAG(jobj, false, _E, "Getting CtxJson1 object failed");
 
        GList *members = json_object_get_members(jobj);
        IF_FAIL_RETURN(members, true);
@@ -828,13 +828,13 @@ bool Json::__getMembers(json_node_t *node, std::list<std::string> &list)
        return true;
 }
 
-SO_EXPORT bool Json::getKeys(std::list<std::string>* list)
+SO_EXPORT bool CtxJson1::getKeys(std::list<std::string>* list)
 {
        IF_FAIL_RETURN_TAG(list, false, _E, "Invalid parameter");
        return __getMembers(__jsonNode, *list);
 }
 
-bool Json::__nodeEq(json_node_t *lhs, json_node_t *rhs)
+bool CtxJson1::__nodeEq(json_node_t *lhs, json_node_t *rhs)
 {
        IF_FAIL_RETURN(lhs && rhs, false);
 
@@ -860,7 +860,7 @@ bool Json::__nodeEq(json_node_t *lhs, json_node_t *rhs)
        return true;
 }
 
-bool Json::__valueEq(json_node_t *lhs, json_node_t *rhs)
+bool CtxJson1::__valueEq(json_node_t *lhs, json_node_t *rhs)
 {
        GType ltype = json_node_get_value_type(lhs);
        GType rtype = json_node_get_value_type(rhs);
@@ -879,7 +879,7 @@ bool Json::__valueEq(json_node_t *lhs, json_node_t *rhs)
        }
 }
 
-bool Json::__objectEq(json_node_t *lhs, json_node_t *rhs)
+bool CtxJson1::__objectEq(json_node_t *lhs, json_node_t *rhs)
 {
        std::list<std::string> lm, rm;
        IF_FAIL_RETURN(__getMembers(lhs, lm), false);
@@ -907,7 +907,7 @@ bool Json::__objectEq(json_node_t *lhs, json_node_t *rhs)
        return true;
 }
 
-bool Json::__arrayEq(json_node_t *lhs, json_node_t *rhs)
+bool CtxJson1::__arrayEq(json_node_t *lhs, json_node_t *rhs)
 {
        JsonArray *larr = json_node_get_array(lhs);
        JsonArray *rarr = json_node_get_array(rhs);