diff options
author | garak <garakmon@gmail.com> | 2019-07-01 23:47:45 -0400 |
---|---|---|
committer | garak <garakmon@gmail.com> | 2019-07-01 23:47:45 -0400 |
commit | 4594c955b4f2145891d6728b84e33489ee352a3a (patch) | |
tree | 9df5c5121e76950b723f40ccc9a8684dd7b308f3 /tools | |
parent | adb0a444577b59eb02788c782a3d04bc285be0ba (diff) |
create defines to support encounter index ratios
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/jsonproc/jsonproc.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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 <map> #include <string> -using std::string; +using std::string; using std::to_string; #include <inja.hpp> 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>(); + string value = to_string(args.at(1)->get<int>()); + set_custom_var(key, value); + return ""; + }); + env.add_callback("getVar", 1, [=](Arguments& args) { string key = args.at(0)->get<string>(); return get_custom_var(key); |