Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
6995d33f
Commit
6995d33f
authored
Dec 30, 2014
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ fixed documentation bugs
parent
2335d3f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
README.md
README.md
+5
-3
JSON.cc
src/JSON.cc
+4
-3
No files found.
README.md
View file @
6995d33f
...
...
@@ -86,8 +86,10 @@ You can also use streams:
```
cpp
// create object from stream
std
::
stringstream
ss
;
ss
<<
"{
\"
pi
\"
: 3.141,
\"
happy
\"
: true }"
;
JSON
j
;
j
<<
"{
\"
pi
\"
: 3.141,
\"
happy
\"
: true }"
;
j
<<
ss
;
// write string representation to stream
std
::
cout
<<
j
;
...
...
@@ -150,8 +152,8 @@ The type of the JSON object is determined automatically by the expression to sto
```
cpp
/// strings
std
::
string
s1
=
"Hello, world!"
;
JSON
js
=
s
;
std
::
string
s2
=
j
;
JSON
js
=
s
1
;
std
::
string
s2
=
j
s
;
// Booleans
bool
b1
=
true
;
...
...
src/JSON.cc
View file @
6995d33f
...
...
@@ -1791,9 +1791,10 @@ JSON::Parser::Parser(std::istream& _is)
// from http://www.manticmoo.com/articles/jeff/programming/c++/making-io-streams-efficient-in-c++.php
// Don't sync C++ and C I/O
std
::
ios_base
::
sync_with_stdio
(
false
);
while
(
_is
)
{
std
::
getline
(
_is
,
input_line
);
string_input
+=
input_line
;
while
(
_is
)
{
std
::
getline
(
_is
,
input_line
);
string_input
+=
input_line
;
}
_length
=
string_input
.
size
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment