[188] | 1 | /*
|
---|
| 2 | * The Apache Software License, Version 1.1
|
---|
| 3 | *
|
---|
| 4 | * Copyright (c) 2003 The Apache Software Foundation. All rights
|
---|
| 5 | * reserved.
|
---|
| 6 | *
|
---|
| 7 | * Redistribution and use in source and binary forms, with or without
|
---|
| 8 | * modification, are permitted provided that the following conditions
|
---|
| 9 | * are met:
|
---|
| 10 | *
|
---|
| 11 | * 1. Redistributions of source code must retain the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer.
|
---|
| 13 | *
|
---|
| 14 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
| 15 | * notice, this list of conditions and the following disclaimer in
|
---|
| 16 | * the documentation and/or other materials provided with the
|
---|
| 17 | * distribution.
|
---|
| 18 | *
|
---|
| 19 | * 3. The end-user documentation included with the redistribution,
|
---|
| 20 | * if any, must include the following acknowledgment:
|
---|
| 21 | * "This product includes software developed by the
|
---|
| 22 | * Apache Software Foundation (http://www.apache.org/)."
|
---|
| 23 | * Alternately, this acknowledgment may appear in the software itself,
|
---|
| 24 | * if and wherever such third-party acknowledgments normally appear.
|
---|
| 25 | *
|
---|
| 26 | * 4. The names "Xerces" and "Apache Software Foundation" must
|
---|
| 27 | * not be used to endorse or promote products derived from this
|
---|
| 28 | * software without prior written permission. For written
|
---|
| 29 | * permission, please contact apache\@apache.org.
|
---|
| 30 | *
|
---|
| 31 | * 5. Products derived from this software may not be called "Apache",
|
---|
| 32 | * nor may "Apache" appear in their name, without prior written
|
---|
| 33 | * permission of the Apache Software Foundation.
|
---|
| 34 | *
|
---|
| 35 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
---|
| 36 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 37 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
---|
| 38 | * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
---|
| 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
---|
| 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
---|
| 41 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
---|
| 42 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
| 43 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
---|
| 44 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
---|
| 45 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
| 46 | * SUCH DAMAGE.
|
---|
| 47 | * ====================================================================
|
---|
| 48 | *
|
---|
| 49 | * This software consists of voluntary contributions made by many
|
---|
| 50 | * individuals on behalf of the Apache Software Foundation, and was
|
---|
| 51 | * originally based on software copyright (c) 1999, International
|
---|
| 52 | * Business Machines, Inc., http://www.ibm.com . For more information
|
---|
| 53 | * on the Apache Software Foundation, please see
|
---|
| 54 | * <http://www.apache.org/>.
|
---|
| 55 | */
|
---|
| 56 |
|
---|
| 57 | /*
|
---|
| 58 | * $Log: XTemplateSerializer.hpp,v $
|
---|
| 59 | * Revision 1.3 2003/11/11 22:48:13 knoaman
|
---|
| 60 | * Serialization of XSAnnotation.
|
---|
| 61 | *
|
---|
| 62 | * Revision 1.2 2003/10/29 16:16:08 peiyongz
|
---|
| 63 | * GrammarPool' serialization/deserialization support
|
---|
| 64 | *
|
---|
| 65 | * Revision 1.1 2003/10/17 21:07:49 peiyongz
|
---|
| 66 | * To support Template object serialization/deserialization
|
---|
| 67 | *
|
---|
| 68 | * $Id: XTemplateSerializer.hpp,v 1.3 2003/11/11 22:48:13 knoaman Exp $
|
---|
| 69 | *
|
---|
| 70 | */
|
---|
| 71 |
|
---|
| 72 | #if !defined(XTEMPLATE_SERIALIZER_HPP)
|
---|
| 73 | #define XTEMPLATE_SERIALIZER_HPP
|
---|
| 74 |
|
---|
| 75 | #include <xercesc/util/ValueVectorOf.hpp>
|
---|
| 76 | #include <xercesc/util/RefArrayVectorOf.hpp>
|
---|
| 77 | #include <xercesc/util/RefVectorOf.hpp>
|
---|
| 78 | #include <xercesc/util/RefHashTableOf.hpp>
|
---|
| 79 | #include <xercesc/util/RefHash2KeysTableOf.hpp>
|
---|
| 80 | #include <xercesc/util/RefHash3KeysIdPool.hpp>
|
---|
| 81 | #include <xercesc/util/NameIdPool.hpp>
|
---|
| 82 |
|
---|
| 83 | #include <xercesc/framework/XMLNotationDecl.hpp>
|
---|
| 84 | #include <xercesc/framework/XMLRefInfo.hpp>
|
---|
| 85 | #include <xercesc/util/XMLNumber.hpp>
|
---|
| 86 | #include <xercesc/validators/common/ContentSpecNode.hpp>
|
---|
| 87 | #include <xercesc/validators/DTD/DTDAttDef.hpp>
|
---|
| 88 | #include <xercesc/validators/DTD/DTDElementDecl.hpp>
|
---|
| 89 | #include <xercesc/validators/DTD/DTDEntityDecl.hpp>
|
---|
| 90 | #include <xercesc/validators/schema/SchemaAttDef.hpp>
|
---|
| 91 | #include <xercesc/validators/schema/SchemaElementDecl.hpp>
|
---|
| 92 | #include <xercesc/validators/schema/XercesGroupInfo.hpp>
|
---|
| 93 | #include <xercesc/validators/schema/XercesAttGroupInfo.hpp>
|
---|
| 94 | #include <xercesc/validators/schema/SchemaGrammar.hpp>
|
---|
| 95 | #include <xercesc/validators/schema/identity/IC_Field.hpp>
|
---|
| 96 | #include <xercesc/validators/schema/identity/IdentityConstraint.hpp>
|
---|
| 97 | #include <xercesc/validators/schema/identity/XercesXPath.hpp>
|
---|
| 98 | #include <xercesc/framework/psvi/XSAnnotation.hpp>
|
---|
| 99 |
|
---|
| 100 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
| 101 |
|
---|
| 102 | class XMLUTIL_EXPORT XTemplateSerializer
|
---|
| 103 | {
|
---|
| 104 | public:
|
---|
| 105 |
|
---|
| 106 | /**********************************************************
|
---|
| 107 | *
|
---|
| 108 | * ValueVectorOf
|
---|
| 109 | *
|
---|
| 110 | * SchemaElementDecl*
|
---|
| 111 | * unsigned int
|
---|
| 112 | *
|
---|
| 113 | ***********************************************************/
|
---|
| 114 | static void storeObject(ValueVectorOf<SchemaElementDecl*>* const tempObjToWrite
|
---|
| 115 | , XSerializeEngine& serEng);
|
---|
| 116 |
|
---|
| 117 | static void loadObject(ValueVectorOf<SchemaElementDecl*>** tempObjToRead
|
---|
| 118 | , int initSize
|
---|
| 119 | , bool toCallDestructor
|
---|
| 120 | , XSerializeEngine& serEng);
|
---|
| 121 |
|
---|
| 122 | static void storeObject(ValueVectorOf<unsigned int>* const tempObjToWrite
|
---|
| 123 | , XSerializeEngine& serEng);
|
---|
| 124 |
|
---|
| 125 | static void loadObject(ValueVectorOf<unsigned int>** tempObjToRead
|
---|
| 126 | , int initSize
|
---|
| 127 | , bool toCallDestructor
|
---|
| 128 | , XSerializeEngine& serEng);
|
---|
| 129 |
|
---|
| 130 | /**********************************************************
|
---|
| 131 | *
|
---|
| 132 | * RefArrayVectorOf
|
---|
| 133 | *
|
---|
| 134 | * XMLCh
|
---|
| 135 | *
|
---|
| 136 | ***********************************************************/
|
---|
| 137 | static void storeObject(RefArrayVectorOf<XMLCh>* const tempObjToWrite
|
---|
| 138 | , XSerializeEngine& serEng);
|
---|
| 139 |
|
---|
| 140 | static void loadObject(RefArrayVectorOf<XMLCh>** tempObjToRead
|
---|
| 141 | , int initSize
|
---|
| 142 | , bool toAdopt
|
---|
| 143 | , XSerializeEngine& serEng);
|
---|
| 144 |
|
---|
| 145 | /**********************************************************
|
---|
| 146 | *
|
---|
| 147 | * RefVectorOf
|
---|
| 148 | *
|
---|
| 149 | * SchemaAttDef
|
---|
| 150 | * SchemaElementDecl
|
---|
| 151 | * ContentSpecNode
|
---|
| 152 | * IC_Field
|
---|
| 153 | * DatatypeValidator
|
---|
| 154 | * IdentityConstraint
|
---|
| 155 | * XMLNumber
|
---|
| 156 | * XercesLocationPath
|
---|
| 157 | * XercesStep
|
---|
| 158 | *
|
---|
| 159 | ***********************************************************/
|
---|
| 160 | static void storeObject(RefVectorOf<SchemaAttDef>* const tempObjToWrite
|
---|
| 161 | , XSerializeEngine& serEng);
|
---|
| 162 |
|
---|
| 163 | static void loadObject(RefVectorOf<SchemaAttDef>** tempObjToRead
|
---|
| 164 | , int initSize
|
---|
| 165 | , bool toAdopt
|
---|
| 166 | , XSerializeEngine& serEng);
|
---|
| 167 |
|
---|
| 168 | static void storeObject(RefVectorOf<SchemaElementDecl>* const tempObjToWrite
|
---|
| 169 | , XSerializeEngine& serEng);
|
---|
| 170 |
|
---|
| 171 | static void loadObject(RefVectorOf<SchemaElementDecl>** tempObjToRead
|
---|
| 172 | , int initSize
|
---|
| 173 | , bool toAdopt
|
---|
| 174 | , XSerializeEngine& serEng);
|
---|
| 175 |
|
---|
| 176 | static void storeObject(RefVectorOf<ContentSpecNode>* const tempObjToWrite
|
---|
| 177 | , XSerializeEngine& serEng);
|
---|
| 178 |
|
---|
| 179 | static void loadObject(RefVectorOf<ContentSpecNode>** tempObjToRead
|
---|
| 180 | , int initSize
|
---|
| 181 | , bool toAdopt
|
---|
| 182 | , XSerializeEngine& serEng);
|
---|
| 183 |
|
---|
| 184 | static void storeObject(RefVectorOf<IC_Field>* const tempObjToWrite
|
---|
| 185 | , XSerializeEngine& serEng);
|
---|
| 186 |
|
---|
| 187 | static void loadObject(RefVectorOf<IC_Field>** tempObjToRead
|
---|
| 188 | , int initSize
|
---|
| 189 | , bool toAdopt
|
---|
| 190 | , XSerializeEngine& serEng);
|
---|
| 191 |
|
---|
| 192 | static void storeObject(RefVectorOf<DatatypeValidator>* const tempObjToWrite
|
---|
| 193 | , XSerializeEngine& serEng);
|
---|
| 194 |
|
---|
| 195 | static void loadObject(RefVectorOf<DatatypeValidator>** tempObjToRead
|
---|
| 196 | , int initSize
|
---|
| 197 | , bool toAdopt
|
---|
| 198 | , XSerializeEngine& serEng);
|
---|
| 199 |
|
---|
| 200 | static void storeObject(RefVectorOf<IdentityConstraint>* const tempObjToWrite
|
---|
| 201 | , XSerializeEngine& serEng);
|
---|
| 202 |
|
---|
| 203 | static void loadObject(RefVectorOf<IdentityConstraint>** tempObjToRead
|
---|
| 204 | , int initSize
|
---|
| 205 | , bool toAdopt
|
---|
| 206 | , XSerializeEngine& serEng);
|
---|
| 207 |
|
---|
| 208 | static void storeObject(RefVectorOf<XMLNumber>* const tempObjToWrite
|
---|
| 209 | , XSerializeEngine& serEng);
|
---|
| 210 |
|
---|
| 211 | static void loadObject(RefVectorOf<XMLNumber>** tempObjToRead
|
---|
| 212 | , int initSize
|
---|
| 213 | , bool toAdopt
|
---|
| 214 | , XMLNumber::NumberType numType
|
---|
| 215 | , XSerializeEngine& serEng);
|
---|
| 216 |
|
---|
| 217 | static void storeObject(RefVectorOf<XercesLocationPath>* const tempObjToWrite
|
---|
| 218 | , XSerializeEngine& serEng);
|
---|
| 219 |
|
---|
| 220 | static void loadObject(RefVectorOf<XercesLocationPath>** tempObjToRead
|
---|
| 221 | , int initSize
|
---|
| 222 | , bool toAdopt
|
---|
| 223 | , XSerializeEngine& serEng);
|
---|
| 224 |
|
---|
| 225 | static void storeObject(RefVectorOf<XercesStep>* const tempObjToWrite
|
---|
| 226 | , XSerializeEngine& serEng);
|
---|
| 227 |
|
---|
| 228 | static void loadObject(RefVectorOf<XercesStep>** tempObjToRead
|
---|
| 229 | , int initSize
|
---|
| 230 | , bool toAdopt
|
---|
| 231 | , XSerializeEngine& serEng);
|
---|
| 232 |
|
---|
| 233 | /**********************************************************
|
---|
| 234 | *
|
---|
| 235 | * RefHashTableOf
|
---|
| 236 | *
|
---|
| 237 | * KVStringPair
|
---|
| 238 | * XMLAttDef
|
---|
| 239 | * DTDAttDef
|
---|
| 240 | * ComplexTypeInfo
|
---|
| 241 | * XercesGroupInfo
|
---|
| 242 | * XercesAttGroupInfo
|
---|
| 243 | * XMLRefInfo
|
---|
| 244 | * DatatypeValidator
|
---|
| 245 | * Grammar
|
---|
| 246 | * XSAnnotation
|
---|
| 247 | *
|
---|
| 248 | ***********************************************************/
|
---|
| 249 | static void storeObject(RefHashTableOf<KVStringPair>* const tempObjToWrite
|
---|
| 250 | , XSerializeEngine& serEng);
|
---|
| 251 |
|
---|
| 252 | static void loadObject(RefHashTableOf<KVStringPair>** tempObjToRead
|
---|
| 253 | , int initSize
|
---|
| 254 | , bool toAdopt
|
---|
| 255 | , XSerializeEngine& serEng);
|
---|
| 256 |
|
---|
| 257 | static void storeObject(RefHashTableOf<XMLAttDef>* const tempObjToWrite
|
---|
| 258 | , XSerializeEngine& serEng);
|
---|
| 259 |
|
---|
| 260 | static void loadObject(RefHashTableOf<XMLAttDef>** tempObjToRead
|
---|
| 261 | , int initSize
|
---|
| 262 | , bool toAdopt
|
---|
| 263 | , XSerializeEngine& serEng);
|
---|
| 264 |
|
---|
| 265 | static void storeObject(RefHashTableOf<DTDAttDef>* const tempObjToWrite
|
---|
| 266 | , XSerializeEngine& serEng);
|
---|
| 267 |
|
---|
| 268 | static void loadObject(RefHashTableOf<DTDAttDef>** tempObjToRead
|
---|
| 269 | , int initSize
|
---|
| 270 | , bool toAdopt
|
---|
| 271 | , XSerializeEngine& serEng);
|
---|
| 272 |
|
---|
| 273 | static void storeObject(RefHashTableOf<ComplexTypeInfo>* const tempObjToWrite
|
---|
| 274 | , XSerializeEngine& serEng);
|
---|
| 275 |
|
---|
| 276 | static void loadObject(RefHashTableOf<ComplexTypeInfo>** tempObjToRead
|
---|
| 277 | , int initSize
|
---|
| 278 | , bool toAdopt
|
---|
| 279 | , XSerializeEngine& serEng);
|
---|
| 280 |
|
---|
| 281 | static void storeObject(RefHashTableOf<XercesGroupInfo>* const tempObjToWrite
|
---|
| 282 | , XSerializeEngine& serEng);
|
---|
| 283 |
|
---|
| 284 | static void loadObject(RefHashTableOf<XercesGroupInfo>** tempObjToRead
|
---|
| 285 | , int initSize
|
---|
| 286 | , bool toAdopt
|
---|
| 287 | , XSerializeEngine& serEng);
|
---|
| 288 |
|
---|
| 289 | static void storeObject(RefHashTableOf<XercesAttGroupInfo>* const tempObjToWrite
|
---|
| 290 | , XSerializeEngine& serEng);
|
---|
| 291 |
|
---|
| 292 | static void loadObject(RefHashTableOf<XercesAttGroupInfo>** tempObjToRead
|
---|
| 293 | , int initSize
|
---|
| 294 | , bool toAdopt
|
---|
| 295 | , XSerializeEngine& serEng);
|
---|
| 296 |
|
---|
| 297 | static void storeObject(RefHashTableOf<XMLRefInfo>* const tempObjToWrite
|
---|
| 298 | , XSerializeEngine& serEng);
|
---|
| 299 |
|
---|
| 300 | static void loadObject(RefHashTableOf<XMLRefInfo>** tempObjToRead
|
---|
| 301 | , int initSize
|
---|
| 302 | , bool toAdopt
|
---|
| 303 | , XSerializeEngine& serEng);
|
---|
| 304 |
|
---|
| 305 | static void storeObject(RefHashTableOf<DatatypeValidator>* const tempObjToWrite
|
---|
| 306 | , XSerializeEngine& serEng);
|
---|
| 307 |
|
---|
| 308 | static void loadObject(RefHashTableOf<DatatypeValidator>** tempObjToRead
|
---|
| 309 | , int initSize
|
---|
| 310 | , bool toAdopt
|
---|
| 311 | , XSerializeEngine& serEng);
|
---|
| 312 |
|
---|
| 313 | static void storeObject(RefHashTableOf<Grammar>* const tempObjToWrite
|
---|
| 314 | , XSerializeEngine& serEng);
|
---|
| 315 |
|
---|
| 316 | static void loadObject(RefHashTableOf<Grammar>** tempObjToRead
|
---|
| 317 | , int initSize
|
---|
| 318 | , bool toAdopt
|
---|
| 319 | , XSerializeEngine& serEng);
|
---|
| 320 |
|
---|
| 321 | static void storeObject(RefHashTableOf<XSAnnotation>* const tempObjToWrite
|
---|
| 322 | , XSerializeEngine& serEng);
|
---|
| 323 |
|
---|
| 324 | static void loadObject(RefHashTableOf<XSAnnotation>** tempObjToRead
|
---|
| 325 | , int initSize
|
---|
| 326 | , bool toAdopt
|
---|
| 327 | , XSerializeEngine& serEng);
|
---|
| 328 |
|
---|
| 329 | /**********************************************************
|
---|
| 330 | *
|
---|
| 331 | * RefHash2KeysTableOf
|
---|
| 332 | *
|
---|
| 333 | * SchemaAttDef
|
---|
| 334 | * ElemVector
|
---|
| 335 | *
|
---|
| 336 | ***********************************************************/
|
---|
| 337 | static void storeObject(RefHash2KeysTableOf<SchemaAttDef>* const tempObjToWrite
|
---|
| 338 | , XSerializeEngine& serEng);
|
---|
| 339 |
|
---|
| 340 | static void loadObject(RefHash2KeysTableOf<SchemaAttDef>** tempObjToRead
|
---|
| 341 | , int initSize
|
---|
| 342 | , bool toAdopt
|
---|
| 343 | , XSerializeEngine& serEng);
|
---|
| 344 |
|
---|
| 345 | static void storeObject(RefHash2KeysTableOf<ElemVector>* const tempObjToWrite
|
---|
| 346 | , XSerializeEngine& serEng);
|
---|
| 347 |
|
---|
| 348 | static void loadObject(RefHash2KeysTableOf<ElemVector>** tempObjToRead
|
---|
| 349 | , int initSize
|
---|
| 350 | , bool toAdopt
|
---|
| 351 | , XSerializeEngine& serEng);
|
---|
| 352 |
|
---|
| 353 | /**********************************************************
|
---|
| 354 | *
|
---|
| 355 | * RefHash3KeysIdPool
|
---|
| 356 | *
|
---|
| 357 | * SchemaElementDecl
|
---|
| 358 | *
|
---|
| 359 | ***********************************************************/
|
---|
| 360 | static void storeObject(RefHash3KeysIdPool<SchemaElementDecl>* const tempObjToWrite
|
---|
| 361 | , XSerializeEngine& serEng);
|
---|
| 362 |
|
---|
| 363 | static void loadObject(RefHash3KeysIdPool<SchemaElementDecl>** tempObjToRead
|
---|
| 364 | , int initSize
|
---|
| 365 | , bool toAdopt
|
---|
| 366 | , int initSize2
|
---|
| 367 | , XSerializeEngine& serEng);
|
---|
| 368 |
|
---|
| 369 | /**********************************************************
|
---|
| 370 | *
|
---|
| 371 | * NameIdPool
|
---|
| 372 | *
|
---|
| 373 | * DTDElementDecl
|
---|
| 374 | * DTDEntityDecl
|
---|
| 375 | * XMLNotationDecl
|
---|
| 376 | *
|
---|
| 377 | ***********************************************************/
|
---|
| 378 | static void storeObject(NameIdPool<DTDElementDecl>* const tempObjToWrite
|
---|
| 379 | , XSerializeEngine& serEng);
|
---|
| 380 |
|
---|
| 381 | static void loadObject(NameIdPool<DTDElementDecl>** tempObjToRead
|
---|
| 382 | , int initSize
|
---|
| 383 | , int initSize2
|
---|
| 384 | , XSerializeEngine& serEng);
|
---|
| 385 |
|
---|
| 386 | static void storeObject(NameIdPool<DTDEntityDecl>* const tempObjToWrite
|
---|
| 387 | , XSerializeEngine& serEng);
|
---|
| 388 |
|
---|
| 389 | static void loadObject(NameIdPool<DTDEntityDecl>** tempObjToRead
|
---|
| 390 | , int initSize
|
---|
| 391 | , int initSize2
|
---|
| 392 | , XSerializeEngine& serEng);
|
---|
| 393 |
|
---|
| 394 | static void storeObject(NameIdPool<XMLNotationDecl>* const tempObjToWrite
|
---|
| 395 | , XSerializeEngine& serEng);
|
---|
| 396 |
|
---|
| 397 | static void loadObject(NameIdPool<XMLNotationDecl>** tempObjToRead
|
---|
| 398 | , int initSize
|
---|
| 399 | , int initSize2
|
---|
| 400 | , XSerializeEngine& serEng);
|
---|
| 401 |
|
---|
| 402 | private:
|
---|
| 403 | // -----------------------------------------------------------------------
|
---|
| 404 | // Unimplemented constructors and operators
|
---|
| 405 | // -----------------------------------------------------------------------
|
---|
| 406 | ~XTemplateSerializer();
|
---|
| 407 | XTemplateSerializer();
|
---|
| 408 | XTemplateSerializer(const XTemplateSerializer&);
|
---|
| 409 | XTemplateSerializer& operator=(const XTemplateSerializer&);
|
---|
| 410 |
|
---|
| 411 | };
|
---|
| 412 |
|
---|
| 413 | XERCES_CPP_NAMESPACE_END
|
---|
| 414 |
|
---|
| 415 | #endif
|
---|