Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
bba388b4
Commit
bba388b4
authored
Mar 16, 2017
by
Milo Yip
Committed by
GitHub
Mar 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #896 from StilesCrisis/writer-flush-api
Writer flush api
parents
465fab45
31c6c50a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
prettywriter.h
include/rapidjson/prettywriter.h
+2
-2
writer.h
include/rapidjson/writer.h
+9
-1
No files found.
include/rapidjson/prettywriter.h
View file @
bba388b4
...
...
@@ -150,7 +150,7 @@ public:
(
void
)
ret
;
RAPIDJSON_ASSERT
(
ret
==
true
);
if
(
Base
::
level_stack_
.
Empty
())
// end of json text
Base
::
os_
->
Flush
();
Base
::
Flush
();
return
true
;
}
...
...
@@ -174,7 +174,7 @@ public:
(
void
)
ret
;
RAPIDJSON_ASSERT
(
ret
==
true
);
if
(
Base
::
level_stack_
.
Empty
())
// end of json text
Base
::
os_
->
Flush
();
Base
::
Flush
();
return
true
;
}
...
...
include/rapidjson/writer.h
View file @
bba388b4
...
...
@@ -267,6 +267,14 @@ public:
return
EndValue
(
WriteRawValue
(
json
,
length
));
}
//! Flush the output stream.
/*!
Allows the user to flush the output stream immediately.
*/
void
Flush
()
{
os_
->
Flush
();
}
protected
:
//! Information for each nested level
struct
Level
{
...
...
@@ -473,7 +481,7 @@ protected:
// Flush the value if it is the top level one.
bool
EndValue
(
bool
ret
)
{
if
(
RAPIDJSON_UNLIKELY
(
level_stack_
.
Empty
()))
// end of json text
os_
->
Flush
();
Flush
();
return
ret
;
}
...
...
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