Commit df3cb2db authored by Alexander Lapshin's avatar Alexander Lapshin

refactor

parent 42c2294b
...@@ -554,23 +554,6 @@ template <typename T> void PutValue(jsonalloc& alc, jsonval& ss, const std::stri ...@@ -554,23 +554,6 @@ template <typename T> void PutValue(jsonalloc& alc, jsonval& ss, const std::stri
ss.AddMember(jname, obj, alc); ss.AddMember(jname, obj, alc);
} }
template <typename T> void PutValue(jsonalloc& alc, jsonval& ss, const std::vector<T>& vec)
{
for (const auto& el : vec) {
PutValue(alc, ss, el);
}
}
template <typename T> void PutValue(jsonalloc& alc, jsonval& ss, const std::vector<T>& vec, bool (*f)(rapidjson::Document::AllocatorType&, jsonval&, const T&))
{
for (auto it = vec.begin(); it != vec.end(); ++it) {
jsonval child(rapidjson::kObjectType);
if (f(alc, child, *it)) {
ss.PushBack(child, alc);
}
}
}
template <typename T> void PutValue(jsonalloc& alc, jsonval& ss, const std::string& conName, const std::vector<T>& vec, bool (*f)(rapidjson::Document::AllocatorType&, jsonval&, const T&)) template <typename T> void PutValue(jsonalloc& alc, jsonval& ss, const std::string& conName, const std::vector<T>& vec, bool (*f)(rapidjson::Document::AllocatorType&, jsonval&, const T&))
{ {
jsonval jsvec(rapidjson::kArrayType); jsonval jsvec(rapidjson::kArrayType);
...@@ -734,17 +717,6 @@ static void PutValue(jsonalloc& alc, jsonval& ss, const std::string& conName, co ...@@ -734,17 +717,6 @@ static void PutValue(jsonalloc& alc, jsonval& ss, const std::string& conName, co
ss.AddMember(jname, jvalue, alc); ss.AddMember(jname, jvalue, alc);
} }
static void PutValue(jsonalloc& alc, jsonval& ss, const double value)
{
ss.PushBack(value, alc);
}
static void PutValue(jsonalloc& alc, jsonval& ss, const std::string& value)
{
jsonval jvalue(value, alc);
ss.PushBack(jvalue, alc);
}
static void flushjson(const jsondoc& outroot, const std::string& outputfile, const bool pretty = true) static void flushjson(const jsondoc& outroot, const std::string& outputfile, const bool pretty = true)
{ {
if (!outputfile.length()) { if (!outputfile.length()) {
...@@ -1012,7 +984,7 @@ static bool loadjson(const std::map<std::string, std::string>& parent, const std ...@@ -1012,7 +984,7 @@ static bool loadjson(const std::map<std::string, std::string>& parent, const std
} }
value = itr->second; value = itr->second;
return true; return true;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
std::string exec(const char* cmd) std::string exec(const char* cmd)
{ {
#ifndef WIN32 #ifndef MSVC
FILE* pipe = popen(cmd, "r"); FILE* pipe = popen(cmd, "r");
#else #else
FILE* pipe = _popen(cmd, "r"); FILE* pipe = _popen(cmd, "r");
...@@ -17,7 +17,7 @@ std::string exec(const char* cmd) ...@@ -17,7 +17,7 @@ std::string exec(const char* cmd)
result += buffer; result += buffer;
} }
#ifndef WIN32 #ifndef MSVC
pclose(pipe); pclose(pipe);
#else #else
_pclose(pipe); _pclose(pipe);
......
#pragma once #pragma once
#ifndef MSVC
#pragma GCC diagnostic ignored "-Wnon-template-friend"
#endif
template <typename T> class svalue template <typename T> class svalue
{ {
public: public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment