mirror of
https://github.com/Tencent/rapidjson
synced 2026-08-26 06:23:05 -04:00
Remove depreciated FileStream
This commit is contained in:
parent
2d07198863
commit
67be9ed2cb
5 changed files with 7 additions and 93 deletions
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "rapidjson/document.h" // rapidjson's DOM-style API
|
||||
#include "rapidjson/prettywriter.h" // for stringify JSON
|
||||
#include "rapidjson/filestream.h" // wrapper of C stream for prettywriter as output
|
||||
#include <cstdio>
|
||||
|
||||
using namespace rapidjson;
|
||||
|
|
@ -143,9 +142,10 @@ int main(int, char*[]) {
|
|||
// 4. Stringify JSON
|
||||
|
||||
printf("\nModified JSON with reformatting:\n");
|
||||
FileStream f(stdout);
|
||||
PrettyWriter<FileStream> writer(f);
|
||||
StringBuffer sb;
|
||||
PrettyWriter<StringBuffer> writer(sb);
|
||||
document.Accept(writer); // Accept() traverses the DOM and generates Handler events.
|
||||
puts(sb.GetString());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue