1 | /*
|
---|
2 | * Copyright 2003,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Log: XTemplateSerializer.hpp,v $
|
---|
19 | * Revision 1.4 2004/09/08 13:56:14 peiyongz
|
---|
20 | * Apache License Version 2.0
|
---|
21 | *
|
---|
22 | * Revision 1.3 2003/11/11 22:48:13 knoaman
|
---|
23 | * Serialization of XSAnnotation.
|
---|
24 | *
|
---|
25 | * Revision 1.2 2003/10/29 16:16:08 peiyongz
|
---|
26 | * GrammarPool' serialization/deserialization support
|
---|
27 | *
|
---|
28 | * Revision 1.1 2003/10/17 21:07:49 peiyongz
|
---|
29 | * To support Template object serialization/deserialization
|
---|
30 | *
|
---|
31 | * $Id: XTemplateSerializer.hpp,v 1.4 2004/09/08 13:56:14 peiyongz Exp $
|
---|
32 | *
|
---|
33 | */
|
---|
34 |
|
---|
35 | #if !defined(XTEMPLATE_SERIALIZER_HPP)
|
---|
36 | #define XTEMPLATE_SERIALIZER_HPP
|
---|
37 |
|
---|
38 | #include <xercesc/util/ValueVectorOf.hpp>
|
---|
39 | #include <xercesc/util/RefArrayVectorOf.hpp>
|
---|
40 | #include <xercesc/util/RefVectorOf.hpp>
|
---|
41 | #include <xercesc/util/RefHashTableOf.hpp>
|
---|
42 | #include <xercesc/util/RefHash2KeysTableOf.hpp>
|
---|
43 | #include <xercesc/util/RefHash3KeysIdPool.hpp>
|
---|
44 | #include <xercesc/util/NameIdPool.hpp>
|
---|
45 |
|
---|
46 | #include <xercesc/framework/XMLNotationDecl.hpp>
|
---|
47 | #include <xercesc/framework/XMLRefInfo.hpp>
|
---|
48 | #include <xercesc/util/XMLNumber.hpp>
|
---|
49 | #include <xercesc/validators/common/ContentSpecNode.hpp>
|
---|
50 | #include <xercesc/validators/DTD/DTDAttDef.hpp>
|
---|
51 | #include <xercesc/validators/DTD/DTDElementDecl.hpp>
|
---|
52 | #include <xercesc/validators/DTD/DTDEntityDecl.hpp>
|
---|
53 | #include <xercesc/validators/schema/SchemaAttDef.hpp>
|
---|
54 | #include <xercesc/validators/schema/SchemaElementDecl.hpp>
|
---|
55 | #include <xercesc/validators/schema/XercesGroupInfo.hpp>
|
---|
56 | #include <xercesc/validators/schema/XercesAttGroupInfo.hpp>
|
---|
57 | #include <xercesc/validators/schema/SchemaGrammar.hpp>
|
---|
58 | #include <xercesc/validators/schema/identity/IC_Field.hpp>
|
---|
59 | #include <xercesc/validators/schema/identity/IdentityConstraint.hpp>
|
---|
60 | #include <xercesc/validators/schema/identity/XercesXPath.hpp>
|
---|
61 | #include <xercesc/framework/psvi/XSAnnotation.hpp>
|
---|
62 |
|
---|
63 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
64 |
|
---|
65 | class XMLUTIL_EXPORT XTemplateSerializer
|
---|
66 | {
|
---|
67 | public:
|
---|
68 |
|
---|
69 | /**********************************************************
|
---|
70 | *
|
---|
71 | * ValueVectorOf
|
---|
72 | *
|
---|
73 | * SchemaElementDecl*
|
---|
74 | * unsigned int
|
---|
75 | *
|
---|
76 | ***********************************************************/
|
---|
77 | static void storeObject(ValueVectorOf<SchemaElementDecl*>* const tempObjToWrite
|
---|
78 | , XSerializeEngine& serEng);
|
---|
79 |
|
---|
80 | static void loadObject(ValueVectorOf<SchemaElementDecl*>** tempObjToRead
|
---|
81 | , int initSize
|
---|
82 | , bool toCallDestructor
|
---|
83 | , XSerializeEngine& serEng);
|
---|
84 |
|
---|
85 | static void storeObject(ValueVectorOf<unsigned int>* const tempObjToWrite
|
---|
86 | , XSerializeEngine& serEng);
|
---|
87 |
|
---|
88 | static void loadObject(ValueVectorOf<unsigned int>** tempObjToRead
|
---|
89 | , int initSize
|
---|
90 | , bool toCallDestructor
|
---|
91 | , XSerializeEngine& serEng);
|
---|
92 |
|
---|
93 | /**********************************************************
|
---|
94 | *
|
---|
95 | * RefArrayVectorOf
|
---|
96 | *
|
---|
97 | * XMLCh
|
---|
98 | *
|
---|
99 | ***********************************************************/
|
---|
100 | static void storeObject(RefArrayVectorOf<XMLCh>* const tempObjToWrite
|
---|
101 | , XSerializeEngine& serEng);
|
---|
102 |
|
---|
103 | static void loadObject(RefArrayVectorOf<XMLCh>** tempObjToRead
|
---|
104 | , int initSize
|
---|
105 | , bool toAdopt
|
---|
106 | , XSerializeEngine& serEng);
|
---|
107 |
|
---|
108 | /**********************************************************
|
---|
109 | *
|
---|
110 | * RefVectorOf
|
---|
111 | *
|
---|
112 | * SchemaAttDef
|
---|
113 | * SchemaElementDecl
|
---|
114 | * ContentSpecNode
|
---|
115 | * IC_Field
|
---|
116 | * DatatypeValidator
|
---|
117 | * IdentityConstraint
|
---|
118 | * XMLNumber
|
---|
119 | * XercesLocationPath
|
---|
120 | * XercesStep
|
---|
121 | *
|
---|
122 | ***********************************************************/
|
---|
123 | static void storeObject(RefVectorOf<SchemaAttDef>* const tempObjToWrite
|
---|
124 | , XSerializeEngine& serEng);
|
---|
125 |
|
---|
126 | static void loadObject(RefVectorOf<SchemaAttDef>** tempObjToRead
|
---|
127 | , int initSize
|
---|
128 | , bool toAdopt
|
---|
129 | , XSerializeEngine& serEng);
|
---|
130 |
|
---|
131 | static void storeObject(RefVectorOf<SchemaElementDecl>* const tempObjToWrite
|
---|
132 | , XSerializeEngine& serEng);
|
---|
133 |
|
---|
134 | static void loadObject(RefVectorOf<SchemaElementDecl>** tempObjToRead
|
---|
135 | , int initSize
|
---|
136 | , bool toAdopt
|
---|
137 | , XSerializeEngine& serEng);
|
---|
138 |
|
---|
139 | static void storeObject(RefVectorOf<ContentSpecNode>* const tempObjToWrite
|
---|
140 | , XSerializeEngine& serEng);
|
---|
141 |
|
---|
142 | static void loadObject(RefVectorOf<ContentSpecNode>** tempObjToRead
|
---|
143 | , int initSize
|
---|
144 | , bool toAdopt
|
---|
145 | , XSerializeEngine& serEng);
|
---|
146 |
|
---|
147 | static void storeObject(RefVectorOf<IC_Field>* const tempObjToWrite
|
---|
148 | , XSerializeEngine& serEng);
|
---|
149 |
|
---|
150 | static void loadObject(RefVectorOf<IC_Field>** tempObjToRead
|
---|
151 | , int initSize
|
---|
152 | , bool toAdopt
|
---|
153 | , XSerializeEngine& serEng);
|
---|
154 |
|
---|
155 | static void storeObject(RefVectorOf<DatatypeValidator>* const tempObjToWrite
|
---|
156 | , XSerializeEngine& serEng);
|
---|
157 |
|
---|
158 | static void loadObject(RefVectorOf<DatatypeValidator>** tempObjToRead
|
---|
159 | , int initSize
|
---|
160 | , bool toAdopt
|
---|
161 | , XSerializeEngine& serEng);
|
---|
162 |
|
---|
163 | static void storeObject(RefVectorOf<IdentityConstraint>* const tempObjToWrite
|
---|
164 | , XSerializeEngine& serEng);
|
---|
165 |
|
---|
166 | static void loadObject(RefVectorOf<IdentityConstraint>** tempObjToRead
|
---|
167 | , int initSize
|
---|
168 | , bool toAdopt
|
---|
169 | , XSerializeEngine& serEng);
|
---|
170 |
|
---|
171 | static void storeObject(RefVectorOf<XMLNumber>* const tempObjToWrite
|
---|
172 | , XSerializeEngine& serEng);
|
---|
173 |
|
---|
174 | static void loadObject(RefVectorOf<XMLNumber>** tempObjToRead
|
---|
175 | , int initSize
|
---|
176 | , bool toAdopt
|
---|
177 | , XMLNumber::NumberType numType
|
---|
178 | , XSerializeEngine& serEng);
|
---|
179 |
|
---|
180 | static void storeObject(RefVectorOf<XercesLocationPath>* const tempObjToWrite
|
---|
181 | , XSerializeEngine& serEng);
|
---|
182 |
|
---|
183 | static void loadObject(RefVectorOf<XercesLocationPath>** tempObjToRead
|
---|
184 | , int initSize
|
---|
185 | , bool toAdopt
|
---|
186 | , XSerializeEngine& serEng);
|
---|
187 |
|
---|
188 | static void storeObject(RefVectorOf<XercesStep>* const tempObjToWrite
|
---|
189 | , XSerializeEngine& serEng);
|
---|
190 |
|
---|
191 | static void loadObject(RefVectorOf<XercesStep>** tempObjToRead
|
---|
192 | , int initSize
|
---|
193 | , bool toAdopt
|
---|
194 | , XSerializeEngine& serEng);
|
---|
195 |
|
---|
196 | /**********************************************************
|
---|
197 | *
|
---|
198 | * RefHashTableOf
|
---|
199 | *
|
---|
200 | * KVStringPair
|
---|
201 | * XMLAttDef
|
---|
202 | * DTDAttDef
|
---|
203 | * ComplexTypeInfo
|
---|
204 | * XercesGroupInfo
|
---|
205 | * XercesAttGroupInfo
|
---|
206 | * XMLRefInfo
|
---|
207 | * DatatypeValidator
|
---|
208 | * Grammar
|
---|
209 | * XSAnnotation
|
---|
210 | *
|
---|
211 | ***********************************************************/
|
---|
212 | static void storeObject(RefHashTableOf<KVStringPair>* const tempObjToWrite
|
---|
213 | , XSerializeEngine& serEng);
|
---|
214 |
|
---|
215 | static void loadObject(RefHashTableOf<KVStringPair>** tempObjToRead
|
---|
216 | , int initSize
|
---|
217 | , bool toAdopt
|
---|
218 | , XSerializeEngine& serEng);
|
---|
219 |
|
---|
220 | static void storeObject(RefHashTableOf<XMLAttDef>* const tempObjToWrite
|
---|
221 | , XSerializeEngine& serEng);
|
---|
222 |
|
---|
223 | static void loadObject(RefHashTableOf<XMLAttDef>** tempObjToRead
|
---|
224 | , int initSize
|
---|
225 | , bool toAdopt
|
---|
226 | , XSerializeEngine& serEng);
|
---|
227 |
|
---|
228 | static void storeObject(RefHashTableOf<DTDAttDef>* const tempObjToWrite
|
---|
229 | , XSerializeEngine& serEng);
|
---|
230 |
|
---|
231 | static void loadObject(RefHashTableOf<DTDAttDef>** tempObjToRead
|
---|
232 | , int initSize
|
---|
233 | , bool toAdopt
|
---|
234 | , XSerializeEngine& serEng);
|
---|
235 |
|
---|
236 | static void storeObject(RefHashTableOf<ComplexTypeInfo>* const tempObjToWrite
|
---|
237 | , XSerializeEngine& serEng);
|
---|
238 |
|
---|
239 | static void loadObject(RefHashTableOf<ComplexTypeInfo>** tempObjToRead
|
---|
240 | , int initSize
|
---|
241 | , bool toAdopt
|
---|
242 | , XSerializeEngine& serEng);
|
---|
243 |
|
---|
244 | static void storeObject(RefHashTableOf<XercesGroupInfo>* const tempObjToWrite
|
---|
245 | , XSerializeEngine& serEng);
|
---|
246 |
|
---|
247 | static void loadObject(RefHashTableOf<XercesGroupInfo>** tempObjToRead
|
---|
248 | , int initSize
|
---|
249 | , bool toAdopt
|
---|
250 | , XSerializeEngine& serEng);
|
---|
251 |
|
---|
252 | static void storeObject(RefHashTableOf<XercesAttGroupInfo>* const tempObjToWrite
|
---|
253 | , XSerializeEngine& serEng);
|
---|
254 |
|
---|
255 | static void loadObject(RefHashTableOf<XercesAttGroupInfo>** tempObjToRead
|
---|
256 | , int initSize
|
---|
257 | , bool toAdopt
|
---|
258 | , XSerializeEngine& serEng);
|
---|
259 |
|
---|
260 | static void storeObject(RefHashTableOf<XMLRefInfo>* const tempObjToWrite
|
---|
261 | , XSerializeEngine& serEng);
|
---|
262 |
|
---|
263 | static void loadObject(RefHashTableOf<XMLRefInfo>** tempObjToRead
|
---|
264 | , int initSize
|
---|
265 | , bool toAdopt
|
---|
266 | , XSerializeEngine& serEng);
|
---|
267 |
|
---|
268 | static void storeObject(RefHashTableOf<DatatypeValidator>* const tempObjToWrite
|
---|
269 | , XSerializeEngine& serEng);
|
---|
270 |
|
---|
271 | static void loadObject(RefHashTableOf<DatatypeValidator>** tempObjToRead
|
---|
272 | , int initSize
|
---|
273 | , bool toAdopt
|
---|
274 | , XSerializeEngine& serEng);
|
---|
275 |
|
---|
276 | static void storeObject(RefHashTableOf<Grammar>* const tempObjToWrite
|
---|
277 | , XSerializeEngine& serEng);
|
---|
278 |
|
---|
279 | static void loadObject(RefHashTableOf<Grammar>** tempObjToRead
|
---|
280 | , int initSize
|
---|
281 | , bool toAdopt
|
---|
282 | , XSerializeEngine& serEng);
|
---|
283 |
|
---|
284 | static void storeObject(RefHashTableOf<XSAnnotation>* const tempObjToWrite
|
---|
285 | , XSerializeEngine& serEng);
|
---|
286 |
|
---|
287 | static void loadObject(RefHashTableOf<XSAnnotation>** tempObjToRead
|
---|
288 | , int initSize
|
---|
289 | , bool toAdopt
|
---|
290 | , XSerializeEngine& serEng);
|
---|
291 |
|
---|
292 | /**********************************************************
|
---|
293 | *
|
---|
294 | * RefHash2KeysTableOf
|
---|
295 | *
|
---|
296 | * SchemaAttDef
|
---|
297 | * ElemVector
|
---|
298 | *
|
---|
299 | ***********************************************************/
|
---|
300 | static void storeObject(RefHash2KeysTableOf<SchemaAttDef>* const tempObjToWrite
|
---|
301 | , XSerializeEngine& serEng);
|
---|
302 |
|
---|
303 | static void loadObject(RefHash2KeysTableOf<SchemaAttDef>** tempObjToRead
|
---|
304 | , int initSize
|
---|
305 | , bool toAdopt
|
---|
306 | , XSerializeEngine& serEng);
|
---|
307 |
|
---|
308 | static void storeObject(RefHash2KeysTableOf<ElemVector>* const tempObjToWrite
|
---|
309 | , XSerializeEngine& serEng);
|
---|
310 |
|
---|
311 | static void loadObject(RefHash2KeysTableOf<ElemVector>** tempObjToRead
|
---|
312 | , int initSize
|
---|
313 | , bool toAdopt
|
---|
314 | , XSerializeEngine& serEng);
|
---|
315 |
|
---|
316 | /**********************************************************
|
---|
317 | *
|
---|
318 | * RefHash3KeysIdPool
|
---|
319 | *
|
---|
320 | * SchemaElementDecl
|
---|
321 | *
|
---|
322 | ***********************************************************/
|
---|
323 | static void storeObject(RefHash3KeysIdPool<SchemaElementDecl>* const tempObjToWrite
|
---|
324 | , XSerializeEngine& serEng);
|
---|
325 |
|
---|
326 | static void loadObject(RefHash3KeysIdPool<SchemaElementDecl>** tempObjToRead
|
---|
327 | , int initSize
|
---|
328 | , bool toAdopt
|
---|
329 | , int initSize2
|
---|
330 | , XSerializeEngine& serEng);
|
---|
331 |
|
---|
332 | /**********************************************************
|
---|
333 | *
|
---|
334 | * NameIdPool
|
---|
335 | *
|
---|
336 | * DTDElementDecl
|
---|
337 | * DTDEntityDecl
|
---|
338 | * XMLNotationDecl
|
---|
339 | *
|
---|
340 | ***********************************************************/
|
---|
341 | static void storeObject(NameIdPool<DTDElementDecl>* const tempObjToWrite
|
---|
342 | , XSerializeEngine& serEng);
|
---|
343 |
|
---|
344 | static void loadObject(NameIdPool<DTDElementDecl>** tempObjToRead
|
---|
345 | , int initSize
|
---|
346 | , int initSize2
|
---|
347 | , XSerializeEngine& serEng);
|
---|
348 |
|
---|
349 | static void storeObject(NameIdPool<DTDEntityDecl>* const tempObjToWrite
|
---|
350 | , XSerializeEngine& serEng);
|
---|
351 |
|
---|
352 | static void loadObject(NameIdPool<DTDEntityDecl>** tempObjToRead
|
---|
353 | , int initSize
|
---|
354 | , int initSize2
|
---|
355 | , XSerializeEngine& serEng);
|
---|
356 |
|
---|
357 | static void storeObject(NameIdPool<XMLNotationDecl>* const tempObjToWrite
|
---|
358 | , XSerializeEngine& serEng);
|
---|
359 |
|
---|
360 | static void loadObject(NameIdPool<XMLNotationDecl>** tempObjToRead
|
---|
361 | , int initSize
|
---|
362 | , int initSize2
|
---|
363 | , XSerializeEngine& serEng);
|
---|
364 |
|
---|
365 | private:
|
---|
366 | // -----------------------------------------------------------------------
|
---|
367 | // Unimplemented constructors and operators
|
---|
368 | // -----------------------------------------------------------------------
|
---|
369 | ~XTemplateSerializer();
|
---|
370 | XTemplateSerializer();
|
---|
371 | XTemplateSerializer(const XTemplateSerializer&);
|
---|
372 | XTemplateSerializer& operator=(const XTemplateSerializer&);
|
---|
373 |
|
---|
374 | };
|
---|
375 |
|
---|
376 | XERCES_CPP_NAMESPACE_END
|
---|
377 |
|
---|
378 | #endif
|
---|