peiyongz 2003/10/07 12:39:03 Modified: c/src/xercesc/validators/datatype AnySimpleTypeDatatypeValidator.cpp AnySimpleTypeDatatypeValidator.hpp BooleanDatatypeValidator.cpp BooleanDatatypeValidator.hpp UnionDatatypeValidator.cpp UnionDatatypeValidator.hpp Log: Implementation of Serialization/Deserialization Revision Changes Path 1.8 +14 -0 xml-xerces/c/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp Index: AnySimpleTypeDatatypeValidator.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- AnySimpleTypeDatatypeValidator.cpp 1 Oct 2003 01:09:35 -0000 1.7 +++ AnySimpleTypeDatatypeValidator.cpp 7 Oct 2003 19:39:03 -0000 1.8 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.8 2003/10/07 19:39:03 peiyongz + * Implementation of Serialization/Deserialization + * * Revision 1.7 2003/10/01 01:09:35 knoaman * Refactoring of some code to improve performance. * @@ -130,6 +133,17 @@ const RefArrayVectorOf<XMLCh>* AnySimpleTypeDatatypeValidator::getEnumString() const { return 0; +} + +/*** + * Support for Serialization/De-serialization + ***/ + +IMPL_XSERIALIZABLE_TOCREATE(AnySimpleTypeDatatypeValidator) + +void AnySimpleTypeDatatypeValidator::serialize(XSerializeEngine& serEng) +{ + DatatypeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END 1.8 +7 -1 xml-xerces/c/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp Index: AnySimpleTypeDatatypeValidator.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- AnySimpleTypeDatatypeValidator.hpp 1 Oct 2003 01:09:35 -0000 1.7 +++ AnySimpleTypeDatatypeValidator.hpp 7 Oct 2003 19:39:03 -0000 1.8 @@ -162,6 +162,12 @@ , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); + + /*** + * Support for Serialization/De-serialization + ***/ + DECL_XSERIALIZABLE(AnySimpleTypeDatatypeValidator) + }; 1.9 +14 -0 xml-xerces/c/src/xercesc/validators/datatype/BooleanDatatypeValidator.cpp Index: BooleanDatatypeValidator.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/datatype/BooleanDatatypeValidator.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- BooleanDatatypeValidator.cpp 16 May 2003 06:01:57 -0000 1.8 +++ BooleanDatatypeValidator.cpp 7 Oct 2003 19:39:03 -0000 1.9 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.9 2003/10/07 19:39:03 peiyongz + * Implementation of Serialization/Deserialization + * * Revision 1.8 2003/05/16 06:01:57 knoaman * Partial implementation of the configurable memory manager. * @@ -251,6 +254,17 @@ const RefArrayVectorOf<XMLCh>* BooleanDatatypeValidator::getEnumString() const { return 0; +} + +/*** + * Support for Serialization/De-serialization + ***/ + +IMPL_XSERIALIZABLE_TOCREATE(BooleanDatatypeValidator) + +void BooleanDatatypeValidator::serialize(XSerializeEngine& serEng) +{ + DatatypeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END 1.6 +6 -1 xml-xerces/c/src/xercesc/validators/datatype/BooleanDatatypeValidator.hpp Index: BooleanDatatypeValidator.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/datatype/BooleanDatatypeValidator.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- BooleanDatatypeValidator.hpp 15 May 2003 18:53:26 -0000 1.5 +++ BooleanDatatypeValidator.hpp 7 Oct 2003 19:39:03 -0000 1.6 @@ -150,6 +150,11 @@ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); + /*** + * Support for Serialization/De-serialization + ***/ + DECL_XSERIALIZABLE(BooleanDatatypeValidator) + private: void checkContent(const XMLCh* const content, bool asBase); 1.13 +111 -1 xml-xerces/c/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp Index: UnionDatatypeValidator.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- UnionDatatypeValidator.cpp 1 Oct 2003 16:32:41 -0000 1.12 +++ UnionDatatypeValidator.cpp 7 Oct 2003 19:39:03 -0000 1.13 @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.13 2003/10/07 19:39:03 peiyongz + * Implementation of Serialization/Deserialization + * * Revision 1.12 2003/10/01 16:32:41 neilg * improve handling of out of memory conditions, bug #23415. Thanks to David Cargill. * @@ -443,6 +446,113 @@ const RefArrayVectorOf<XMLCh>* UnionDatatypeValidator::getEnumString() const { return getEnumeration(); +} + +/*** + * Support for Serialization/De-serialization + ***/ + +IMPL_XSERIALIZABLE_TOCREATE(UnionDatatypeValidator) + +void UnionDatatypeValidator::serialize(XSerializeEngine& serEng) +{ + + DatatypeValidator::serialize(serEng); + + if (serEng.isStoring()) + { + serEng<<fEnumerationInherited; + serEng<<fMemberTypesInherited; + + /*** + * + * Serialize RefArrayVectorOf<XMLCh> + * + ***/ + if (serEng.needToWriteTemplateObject(fEnumeration)) + { + int enumLength = fEnumeration->size(); + serEng<<enumLength; + + for ( int i = 0 ; i < enumLength; i++) + { + serEng.writeString(fEnumeration->elementAt(i)); + } + } + + /*** + * + * Serialize RefVectorOf<DatatypeValidator> + * + ***/ + if (serEng.needToWriteTemplateObject(fMemberTypeValidators)) + { + int vectorLength = fMemberTypeValidators->size(); + serEng<<vectorLength; + + for ( int i = 0 ; i < vectorLength; i++) + { + DatatypeValidator::storeDV(serEng, fMemberTypeValidators->elementAt(i)); + } + } + + DatatypeValidator::storeDV(serEng, fValidatedDatatype); + + } + else + { + serEng>>fEnumerationInherited; + serEng>>fMemberTypesInherited; + + /*** + * + * Deserialize RefArrayVectorOf<XMLCh> + * + ***/ + if (serEng.needToReadTemplateObject((void**)&fEnumeration)) + { + if (!fEnumeration) + { + fEnumeration = new (fMemoryManager) RefArrayVectorOf<XMLCh>(8, true, fMemoryManager); + } + + serEng.registerTemplateObject(fEnumeration); + + int enumLength = 0; + serEng>>enumLength; + for ( int i = 0; i < enumLength; i++) + { + XMLCh* enumVal; + serEng.readString(enumVal); + fEnumeration->addElement(enumVal); + } + } + + /*** + * + * Deserialize RefVectorOf<DatatypeValidator> + * + ***/ + if (serEng.needToReadTemplateObject((void**)&fMemberTypeValidators)) + { + if (!fMemberTypeValidators) + { + fMemberTypeValidators = new (fMemoryManager) RefVectorOf<DatatypeValidator>(8, true, fMemoryManager); + } + + serEng.registerTemplateObject(fMemberTypeValidators); + + int vectorLength = 0; + serEng>>vectorLength; + for ( int i = 0 ; i < vectorLength; i++) + { + fMemberTypeValidators->addElement(DatatypeValidator::loadDV(serEng)); + } + } + + fValidatedDatatype = DatatypeValidator::loadDV(serEng); + + } } XERCES_CPP_NAMESPACE_END 1.11 +13 -4 xml-xerces/c/src/xercesc/validators/datatype/UnionDatatypeValidator.hpp Index: UnionDatatypeValidator.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/datatype/UnionDatatypeValidator.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- UnionDatatypeValidator.hpp 16 Aug 2003 18:42:49 -0000 1.10 +++ UnionDatatypeValidator.hpp 7 Oct 2003 19:39:03 -0000 1.11 @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.11 2003/10/07 19:39:03 peiyongz + * Implementation of Serialization/Deserialization + * * Revision 1.10 2003/08/16 18:42:49 neilg * fix for bug 22457. Union types that are restrictions of other union types were previously considered not to inherit their parents member types. This is at variance with the behaviour of the Java parser and apparently with the spec, so I have changed this. * @@ -245,6 +248,12 @@ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); + /*** + * Support for Serialization/De-serialization + ***/ + DECL_XSERIALIZABLE(UnionDatatypeValidator) + + RefVectorOf<DatatypeValidator>* getMemberTypeValidators() const; @@ -307,9 +316,9 @@ // // ----------------------------------------------------------------------- - bool fEnumerationInherited; - bool fMemberTypesInherited; - RefArrayVectorOf<XMLCh>* fEnumeration; + bool fEnumerationInherited; + bool fMemberTypesInherited; + RefArrayVectorOf<XMLCh>* fEnumeration; RefVectorOf<DatatypeValidator>* fMemberTypeValidators; DatatypeValidator* fValidatedDatatype; };
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]