+ fixed documentation bugs
This commit is contained in:
parent
2335d3f3d5
commit
6995d33fb1
@ -86,8 +86,10 @@ You can also use streams:
|
|||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// create object from stream
|
// create object from stream
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << "{ \"pi\": 3.141, \"happy\": true }";
|
||||||
JSON j;
|
JSON j;
|
||||||
j << "{ \"pi\": 3.141, \"happy\": true }";
|
j << ss;
|
||||||
|
|
||||||
// write string representation to stream
|
// write string representation to stream
|
||||||
std::cout << j;
|
std::cout << j;
|
||||||
@ -150,8 +152,8 @@ The type of the JSON object is determined automatically by the expression to sto
|
|||||||
```cpp
|
```cpp
|
||||||
/// strings
|
/// strings
|
||||||
std::string s1 = "Hello, world!";
|
std::string s1 = "Hello, world!";
|
||||||
JSON js = s;
|
JSON js = s1;
|
||||||
std::string s2 = j;
|
std::string s2 = js;
|
||||||
|
|
||||||
// Booleans
|
// Booleans
|
||||||
bool b1 = true;
|
bool b1 = true;
|
||||||
|
@ -1791,7 +1791,8 @@ JSON::Parser::Parser(std::istream& _is)
|
|||||||
// from http://www.manticmoo.com/articles/jeff/programming/c++/making-io-streams-efficient-in-c++.php
|
// from http://www.manticmoo.com/articles/jeff/programming/c++/making-io-streams-efficient-in-c++.php
|
||||||
// Don't sync C++ and C I/O
|
// Don't sync C++ and C I/O
|
||||||
std::ios_base::sync_with_stdio(false);
|
std::ios_base::sync_with_stdio(false);
|
||||||
while(_is) {
|
while (_is)
|
||||||
|
{
|
||||||
std::getline(_is, input_line);
|
std::getline(_is, input_line);
|
||||||
string_input += input_line;
|
string_input += input_line;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user