parser returns an object
This commit is contained in:
parent
16c30cff8b
commit
18364aac85
2 changed files with 19 additions and 39 deletions
|
|
@ -194,13 +194,13 @@ class JSON
|
|||
/// read from stream
|
||||
friend std::istream& operator>>(std::istream& i, JSON& j)
|
||||
{
|
||||
Parser(i).parse(j);
|
||||
j = Parser(i).parse();
|
||||
return i;
|
||||
}
|
||||
/// read from stream
|
||||
friend std::istream& operator<<(JSON& j, std::istream& i)
|
||||
{
|
||||
Parser(i).parse(j);
|
||||
j = Parser(i).parse();
|
||||
return i;
|
||||
}
|
||||
|
||||
|
|
@ -406,8 +406,8 @@ class JSON
|
|||
// no copy assignment
|
||||
Parser& operator=(Parser) = delete;
|
||||
|
||||
/// parse into a given JSON object
|
||||
void parse(JSON&);
|
||||
/// parse and return a JSON object
|
||||
JSON parse();
|
||||
|
||||
private:
|
||||
/// read the next character, stripping whitespace
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue