diff options
author | Sewef <elagroum@gmail.com> | 2019-10-16 19:35:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-16 19:35:33 +0200 |
commit | 19fb0fb2205cf719daeb705098c685e2062d3c83 (patch) | |
tree | f869cb7ec87f204f236a0d173e54b047adfd97eb /tools/jsonproc/jsonproc.cpp | |
parent | ed1f5a74556d3a856f868e1b67edd2453122cff6 (diff) | |
parent | 60a592a2c32d07d47c892204659a8576017584d1 (diff) |
Merge branch 'master' into patch-2
Diffstat (limited to 'tools/jsonproc/jsonproc.cpp')
-rwxr-xr-x | tools/jsonproc/jsonproc.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/tools/jsonproc/jsonproc.cpp b/tools/jsonproc/jsonproc.cpp index 15eae9dcb..2ba5fd082 100755 --- a/tools/jsonproc/jsonproc.cpp +++ b/tools/jsonproc/jsonproc.cpp @@ -65,21 +65,6 @@ int main(int argc, char *argv[]) return get_custom_var(key); }); - env.add_callback("trackVar", 2, [](Arguments& args) { - static int counter = 0; - - int addValue = args.at(0)->get<int>(); - int checkValue = args.at(1)->get<int>(); - - bool over = false; - - counter = (counter + addValue) % (checkValue + 1); - - if (counter <= addValue) over = true; - - return over; - }); - env.add_callback("concat", 2, [](Arguments& args) { string first = args.at(0)->get<string>(); string second = args.at(1)->get<string>(); @@ -106,6 +91,11 @@ int main(int argc, char *argv[]) return rawValue.substr(0, i); }); + // single argument is a json object + env.add_callback("isEmpty", 1, [](Arguments& args) { + return args.at(0)->empty(); + }); + try { env.write_with_json_file(templateFilepath, jsonfilepath, outputFilepath); |