Introduced new library for pglab code which I want to unit test.
Not everything can go into core because that would result in circular dependencies between core and pgsql.
This commit is contained in:
parent
b8505ce451
commit
ad9ed1b698
10 changed files with 98 additions and 21 deletions
|
|
@ -1,37 +0,0 @@
|
|||
#include "ParamListJson.h"
|
||||
|
||||
Json::Value ParamToJson(const Param ¶m)
|
||||
{
|
||||
Json::Value v;
|
||||
v["type"] = param.type.toUtf8().data();
|
||||
v["value"] = param.value.toUtf8().data();
|
||||
return v;
|
||||
}
|
||||
|
||||
Param ParamFromJson(const Json::Value &json)
|
||||
{
|
||||
Param p;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
Json::Value ParamListToJson(const t_ParamList &list)
|
||||
{
|
||||
Json::Value root;
|
||||
for (const auto ¶m : list) {
|
||||
root.append(ParamToJson(param));
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
t_ParamList ParamListFromJson(const Json::Value &json)
|
||||
{
|
||||
t_ParamList result;
|
||||
if (json.isArray()) {
|
||||
result.reserve(json.size());
|
||||
for (auto &e : json) {
|
||||
result.push_back(ParamFromJson(e));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue