Call c++ functions from a shell with any arguments of any types parsed automatically
Declare a variable or define a function and register it in shpp with a simple command. Your function will be available to be called by a shell that parses the arguments automatically to the types of the arguments of your function.
git clone --recursive https://github.com/GrossoMoreira/shpp
cd shpp
make
bin/example
- list available functions, including their return type and parameter types
- call functions with any number of arguments of any primitive types or stl-like non-associative containers
- read and write variables (const/read-only variables supported)
- when a function is called, output its return value (of any supported type)
- interactive and non interactive mode
- auto-complete
- command history
- reverse search
- sourcing commands from files
#include "shpp/shpp.h"
shpp::service svc; // create a service
svc.provide_command("function_name", function_ptr);
svc.provide_value("variable_name", variable_ref);
shpp::shell sh(svc); // create a shell for this service
sh.start(); // start shell
- primitive types
- stl-like non-associative containers (std::vector, std::list...) that implement the push_back() method, parsed/serialized as JSON objects
- containers of containers
Sample std::vector<std::list<int>> :
[[0,2,4],[1,3,5],[]]
..can be used as a function parameter or return type.
- GNU readline
- support arguments of user-defined types
- support asynchronous execution of commands
- call functions remotely