Remove depreciated FileStream

This commit is contained in:
miloyip
2015-04-14 11:08:47 +08:00
parent 2d07198863
commit 67be9ed2cb
5 changed files with 7 additions and 93 deletions

View File

@@ -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;
}