diff options
author | miloyip@gmail.com <miloyip@gmail.com@c5894555-1306-4e8d-425f-1f6f381ee07c> | 2011-11-22 09:10:46 +0400 |
---|---|---|
committer | miloyip@gmail.com <miloyip@gmail.com@c5894555-1306-4e8d-425f-1f6f381ee07c> | 2011-11-22 09:10:46 +0400 |
commit | 08d25ad177ab8009c66243ea0452697e8528d814 (patch) | |
tree | 354fb9d320a379178227833481764f97b989a629 /include/rapidjson/prettywriter.h | |
parent | 99de5312e6e8c5ff10a4db5697f9987de2229670 (diff) |
Added Flush() to concept stream. Add this new member function to all streams.
Writer and PrettyWriter automatically calls Flush() at the end of JSON text.
git-svn-id: https://rapidjson.googlecode.com/svn/trunk@27 c5894555-1306-4e8d-425f-1f6f381ee07c
Diffstat (limited to 'include/rapidjson/prettywriter.h')
-rw-r--r-- | include/rapidjson/prettywriter.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/rapidjson/prettywriter.h b/include/rapidjson/prettywriter.h index 6f282933..403daa52 100644 --- a/include/rapidjson/prettywriter.h +++ b/include/rapidjson/prettywriter.h @@ -71,6 +71,8 @@ public: WriteIndent();
}
Base::WriteEndObject();
+ if (Base::level_stack_.Empty()) // end of json text
+ Base::stream_.Flush();
return *this;
}
@@ -91,6 +93,8 @@ public: WriteIndent();
}
Base::WriteEndArray();
+ if (Base::level_stack_.Empty()) // end of json text
+ Base::stream_.Flush();
return *this;
}
|