mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-29 04:17:59 +01:00
Remove depreciated FileStream
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user