Clarify confusion regarding code example as seen here: http://stackoverflow.com/questions/4273056/jsoncpp-not-reading-files-correctly (i.e. I had the same problem).

Daniel Polanco 2015-02-04 21:10:46 -07:00
parent 4ed1ed63e4
commit 0a11c2cd7b

10
Home.md

@ -28,6 +28,16 @@ Features
Code example
------------
You must open the file in an `std::ifstream` before you can use it:
```cpp
#include <fstream>
std::ifstream config_doc("config_doc.json", std::ifstream::binary);
```
Once that is done you can then use jsoncpp to parse the data:
```cpp
Json::Value root; // will contains the root value after parsing
Json::Reader reader;