Rename the class Json to avoid symbol conflicts with Jsoncpp 73/132973/2
authorMu-Woong Lee <muwoong.lee@samsung.com>
Thu, 8 Jun 2017 12:24:06 +0000 (21:24 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Thu, 8 Jun 2017 12:25:17 +0000 (12:25 +0000)
The class CtxJson, which is a wrapper of glib-json, will be removed later.

Change-Id: I357d49fa836f4541d46ef4ee7425f993780ad9e7
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
include/CtxJson.h [moved from include/Json.h with 69% similarity]
src/shared/CtxJson.cpp [moved from src/shared/Json.cpp with 78% similarity]

similarity index 69%
rename from include/Json.h
rename to include/CtxJson.h
index dda6968..4f661e4 100644 (file)
@@ -31,47 +31,47 @@ do { \
 
 namespace ctx {
 
-       class EXPORT_API Json {
+       class EXPORT_API CtxJson {
        public:
-               Json();
-               Json(const char *s);
-               Json(const std::string &s);
-
-               /* This Json(const Json &j) only copies the reference to the underlying Json node.
-                * Therefore, changes applied to a Json object affect the other.
-                * If you need to create a 'real' copy of a Json, which can be manipulated separately,
-                * utilize the str() function, e.g., ctx::Json copy(original.str());
+               CtxJson();
+               CtxJson(const char *s);
+               CtxJson(const std::string &s);
+
+               /* This CtxJson(const CtxJson &j) only copies the reference to the underlying CtxJson node.
+                * Therefore, changes applied to a CtxJson object affect the other.
+                * If you need to create a 'real' copy of a CtxJson, which can be manipulated separately,
+                * utilize the str() function, e.g., ctx::CtxJson copy(original.str());
                 */
-               Json(const Json &j);
+               CtxJson(const CtxJson &j);
 
-               ~Json();
+               ~CtxJson();
 
-               Json& operator=(const char *s);
-               Json& operator=(const std::string &s);
+               CtxJson& operator=(const char *s);
+               CtxJson& operator=(const std::string &s);
 
-               /* This operator=(const Json &j) only copies the reference to the underlying Json node.
-                * Therefore, changes applied to a Json object affect the other.
-                * If you need to create a 'real' copy of a Json, which can be manipulated separately,
-                * utilize the str() function, e.g., ctx::Json copy = original.str();
+               /* This operator=(const CtxJson &j) only copies the reference to the underlying CtxJson node.
+                * Therefore, changes applied to a CtxJson object affect the other.
+                * If you need to create a 'real' copy of a CtxJson, which can be manipulated separately,
+                * utilize the str() function, e.g., ctx::CtxJson copy = original.str();
                 */
-               Json& operator=(const Json &j);
+               CtxJson& operator=(const CtxJson &j);
 
-               bool operator==(const Json &rhs);
-               bool operator!=(const Json &rhs);
+               bool operator==(const CtxJson &rhs);
+               bool operator!=(const CtxJson &rhs);
 
                std::string str();
 
                bool getKeys(std::list<std::string> *list);
                bool valid();
 
-               bool set(const char *path, const char *key, Json &val);
+               bool set(const char *path, const char *key, CtxJson &val);
                bool set(const char *path, const char *key, int val);
                bool set(const char *path, const char *key, int64_t val);
                bool set(const char *path, const char *key, double val);
                bool set(const char *path, const char *key, std::string val);
                bool set(const char *path, const char *key, GVariant *val);
 
-               bool get(const char *path, const char *key, Json *val);
+               bool get(const char *path, const char *key, CtxJson *val);
                bool get(const char *path, const char *key, int *val);
                bool get(const char *path, const char *key, int64_t *val);
                bool get(const char *path, const char *key, double *val);
@@ -83,19 +83,19 @@ namespace ctx {
                /* Array operations */
                int getSize(const char *path, const char *key);
 
-               bool append(const char *path, const char *key, Json &val);
+               bool append(const char *path, const char *key, CtxJson &val);
                bool append(const char *path, const char *key, int val);
                bool append(const char *path, const char *key, int64_t val);
                bool append(const char *path, const char *key, double val);
                bool append(const char *path, const char *key, std::string val);
 
-               bool setAt(const char *path, const char *key, int index, Json &val);
+               bool setAt(const char *path, const char *key, int index, CtxJson &val);
                bool setAt(const char *path, const char *key, int index, int val);
                bool setAt(const char *path, const char *key, int index, int64_t val);
                bool setAt(const char *path, const char *key, int index, double val);
                bool setAt(const char *path, const char *key, int index, std::string val);
 
-               bool getAt(const char *path, const char *key, int index, Json *val);
+               bool getAt(const char *path, const char *key, int index, CtxJson *val);
                bool getAt(const char *path, const char *key, int index, int *val);
                bool getAt(const char *path, const char *key, int index, int64_t *val);
                bool getAt(const char *path, const char *key, int index, double *val);
similarity index 78%
rename from src/shared/Json.cpp
rename to src/shared/CtxJson.cpp
index 6a0a124..c226271 100644 (file)
@@ -21,7 +21,7 @@
 #include <locale>
 #include <iomanip>
 #include <json-glib/json-glib.h>
-#include <Json.h>
+#include <CtxJson.h>
 
 #define PATH_DELIM     '.'
 #define MAX_PRECISION 15
@@ -87,30 +87,30 @@ static double __string_to_double(const char* in)
        return out;
 }
 
-Json::Json() :
+CtxJson::CtxJson() :
        __jsonNode(NULL)
 {
        JsonObject *obj = json_object_new();
-       IF_FAIL_VOID_TAG(obj, _E, "Json object construction failed");
+       IF_FAIL_VOID_TAG(obj, _E, "CtxJson object construction failed");
 
        __jsonNode = json_node_new(JSON_NODE_OBJECT);
        if (!__jsonNode) {
                json_object_unref(obj);
-               _E("Json object construction failed");
+               _E("CtxJson object construction failed");
        }
 
        json_node_set_object(__jsonNode, obj);
        json_object_unref(obj);
 }
 
-Json::Json(const Json &j)
+CtxJson::CtxJson(const CtxJson &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, "CtxJson object construction failed");
 }
 
-Json::Json(const char *s)
+CtxJson::CtxJson(const char *s)
        : __jsonNode(NULL)
 {
        if (s) {
@@ -120,7 +120,7 @@ Json::Json(const char *s)
        }
 }
 
-Json::Json(const std::string &s)
+CtxJson::CtxJson(const std::string &s)
        : __jsonNode(NULL)
 {
        if (s.empty()) {
@@ -130,12 +130,12 @@ Json::Json(const std::string &s)
        }
 }
 
-Json::~Json()
+CtxJson::~CtxJson()
 {
        __release();
 }
 
-void Json::__parse(const char *s)
+void CtxJson::__parse(const char *s)
 {
        gboolean result;
        JsonParser *parser = NULL;
@@ -158,7 +158,7 @@ CATCH:
                g_object_unref(parser);
 }
 
-void Json::__release()
+void CtxJson::__release()
 {
        if (__jsonNode) {
                json_node_free(__jsonNode);
@@ -166,22 +166,22 @@ void Json::__release()
        }
 }
 
-bool Json::valid()
+bool CtxJson::valid()
 {
        return (__jsonNode != NULL);
 }
 
-Json& Json::operator=(const Json &j)
+CtxJson& CtxJson::operator=(const CtxJson &j)
 {
        __release();
        __jsonNode = json_node_copy(j.__jsonNode);
        if (!__jsonNode) {
-               _E("Json object copy failed");
+               _E("CtxJson object copy failed");
        }
        return *this;
 }
 
-Json& Json::operator=(const char *s)
+CtxJson& CtxJson::operator=(const char *s)
 {
        __release();
        if (s) {
@@ -192,7 +192,7 @@ Json& Json::operator=(const char *s)
        return *this;
 }
 
-Json& Json::operator=(const std::string &s)
+CtxJson& CtxJson::operator=(const std::string &s)
 {
        __release();
        if (s.empty()) {
@@ -203,19 +203,19 @@ Json& Json::operator=(const std::string &s)
        return *this;
 }
 
-bool Json::operator==(const Json &rhs)
+bool CtxJson::operator==(const CtxJson &rhs)
 {
        return __nodeEq(__jsonNode, rhs.__jsonNode);
 }
 
-bool Json::operator!=(const Json &rhs)
+bool CtxJson::operator!=(const CtxJson &rhs)
 {
        return !operator==(rhs);
 }
 
-char* Json::__strDup()
+char* CtxJson::__strDup()
 {
-       IF_FAIL_RETURN_TAG(__jsonNode, NULL, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(__jsonNode, NULL, _E, "CtxJson object not initialized");
 
        JsonGenerator *jgen = NULL;
        char *output = NULL;
@@ -239,7 +239,7 @@ CATCH:
        return NULL;
 }
 
-std::string Json::str()
+std::string CtxJson::str()
 {
        std::string output;
        char *_s = __strDup();
@@ -302,9 +302,9 @@ static JsonObject* __traverse(JsonNode *jnode, const char *path, bool force)
        return jobj;
 }
 
-bool Json::set(const char *path, const char *key, Json &val)
+bool CtxJson::set(const char *path, const char *key, CtxJson &val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val.__jsonNode, false, _E, "Invalid parameter");
 
        JsonObject *jobj = __traverse(__jsonNode, path, true);
@@ -315,19 +315,19 @@ 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 = CtxJson();
 
        return true;
 }
 
-bool Json::set(const char *path, const char *key, int val)
+bool CtxJson::set(const char *path, const char *key, int val)
 {
        return set(path, key, static_cast<int64_t>(val));
 }
 
-bool Json::set(const char *path, const char *key, int64_t val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key, false, _E, "Invalid parameter");
 
        JsonObject *jobj = __traverse(__jsonNode, path, true);
@@ -340,14 +340,14 @@ bool Json::set(const char *path, const char *key, int64_t val)
        return true;
 }
 
-bool Json::set(const char *path, const char *key, double val)
+bool CtxJson::set(const char *path, const char *key, double val)
 {
        return set(path, key, __double_to_string(val));
 }
 
-bool Json::set(const char *path, const char *key, std::string val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key, false, _E, "Invalid parameter");
 
        JsonObject *jobj = __traverse(__jsonNode, path, true);
@@ -361,10 +361,10 @@ bool Json::set(const char *path, const char *key, std::string val)
        return true;
 }
 
-bool Json::set(const char *path, const char *key, GVariant *val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        const gchar *typeStr = g_variant_get_type_string(val);
@@ -373,7 +373,7 @@ 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;
+       CtxJson gvarJson;
        gvarJson.set(NULL, GVAR_TYPES, std::string(typeStr));
        json_object_set_member(json_node_get_object(gvarJson.__jsonNode), GVAR_VALUES, node);
 
@@ -384,9 +384,9 @@ bool Json::set(const char *path, const char *key, GVariant *val)
 #endif
 }
 
-bool Json::get(const char *path, const char *key, Json *val)
+bool CtxJson::get(const char *path, const char *key, CtxJson *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        JsonObject *jobj = NULL;
@@ -422,9 +422,9 @@ static JsonNode* __get_value_node(JsonNode *jnode, const char *path, const char
        return node;
 }
 
-bool Json::get(const char *path, const char *key, int *val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        int64_t v;
@@ -437,9 +437,9 @@ bool Json::get(const char *path, const char *key, int *val)
        return false;
 }
 
-bool Json::get(const char *path, const char *key, int64_t *val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_value_node(__jsonNode, path, key);
@@ -458,9 +458,9 @@ bool Json::get(const char *path, const char *key, int64_t *val)
        return true;
 }
 
-bool Json::get(const char *path, const char *key, double *val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_value_node(__jsonNode, path, key);
@@ -480,9 +480,9 @@ bool Json::get(const char *path, const char *key, double *val)
        return true;
 }
 
-bool Json::get(const char *path, const char *key, std::string *val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_value_node(__jsonNode, path, key);
@@ -498,14 +498,14 @@ bool Json::get(const char *path, const char *key, std::string *val)
        return true;
 }
 
-bool Json::get(const char *path, const char *key, GVariant **val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val, false, _E, "Invalid parameter");
 
        bool ret;
-       Json gvarJson;
+       CtxJson gvarJson;
        ret = get(path, key, &gvarJson);
        IF_FAIL_RETURN(ret, false);
 
@@ -513,7 +513,7 @@ 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;
+       CtxJson gvarValues;
        ret = gvarJson.get(NULL, GVAR_VALUES, &gvarValues);
        IF_FAIL_RETURN(ret, false);
 
@@ -530,9 +530,9 @@ bool Json::get(const char *path, const char *key, GVariant **val)
 #endif
 }
 
-bool Json::remove(const char *path, const char *key)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key, false, _E, "Invalid parameter");
 
        JsonObject *jobj = __traverse(__jsonNode, path, true);
@@ -569,9 +569,9 @@ static JsonArray* __get_array(JsonNode *jnode, const char *path, const char *key
        return json_node_get_array(node);
 }
 
-int Json::getSize(const char *path, const char *key)
+int CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key, -1, _E, "Invalid parameter");
 
        JsonArray *jarr = __get_array(__jsonNode, path, key, false);
@@ -580,9 +580,9 @@ int Json::getSize(const char *path, const char *key)
        return json_array_get_length(jarr);
 }
 
-bool Json::append(const char *path, const char *key, Json &val)
+bool CtxJson::append(const char *path, const char *key, CtxJson &val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val.__jsonNode, false, _E, "Invalid parameter");
 
        JsonArray *arr = __get_array(__jsonNode, path, key, true);
@@ -590,19 +590,19 @@ bool Json::append(const char *path, const char *key, Json &val)
 
        json_array_add_element(arr, val.__jsonNode);
        val.__jsonNode = NULL;
-       val = Json();
+       val = CtxJson();
 
        return true;
 }
 
-bool Json::append(const char *path, const char *key, int val)
+bool CtxJson::append(const char *path, const char *key, int val)
 {
        return append(path, key, static_cast<int64_t>(val));
 }
 
-bool Json::append(const char *path, const char *key, int64_t val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key, false, _E, "Invalid parameter");
 
        JsonArray *arr = __get_array(__jsonNode, path, key, true);
@@ -612,14 +612,14 @@ bool Json::append(const char *path, const char *key, int64_t val)
        return true;
 }
 
-bool Json::append(const char *path, const char *key, double val)
+bool CtxJson::append(const char *path, const char *key, double val)
 {
        return append(path, key, __double_to_string(val));
 }
 
-bool Json::append(const char *path, const char *key, std::string val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key, false, _E, "Invalid parameter");
 
        JsonArray *arr = __get_array(__jsonNode, path, key, true);
@@ -643,9 +643,9 @@ static JsonNode* __get_array_elem(JsonNode *jnode, const char *path, const char
        return node;
 }
 
-bool Json::setAt(const char *path, const char *key, int index, Json &val)
+bool CtxJson::setAt(const char *path, const char *key, int index, CtxJson &val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson 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);
@@ -657,19 +657,19 @@ bool Json::setAt(const char *path, const char *key, int index, Json &val)
        json_node_set_object(node, obj);
        json_node_free(val.__jsonNode);
        val.__jsonNode = NULL;
-       val = Json();
+       val = CtxJson();
 
        return true;
 }
 
-bool Json::setAt(const char *path, const char *key, int index, int val)
+bool CtxJson::setAt(const char *path, const char *key, int index, int val)
 {
        return setAt(path, key, index, static_cast<int64_t>(val));
 }
 
-bool Json::setAt(const char *path, const char *key, int index, int64_t val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -680,14 +680,14 @@ bool Json::setAt(const char *path, const char *key, int index, int64_t val)
        return true;
 }
 
-bool Json::setAt(const char *path, const char *key, int index, double val)
+bool CtxJson::setAt(const char *path, const char *key, int index, double val)
 {
        return setAt(path, key, index, __double_to_string(val));
 }
 
-bool Json::setAt(const char *path, const char *key, int index, std::string val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -698,9 +698,9 @@ bool Json::setAt(const char *path, const char *key, int index, std::string val)
        return true;
 }
 
-bool Json::getAt(const char *path, const char *key, int index, Json *val)
+bool CtxJson::getAt(const char *path, const char *key, int index, CtxJson *val)
 {
-       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "Json object not initialized");
+       IF_FAIL_RETURN_TAG(this->__jsonNode, false, _E, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -717,9 +717,9 @@ bool Json::getAt(const char *path, const char *key, int index, Json *val)
        return true;
 }
 
-bool Json::getAt(const char *path, const char *key, int index, int *val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val && index >= 0, false, _E, "Invalid parameter");
 
        int64_t v;
@@ -731,9 +731,9 @@ bool Json::getAt(const char *path, const char *key, int index, int *val)
        return false;
 }
 
-bool Json::getAt(const char *path, const char *key, int index, int64_t *val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -755,9 +755,9 @@ bool Json::getAt(const char *path, const char *key, int index, int64_t *val)
        return true;
 }
 
-bool Json::getAt(const char *path, const char *key, int index, double *val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -781,9 +781,9 @@ bool Json::getAt(const char *path, const char *key, int index, double *val)
        return true;
 }
 
-bool Json::getAt(const char *path, const char *key, int index, std::string *val)
+bool CtxJson::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, "CtxJson object not initialized");
        IF_FAIL_RETURN_TAG(key && val && index >= 0, false, _E, "Invalid parameter");
 
        JsonNode *node = __get_array_elem(__jsonNode, path, key, index);
@@ -802,13 +802,13 @@ bool Json::getAt(const char *path, const char *key, int index, std::string *val)
        return true;
 }
 
-bool Json::__getMembers(json_node_t *node, std::list<std::string> &list)
+bool CtxJson::__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 CtxJson object failed");
 
        GList *members = json_object_get_members(jobj);
        IF_FAIL_RETURN(members, true);
@@ -829,13 +829,13 @@ bool Json::__getMembers(json_node_t *node, std::list<std::string> &list)
        return true;
 }
 
-bool Json::getKeys(std::list<std::string>* list)
+bool CtxJson::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 CtxJson::__nodeEq(json_node_t *lhs, json_node_t *rhs)
 {
        IF_FAIL_RETURN(lhs && rhs, false);
 
@@ -861,7 +861,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 CtxJson::__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);
@@ -880,7 +880,7 @@ bool Json::__valueEq(json_node_t *lhs, json_node_t *rhs)
        }
 }
 
-bool Json::__objectEq(json_node_t *lhs, json_node_t *rhs)
+bool CtxJson::__objectEq(json_node_t *lhs, json_node_t *rhs)
 {
        std::list<std::string> lm, rm;
        IF_FAIL_RETURN(__getMembers(lhs, lm), false);
@@ -908,7 +908,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 CtxJson::__arrayEq(json_node_t *lhs, json_node_t *rhs)
 {
        JsonArray *larr = json_node_get_array(lhs);
        JsonArray *rarr = json_node_get_array(rhs);