1 // Tencent is pleased to support the open source community by making RapidJSON available.
3 // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
5 // Licensed under the MIT License (the "License"); you may not use this file except
6 // in compliance with the License. You may obtain a copy of the License at
8 // http://opensource.org/licenses/MIT
10 // Unless required by applicable law or agreed to in writing, software distributed
11 // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 // specific language governing permissions and limitations under the License.
17 // Using forward declared types here.
19 #include "rapidjson/fwd.h"
23 RAPIDJSON_DIAG_OFF(effc++)
26 using namespace rapidjson;
34 UTF16<wchar_t>* utf16;
35 UTF16BE<wchar_t>* utf16be;
36 UTF16LE<wchar_t>* utf16le;
37 UTF32<unsigned>* utf32;
38 UTF32BE<unsigned>* utf32be;
39 UTF32LE<unsigned>* utf32le;
41 AutoUTF<unsigned>* autoutf;
42 Transcoder<UTF8<char>, UTF8<char> >* transcoder;
45 CrtAllocator* crtallocator;
46 MemoryPoolAllocator<CrtAllocator>* memorypoolallocator;
49 StringStream* stringstream;
50 InsituStringStream* insitustringstream;
53 StringBuffer* stringbuffer;
55 // // filereadstream.h
56 // FileReadStream* filereadstream;
58 // // filewritestream.h
59 // FileWriteStream* filewritestream;
62 MemoryBuffer* memorybuffer;
65 MemoryStream* memorystream;
68 BaseReaderHandler<UTF8<char>, void>* basereaderhandler;
72 Writer<StringBuffer, UTF8<char>, UTF8<char>, CrtAllocator, 0>* writer;
75 PrettyWriter<StringBuffer, UTF8<char>, UTF8<char>, CrtAllocator, 0>* prettywriter;
85 SchemaDocument* schemadocument;
86 SchemaValidator* schemavalidator;
91 // Using type definitions here.
93 #include "rapidjson/stringbuffer.h"
94 #include "rapidjson/filereadstream.h"
95 #include "rapidjson/filewritestream.h"
96 #include "rapidjson/memorybuffer.h"
97 #include "rapidjson/memorystream.h"
98 #include "rapidjson/document.h" // -> reader.h
99 #include "rapidjson/writer.h"
100 #include "rapidjson/prettywriter.h"
101 #include "rapidjson/schema.h" // -> pointer.h
105 utf8(RAPIDJSON_NEW(UTF8<>)),
106 utf16(RAPIDJSON_NEW(UTF16<>)),
107 utf16be(RAPIDJSON_NEW(UTF16BE<>)),
108 utf16le(RAPIDJSON_NEW(UTF16LE<>)),
109 utf32(RAPIDJSON_NEW(UTF32<>)),
110 utf32be(RAPIDJSON_NEW(UTF32BE<>)),
111 utf32le(RAPIDJSON_NEW(UTF32LE<>)),
112 ascii(RAPIDJSON_NEW(ASCII<>)),
113 autoutf(RAPIDJSON_NEW(AutoUTF<unsigned>)),
114 transcoder(RAPIDJSON_NEW((Transcoder<UTF8<>, UTF8<> >))),
117 crtallocator(RAPIDJSON_NEW(CrtAllocator)),
118 memorypoolallocator(RAPIDJSON_NEW(MemoryPoolAllocator<>)),
121 stringstream(RAPIDJSON_NEW(StringStream(0))),
122 insitustringstream(RAPIDJSON_NEW(InsituStringStream(0))),
125 stringbuffer(RAPIDJSON_NEW(StringBuffer)),
127 // // filereadstream.h
128 // filereadstream(RAPIDJSON_NEW(FileReadStream(stdout, buffer, sizeof(buffer)))),
130 // // filewritestream.h
131 // filewritestream(RAPIDJSON_NEW(FileWriteStream(stdout, buffer, sizeof(buffer)))),
134 memorybuffer(RAPIDJSON_NEW(MemoryBuffer)),
137 memorystream(RAPIDJSON_NEW(MemoryStream(0, 0))),
140 basereaderhandler(RAPIDJSON_NEW((BaseReaderHandler<UTF8<>, void>))),
141 reader(RAPIDJSON_NEW(Reader)),
144 writer(RAPIDJSON_NEW((Writer<StringBuffer>))),
147 prettywriter(RAPIDJSON_NEW((PrettyWriter<StringBuffer>))),
150 value(RAPIDJSON_NEW(Value)),
151 document(RAPIDJSON_NEW(Document)),
154 pointer(RAPIDJSON_NEW(Pointer)),
157 schemadocument(RAPIDJSON_NEW(SchemaDocument(*document))),
158 schemavalidator(RAPIDJSON_NEW(SchemaValidator(*schemadocument)))
165 RAPIDJSON_DELETE(utf8);
166 RAPIDJSON_DELETE(utf16);
167 RAPIDJSON_DELETE(utf16be);
168 RAPIDJSON_DELETE(utf16le);
169 RAPIDJSON_DELETE(utf32);
170 RAPIDJSON_DELETE(utf32be);
171 RAPIDJSON_DELETE(utf32le);
172 RAPIDJSON_DELETE(ascii);
173 RAPIDJSON_DELETE(autoutf);
174 RAPIDJSON_DELETE(transcoder);
177 RAPIDJSON_DELETE(crtallocator);
178 RAPIDJSON_DELETE(memorypoolallocator);
181 RAPIDJSON_DELETE(stringstream);
182 RAPIDJSON_DELETE(insitustringstream);
185 RAPIDJSON_DELETE(stringbuffer);
187 // // filereadstream.h
188 // RAPIDJSON_DELETE(filereadstream);
190 // // filewritestream.h
191 // RAPIDJSON_DELETE(filewritestream);
194 RAPIDJSON_DELETE(memorybuffer);
197 RAPIDJSON_DELETE(memorystream);
200 RAPIDJSON_DELETE(basereaderhandler);
201 RAPIDJSON_DELETE(reader);
204 RAPIDJSON_DELETE(writer);
207 RAPIDJSON_DELETE(prettywriter);
210 RAPIDJSON_DELETE(value);
211 RAPIDJSON_DELETE(document);
214 RAPIDJSON_DELETE(pointer);
217 RAPIDJSON_DELETE(schemadocument);
218 RAPIDJSON_DELETE(schemavalidator);