-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
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
How to get the length of a JSON string without retrieving its std::string? #897
Comments
Hi. How are you getting your Not sure that this helps, but if you do something like: |
Thanks @ijijn. Not valid for my use case, but good to know. |
string |
Great. Perhaps this should be documented? |
Thanks @rexdf, my absolute fault. |
For reference: json j_string = "foo bar";
size_t len = j_string.get_ref<json::string_t&>().size(); |
Thanks. Would that also work if |
No. You would get an exception:
|
Basically that. I know that a
json
object holds a string and I need to know its length, hopefully without having to convert it into a C++std::string
.Is it possible?
The text was updated successfully, but these errors were encountered: