From 4594c955b4f2145891d6728b84e33489ee352a3a Mon Sep 17 00:00:00 2001 From: garak Date: Mon, 1 Jul 2019 23:47:45 -0400 Subject: create defines to support encounter index ratios --- tools/jsonproc/jsonproc.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tools/jsonproc') diff --git a/tools/jsonproc/jsonproc.cpp b/tools/jsonproc/jsonproc.cpp index c0d6e9434..15eae9dcb 100755 --- a/tools/jsonproc/jsonproc.cpp +++ b/tools/jsonproc/jsonproc.cpp @@ -5,7 +5,7 @@ #include #include -using std::string; +using std::string; using std::to_string; #include using namespace inja; @@ -53,6 +53,13 @@ int main(int argc, char *argv[]) return ""; }); + env.add_callback("setVarInt", 2, [=](Arguments& args) { + string key = args.at(0)->get(); + string value = to_string(args.at(1)->get()); + set_custom_var(key, value); + return ""; + }); + env.add_callback("getVar", 1, [=](Arguments& args) { string key = args.at(0)->get(); return get_custom_var(key); -- cgit v1.2.3