I've got an implemented function MyFunc(int, double, string)
in my project. How can I call this function with necessary parameters having its string representation, for example
std::string str = "MyFunc(2, 3.12, \"Lemon Juice\")";
And what about the standard functions, for example, how can I call time()
having std::string "time()"
?
Ok, here's more detailed task.
I've got a map <string, Data>
Data
is a class-wrapper with many childs. When I call Data.GetValue()
method, it returns a std::string
, depending of child class inner data. One of Data
childs must return the string representation of int
, another - the string representation of double
, and the last one - the string representation of current date and time. Here's the problem - I don't know how to call the standard function ctime()
for getting information from one of Data
childs.