Rename the class Json to avoid symbol conflicts with Jsoncpp 76/132976/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Thu, 8 Jun 2017 12:27:46 +0000 (21:27 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Thu, 8 Jun 2017 12:27:46 +0000 (21:27 +0900)
Change-Id: Iaa1159d13e1f60808fdd540f27cc9c5a0681a1c7
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
src/server/legacy/RecorderClientInfo.cpp
src/server/legacy/RecorderClientInfo.h
src/server/legacy/SensorProvider.cpp
src/server/legacy/SensorProvider.h
src/server/legacy/heartrate/HeartRate.cpp
src/server/legacy/heartrate/HeartRate.h
src/server/legacy/heartrate/HeartRateLogger.cpp

index 0ab8619..2bf99d8 100644 (file)
@@ -55,7 +55,7 @@ RecorderClientInfo::~RecorderClientInfo()
        __uninstallMonitor = NULL;
 }
 
-int RecorderClientInfo::get(std::string subject, std::string pkgId, Json& option)
+int RecorderClientInfo::get(std::string subject, std::string pkgId, CtxJson& option)
 {
        bool ret;
        std::string optStr;
@@ -78,7 +78,7 @@ int RecorderClientInfo::get(std::string subject, std::string pkgId, Json& option
        return E_NONE;
 }
 
-int RecorderClientInfo::get(std::string subject, std::vector<Json>& options)
+int RecorderClientInfo::get(std::string subject, std::vector<CtxJson>& options)
 {
        bool ret;
        std::string optStr;
@@ -97,7 +97,7 @@ int RecorderClientInfo::get(std::string subject, std::vector<Json>& options)
 
        for (auto& tuple : tuples) {
                tuple->getAt(0, &optStr);
-               options.push_back(Json(optStr));
+               options.push_back(CtxJson(optStr));
        }
 
        return E_NONE;
@@ -122,7 +122,7 @@ bool RecorderClientInfo::exist(std::string subject)
        return true;
 }
 
-bool RecorderClientInfo::set(std::string subject, std::string pkgId, Json option, int retentionPeriod)
+bool RecorderClientInfo::set(std::string subject, std::string pkgId, CtxJson option, int retentionPeriod)
 {
        bool ret;
        char *query = sqlite3_mprintf(
@@ -149,11 +149,11 @@ bool RecorderClientInfo::remove(std::string subject, std::string pkgId)
        return ret;
 }
 
-void RecorderClientInfo::getParam(std::vector<Json> &options, const char *key, float *min, float *max)
+void RecorderClientInfo::getParam(std::vector<CtxJson> &options, const char *key, float *min, float *max)
 {
        double val;
 
-       for (Json& opt : options) {
+       for (CtxJson& opt : options) {
                if (!opt.get(NULL, key, &val))
                        continue;
                if (min)
index 9a8bbc9..0c85919 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <string>
 #include <vector>
-#include <Json.h>
+#include <CtxJson.h>
 #include <SensorRecorderTypesPrivate.h>
 #include "UninstallMonitor.h"
 
@@ -32,14 +32,14 @@ namespace ctx {
                RecorderClientInfo();
                ~RecorderClientInfo();
 
-               int get(std::string subject, std::string pkgId, Json& option);
-               int get(std::string subject, std::vector<Json>& options);
+               int get(std::string subject, std::string pkgId, CtxJson& option);
+               int get(std::string subject, std::vector<CtxJson>& options);
                bool exist(std::string subject);
 
-               bool set(std::string subject, std::string pkgId, Json option, int retentionPeriod);
+               bool set(std::string subject, std::string pkgId, CtxJson option, int retentionPeriod);
                bool remove(std::string subject, std::string pkgId);
 
-               void getParam(std::vector<Json>& options, const char *key, float *min, float *max);
+               void getParam(std::vector<CtxJson>& options, const char *key, float *min, float *max);
 
                static void purgeClient(std::string pkgId);
                static void setHostService(SensorRecorderService* hostService);
index 2103376..a31a050 100644 (file)
@@ -98,7 +98,7 @@ const char* SensorProvider::getPrivilege()
        return NULL;
 }
 
-int SensorProvider::readRecords(Json option, std::string* projection, std::vector<std::shared_ptr<Tuple>>* tuples)
+int SensorProvider::readRecords(CtxJson option, std::string* projection, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        int endTime = static_cast<int>(time(NULL)) + 1;
        int startTime = endTime - DEFAULT_QUERY_PERIOD - 1;
@@ -141,7 +141,7 @@ int SensorProvider::readRecords(Json option, std::string* projection, std::vecto
        return ret;
 }
 
-int SensorProvider::startRecording(const std::string& pkgId, Json option)
+int SensorProvider::startRecording(const std::string& pkgId, CtxJson option)
 {
        int retentionPeriod = DEFAULT_RETENTION;
 
@@ -165,16 +165,16 @@ int SensorProvider::stopRecording(const std::string& pkgId)
        return __removeClient(pkgId);
 }
 
-bool SensorProvider::verifyOption(Json option)
+bool SensorProvider::verifyOption(CtxJson option)
 {
        std::list<std::string> keys;
        option.getKeys(&keys);
        return keys.size() == 0;
 }
 
-int SensorProvider::__addClient(std::string pkgId, int retentionPeriod, Json option)
+int SensorProvider::__addClient(std::string pkgId, int retentionPeriod, CtxJson option)
 {
-       Json tmp;
+       CtxJson tmp;
        int ret;
 
        /* Validate the retention period */
@@ -197,7 +197,7 @@ int SensorProvider::__addClient(std::string pkgId, int retentionPeriod, Json opt
 
 int SensorProvider::__removeClient(std::string pkgId)
 {
-       std::vector<Json> options;
+       std::vector<CtxJson> options;
        int ret;
 
        /* Remove the app's request first */
index 245ec31..0e17775 100644 (file)
@@ -35,8 +35,8 @@ namespace ctx {
 
                const char* getSubject();
 
-               int readRecords(Json option, std::string* projection, std::vector<std::shared_ptr<Tuple>>* tuples);
-               int startRecording(const std::string& pkgId, Json option);
+               int readRecords(CtxJson option, std::string* projection, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int startRecording(const std::string& pkgId, CtxJson option);
                int stopRecording(const std::string& pkgId);
 
                virtual bool isSupported();
@@ -55,10 +55,10 @@ namespace ctx {
 
                virtual SensorLogger* getLogger() = 0;
                virtual Querier* getQuerier() = 0;
-               virtual bool verifyOption(Json option);
+               virtual bool verifyOption(CtxJson option);
 
        private:
-               int __addClient(std::string pkgId, int retentionPeriod, Json option);
+               int __addClient(std::string pkgId, int retentionPeriod, CtxJson option);
                int __removeClient(std::string pkgId);
 
                std::string __subject;
index c13b63f..55dadf2 100644 (file)
@@ -49,7 +49,7 @@ Querier* HeartRateProvider::getQuerier()
        return &__querier;
 }
 
-bool HeartRateProvider::verifyOption(Json option)
+bool HeartRateProvider::verifyOption(CtxJson option)
 {
        std::list<std::string> keys;
        option.getKeys(&keys);
index 03d1fb6..05b1e60 100644 (file)
@@ -34,7 +34,7 @@ namespace ctx {
        protected:
                SensorLogger* getLogger();
                Querier* getQuerier();
-               bool verifyOption(Json option);
+               bool verifyOption(CtxJson option);
 
        private:
                HeartRateLogger __logger;
index c9bdc6e..427fcf1 100644 (file)
@@ -58,7 +58,7 @@ HeartRateLogger::~HeartRateLogger()
 
 bool HeartRateLogger::start()
 {
-       std::vector<Json> options;
+       std::vector<CtxJson> options;
        RecorderClientInfo clientInfo;
        float interval = MAX_MEASURING_INTERVAL;