From ab9161b43f21fc4a15b30f9add5a5dcd6468df5d Mon Sep 17 00:00:00 2001 From: Yannick Marchetaux Date: Thu, 27 Jul 2023 16:37:40 +0200 Subject: [PATCH] The methods for converting JSON to datapoint are modified in "static". Signed-off-by: Yannick Marchetaux --- C/common/datapoint.cpp | 4 ++-- C/common/include/datapoint.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/C/common/datapoint.cpp b/C/common/datapoint.cpp index 751337d37f..95e566a07f 100644 --- a/C/common/datapoint.cpp +++ b/C/common/datapoint.cpp @@ -369,7 +369,7 @@ std::vector *Datapoint::parseJson(const std::string& json) { if (!document.IsObject()) { return nullptr; } - return recursiveJson(document); + return Datapoint::recursiveJson(document); } /** @@ -384,7 +384,7 @@ std::vector *Datapoint::recursiveJson(const rapidjson::Value& docume for (rapidjson::Value::ConstMemberIterator itr = document.MemberBegin(); itr != document.MemberEnd(); ++itr) { if (itr->value.IsObject()) { - std::vector * vec = recursiveJson(itr->value); + std::vector * vec = Datapoint::recursiveJson(itr->value); DatapointValue d(vec, true); p->push_back(new Datapoint(itr->name.GetString(), d)); } diff --git a/C/common/include/datapoint.h b/C/common/include/datapoint.h index a81183b4fb..c2b6ebaed1 100644 --- a/C/common/include/datapoint.h +++ b/C/common/include/datapoint.h @@ -367,8 +367,8 @@ class Datapoint { * Parse a json string and generates * a corresponding datapoint vector */ - std::vector* parseJson(const std::string& json); - std::vector* recursiveJson(const rapidjson::Value& document); + static std::vector* parseJson(const std::string& json); + static std::vector* recursiveJson(const rapidjson::Value& document); private: std::string m_name;