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
I'm passing around some picojson objects/values and wanted to assert on type. As part of my message, I wanted to dump the type of value I got:
M_ASSERT_MSG( input.is<picojson::object>(), "Expecting a JSON object, got " << to_type_string(input) );
As a workaround, I've written this in my code to do it:
std::string to_type_string(const picojson::value & v) { if(v.is<bool>()) return "bool"; else if(v.is<picojson::null>()) return "null"; else if(v.is<int64_t>()) return "int"; else if(v.is<float64>()) return "float"; else if(v.is<std::string>()) return "string"; else if(v.is<picojson::array>()) return "array"; else if(v.is<picojson::object>()) return "object"; else if(v.is<picojson::object>()) return "object"; return "unknown"; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm passing around some picojson objects/values and wanted to assert on type. As part of my message, I wanted to dump the type of value I got:
As a workaround, I've written this in my code to do it:
The text was updated successfully, but these errors were encountered: