We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
struct ConnectionProp{ int connectionId; std::string connectionName; double timeout; XTOSTRUCT(M(connectionId,timeout),O(connectionName)); };
ConnectionProp x; x2struct::X::loadjson(decodedstr, x, false);
In ConnectionProp object, connectionName property is getting a value of "".
Json is :"{"connectionId":3,"connectionName":"JAY","timeout":3.55566}
The text was updated successfully, but these errors were encountered:
I try this code:
#include <iostream> #include "x2struct/x2struct.hpp" using namespace std; struct ConnectionProp{ int connectionId; std::string connectionName; double timeout; XTOSTRUCT(M(connectionId,timeout),O(connectionName)); }; int main(int argc, char*argv[]) { ConnectionProp x; string jstr="{\"connectionId\":3,\"connectionName\":\"JAY\",\"timeout\":3.55566}"; x2struct::X::loadjson(jstr, x, false); cout<<x.connectionId<<endl; cout<<x.connectionName<<endl; cout<<x.timeout<<endl; return 0; }
output is :
3 JAY 3.55566
Sorry, something went wrong.
No branches or pull requests
struct ConnectionProp{
int connectionId;
std::string connectionName;
double timeout;
XTOSTRUCT(M(connectionId,timeout),O(connectionName));
};
ConnectionProp x;
x2struct::X::loadjson(decodedstr, x, false);
In ConnectionProp object, connectionName property is getting a value of "".
Json is :"{"connectionId":3,"connectionName":"JAY","timeout":3.55566}
The text was updated successfully, but these errors were encountered: