-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
not enough examples #592
Comments
Parsing is described in the README. The Please let me know if you need further assistance. |
No, the parse function expects proper JSON. But if you know the length of the non-JSON prefix, you can try something like std::string s = R"(11 ["new message",{"username":"Someone","message":"Hi"}])";
// provide an iterator range: skip the first three bytes
json j = json::parse(s.begin() + 3, s.end()); |
Please have a look at the README first. All is written there. |
Please just check the README. It's all there - from parsing to value manipulation to printing. |
In the example above, (Sorry, I used the wrong index.) |
You can voice your opinion all day long, but the point of a public repo. is so you (not the author) can go make the changes you want and if you feel so inclined you can submit a pull request to get the changes back into this repository. |
He attempted to help you multiple times.
What's the point? It is just leaving more "work" in the backlog of real issues. |
You were pointed to examples, several times. You were given ideas on how to deal with the string that is not proper JSON. At this point, if you need help, you need to show the code that's not working, and not just a snippet, but something that can be used to reproduce the problem. Also, this issue is closed, and people are still commenting on it. I fail to see the problem. |
@kenkit I closed the issue, because I got the feeling that you have little interest in learning about the library, but only in your concrete problem. This is OK. Giving your issue the title "not enough examples" is misleading, because the library has plenty of examples - just not for your concrete question. I gave you some example, and pointed you to further documentation, but you kept insisting that the documentation is improper. As this is not the case, I closed the issue. |
Also, you said "I'll unfortunately have to move to another, thanks all the same." indicating that you were done here. |
This is not a valid JSON string. |
Thanks for the clarification, that wasn't clear from your original request. |
Yeah, that much was obvious. What wasn't obvious was
|
See #592 (comment) (note: I edited the comment - I used a wrong index before) |
this is what a complete example looks like. Note the json string. |
This is so far the
greatest c++ json library, nice work.However we don't have enough examples, I can't figure how to extract data from this simple string, I tried using the
.at()
but without success, please help with a working example.["new message",{"username":"Someone","message":"Hi"}]
also lets assume we have another like this
11 ["new message",{"username":"Someone","message":"Hi"}]
how would I parse such a string ?
The text was updated successfully, but these errors were encountered: