diff options
author | GriffinR <griffin.richards@comcast.net> | 2019-10-14 19:25:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-14 19:25:10 -0400 |
commit | 928cdf2531e74df2432ec8d602c4c2d2fee14eb1 (patch) | |
tree | 9a520de5b4790f14175a28eb70665a4f60ade486 /tools/jsonproc/jsonproc.cpp | |
parent | 30ef49416391d036286661a8e1225b4ba03e3109 (diff) | |
parent | 26962b7725ffc5df719a0eea9442735b9dc04b5c (diff) |
Merge branch 'master' into doc-inc2
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); |