mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-28 03:20:15 +01:00
Add encoding validation option for Writer/PrettyWriter
This commit is contained in:
@@ -69,7 +69,10 @@ struct Foo {
|
||||
Reader* reader;
|
||||
|
||||
// writer.h
|
||||
Writer<StringBuffer, UTF8<char>, UTF8<char>, CrtAllocator>* writer;
|
||||
Writer<StringBuffer, UTF8<char>, UTF8<char>, CrtAllocator, 0>* writer;
|
||||
|
||||
// prettywriter.h
|
||||
PrettyWriter<StringBuffer, UTF8<char>, UTF8<char>, CrtAllocator, 0>* prettywriter;
|
||||
|
||||
// document.h
|
||||
Value* value;
|
||||
@@ -94,6 +97,7 @@ struct Foo {
|
||||
#include "rapidjson/memorystream.h"
|
||||
#include "rapidjson/document.h" // -> reader.h
|
||||
#include "rapidjson/writer.h"
|
||||
#include "rapidjson/prettywriter.h"
|
||||
#include "rapidjson/schema.h" // -> pointer.h
|
||||
|
||||
Foo::Foo() :
|
||||
@@ -139,6 +143,9 @@ Foo::Foo() :
|
||||
// writer.h
|
||||
writer(RAPIDJSON_NEW((Writer<StringBuffer>))),
|
||||
|
||||
// prettywriter.h
|
||||
prettywriter(RAPIDJSON_NEW((PrettyWriter<StringBuffer>))),
|
||||
|
||||
// document.h
|
||||
value(RAPIDJSON_NEW(Value)),
|
||||
document(RAPIDJSON_NEW(Document)),
|
||||
@@ -196,6 +203,9 @@ Foo::~Foo() {
|
||||
// writer.h
|
||||
RAPIDJSON_DELETE(writer);
|
||||
|
||||
// prettywriter.h
|
||||
RAPIDJSON_DELETE(prettywriter);
|
||||
|
||||
// document.h
|
||||
RAPIDJSON_DELETE(value);
|
||||
RAPIDJSON_DELETE(document);
|
||||
|
||||
Reference in New Issue
Block a user