subh83 / rsjp-cpp Goto Github PK
View Code? Open in Web Editor NEWA Ridiculously Simple JSON parser for C++ (RSJp-cpp)
A Ridiculously Simple JSON parser for C++ (RSJp-cpp)
Hi,
I like this lib a lot, my new favourite json parser!
If I had to make any complaint it would be that it is not very 'const correct'. It doesn't make use of any const methods, which means you can't pass const RSJresource objects around easily/at all.
But that's cool, I can live with that and it's not a huge problem for what I do, so I think it's now my default json lib of choice!
I definitely appreciate how lightweight it is so perhaps staying away from const correctness is worth it in this case?
Bye,
Mark
How can I use double quotes " around object names and values?
I can not use single quotes ' at all.
_s = "{"type":"message","data":{"id":4,"data":"sumanth"}}"
RSJresource my_json(s);
std::cout << my_json["data"]["data"].asstd::string() << std::endl;_
The above lines of code is giving the following output:
sumanth"}}
It is not parsing the json properly. The expected output is sumanth
Is there another way to do the same?
jsonReader["a"]["b"].size(); returns value 1 when the array "a" does not exist. Have not tries other cases like "b" is none existent.
Compilation goes wrong if not fstream is in the include path (gcc c++14 Linux)
When a path similar to "C://test.txt" appears in my json string, use your class library for json parsing, and then take out the string, this path will appear in the variable "c:/test" .txt", so that the program will be treated as "/t" for parsing
As the header is written now, it can only be included once in a project or it will produce several conflicts during linking. (gcc c++14 Linux)
I tried changing the access operator
RSJresource& RSJresource::operator[] (std::string key)
to
RSJresource& RSJresource::operator[] (const std::string& key)
I believe that some string creation and copying is now left out? Nothing seems to have broken, at least not on my tests.
Cheers
[email protected]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.