本文整理汇总了C++中XSerializeEngine类的典型用法代码示例。如果您正苦于以下问题:C++ XSerializeEngine类的具体用法?C++ XSerializeEngine怎么用?C++ XSerializeEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XSerializeEngine类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: serialize
void XMLBigDecimal::serialize(XSerializeEngine& serEng)
{
//REVISIT: may not need to call base since it does nothing
XMLNumber::serialize(serEng);
if (serEng.isStoring())
{
serEng<<fSign;
serEng<<fTotalDigits;
serEng<<fScale;
serEng<<fRawDataLen; // we purposely write this seperatly
serEng.writeString(fRawData);
serEng.writeString(fIntVal);
}
else
{
serEng>>fSign;
serEng>>fTotalDigits;
serEng>>fScale;
serEng>>fRawDataLen;
serEng.readString(fRawData);
serEng.readString(fIntVal);
}
}
开发者ID:,项目名称:,代码行数:29,代码来源:
示例2: serialize
void DecimalDatatypeValidator::serialize(XSerializeEngine& serEng)
{
/***
* Note:
*
* During storing, we need write the specific number
* type info before calling base::serialize().
*
* While loading, we do nothing here
***/
if (serEng.isStoring())
{
serEng<<(int) (XMLNumber::BigDecimal);
}
AbstractNumericValidator::serialize(serEng);
//don't serialize XMLBigDecimal*
if (serEng.isStoring())
{
serEng<<fTotalDigits;
serEng<<fFractionDigits;
}
else
{
serEng>>fTotalDigits;
serEng>>fFractionDigits;
}
}
开发者ID:brock7,项目名称:TianLong,代码行数:31,代码来源:DecimalDatatypeValidator.cpp
示例3: serialize
void XMLSchemaDescriptionImpl::serialize(XSerializeEngine& serEng)
{
XMLSchemaDescription::serialize(serEng);
if (serEng.isStoring())
{
serEng<<(int)fContextType;
serEng.writeString(fNamespace);
/***
*
* Serialize RefArrayVectorOf<XMLCh>* fLocationHints;
*
***/
XTemplateSerializer::storeObject(fLocationHints, serEng);
QName* tempQName = (QName*)fTriggeringComponent;
serEng<<tempQName;
tempQName = (QName*)fEnclosingElementName;
serEng<<tempQName;
XMLAttDef* tempAttDef = (XMLAttDef*)fAttributes;
serEng<<tempAttDef;
}
else
{
int i;
serEng>>i;
fContextType = (ContextType)i;
//the original fNamespace which came from the ctor needs deallocated
if (fNamespace)
{
XMLGrammarDescription::getMemoryManager()->deallocate((void*)fNamespace);
}
serEng.readString((XMLCh*&)fNamespace);
/***
*
* Deserialize RefArrayVectorOf<XMLCh> fLocationHints
*
***/
XTemplateSerializer::loadObject(&fLocationHints, 4, true, serEng);
QName* tempQName;
serEng>>tempQName;
fTriggeringComponent = tempQName;
serEng>>tempQName;
fEnclosingElementName = tempQName;
XMLAttDef* tempAttDef;
serEng>>tempAttDef;
fAttributes=tempAttDef;
}
}
开发者ID:JohnWilliam1988,项目名称:TCIDE,代码行数:60,代码来源:XMLSchemaDescriptionImpl.cpp
示例4: serialize
void DatatypeValidatorFactory::serialize(XSerializeEngine& serEng)
{
// Need not to serialize static data member, fBuiltInRegistry
if (serEng.isStoring())
{
/***
* Serialize RefHashTableOf<DatatypeValidator>
***/
XTemplateSerializer::storeObject(fUserDefinedRegistry, serEng);
}
else
{
/***
* DV in the UserDefinedRegistry rely on the fBuiltInRegistry
* to resolve their built-in baseValidator
***/
expandRegistryToFullSchemaSet();
/***
* Deserialize RefHashTableOf<DatatypeValidator>
***/
XTemplateSerializer::loadObject(&fUserDefinedRegistry, 29, true, serEng);
}
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:27,代码来源:DatatypeValidatorFactory.cpp
示例5: serialize
void DTDAttDef::serialize(XSerializeEngine& serEng)
{
XMLAttDef::serialize(serEng);
if (serEng.isStoring())
{
serEng<<fElemId;
serEng.writeString(fName);
}
else
{
serEng>>fElemId;
serEng.readString(fName);
}
}
开发者ID:brock7,项目名称:TianLong,代码行数:16,代码来源:DTDAttDef.cpp
示例6: serialize
void XMLRefInfo::serialize(XSerializeEngine& serEng)
{
if (serEng.isStoring())
{
serEng<<fDeclared;
serEng<<fUsed;
serEng.writeString(fRefName);
}
else
{
serEng>>fDeclared;
serEng>>fUsed;
serEng.readString(fRefName);
}
}
开发者ID:AmesianX,项目名称:Sigil,代码行数:16,代码来源:XMLRefInfo.cpp
示例7: serialize
void KVStringPair::serialize(XSerializeEngine& serEng)
{
if (serEng.isStoring())
{
serEng.writeString(fKey, fKeyAllocSize, XSerializeEngine::toWriteBufferLen);
serEng.writeString(fValue, fValueAllocSize, XSerializeEngine::toWriteBufferLen);
}
else
{
int dataLen = 0;
serEng.readString(fKey, (int&)fKeyAllocSize, dataLen, XSerializeEngine::toReadBufferLen);
serEng.readString(fValue, (int&)fValueAllocSize, dataLen, XSerializeEngine::toReadBufferLen);
}
}
开发者ID:mydw,项目名称:mydw,代码行数:17,代码来源:KVStringPair.cpp
示例8: serialize
void SchemaAttDefList::serialize(XSerializeEngine& serEng)
{
XMLAttDefList::serialize(serEng);
if (serEng.isStoring())
{
/***
*
* Serialize RefHash2KeysTableOf<SchemaAttDef>
*
***/
XTemplateSerializer::storeObject(fList, serEng);
serEng.writeSize (fCount);
// do not serialize fEnum
}
else
{
/***
*
* Deserialize RefHash2KeysTableOf<SchemaAttDef>
*
***/
XTemplateSerializer::loadObject(&fList, 29, true, serEng);
// assume empty so we can size fArray just right
serEng.readSize (fSize);
if (!fEnum && fList)
{
fEnum = new (getMemoryManager()) RefHash2KeysTableOfEnumerator<SchemaAttDef>(fList, false, getMemoryManager());
}
if(fSize)
{
(getMemoryManager())->deallocate(fArray);
fArray = (SchemaAttDef **)((getMemoryManager())->allocate( sizeof(SchemaAttDef*) * fSize));
fCount = 0;
while(fEnum->hasMoreElements())
{
fArray[fCount++] = &fEnum->nextElement();
}
}
}
}
开发者ID:JohnWilliam1988,项目名称:TCIDE,代码行数:45,代码来源:SchemaAttDefList.cpp
示例9: load
/***
*
* To verify that the content in the binary stream
* is the same as this class
*
***/
void XProtoType::load(XSerializeEngine& serEng
, XMLByte* const inName
, MemoryManager* const manager)
{
if (!inName)
{
ThrowXMLwithMemMgr(XSerializationException
, XMLExcepts::XSer_ProtoType_Null_ClassName, manager);
}
// read and check class name length
XMLSize_t inNameLen = XMLString::stringLen((char*)inName);
XMLSize_t classNameLen = 0;
serEng >> (unsigned long&)classNameLen;
if (classNameLen != inNameLen)
{
XMLCh value1[17];
XMLCh value2[17];
XMLString::binToText((unsigned long)inNameLen, value1, 16, 10, manager);
XMLString::binToText((unsigned long)classNameLen, value2, 16, 10, manager);
ThrowXMLwithMemMgr2(XSerializationException
, XMLExcepts::XSer_ProtoType_NameLen_Dif
, value1
, value2
, manager);
}
// read and check class name
XMLByte className[256];
serEng.read(className, classNameLen*sizeof(XMLByte));
className[classNameLen] = '\0';
if ( !XMLString::equals((char*)className, (char*)inName))
{
//we don't have class name exceed this length in xerces
XMLCh name1[256];
XMLCh name2[256];
XMLCh *tmp = XMLString::transcode((char*)inName, manager);
XMLString::copyNString(name1, tmp, 255);
manager->deallocate(tmp);
tmp = XMLString::transcode((char*)className, manager);
XMLString::copyNString(name2, tmp, 255);
manager->deallocate(tmp);
ThrowXMLwithMemMgr2(XSerializationException
, XMLExcepts::XSer_ProtoType_Name_Dif
, name1
, name2
, manager);
}
return;
}
开发者ID:AuditoryBiophysicsLab,项目名称:EarLab,代码行数:62,代码来源:XProtoType.cpp
示例10: serialize
void DTDElementDecl::serialize(XSerializeEngine& serEng)
{
XMLElementDecl::serialize(serEng);
if (serEng.isStoring())
{
serEng<<(int) fModelType;
/***
*
* Serialize RefHashTableOf<DTDAttDef>
*
***/
XTemplateSerializer::storeObject(fAttDefs, serEng);
serEng<<fAttList;
serEng<<fContentSpec;
/***
* don't serialize
*
* XMLContentModel* fContentModel;
* XMLCh* fFormattedModel;
*
***/
}
else
{
int i;
serEng>>i;
fModelType=(ModelTypes)i;
/***
*
* Deserialize RefHashTableOf<DTDAttDef>
*
***/
XTemplateSerializer::loadObject(&fAttDefs, 29, true, serEng);
serEng>>fAttList;
serEng>>fContentSpec;
/***
* don't deserialize
*
* XMLContentModel* fContentModel;
* XMLCh* fFormattedModel;
*
***/
fContentModel = 0;
fFormattedModel = 0;
}
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:56,代码来源:DTDElementDecl.cpp
示例11: serialize
void XSAnnotation::serialize(XSerializeEngine& serEng)
{
if (serEng.isStoring())
{
serEng.writeString(fContents);
serEng<<fNext;
serEng.writeString(fSystemId);
serEng<<fLine;
serEng<<fCol;
}
else
{
serEng.readString(fContents);
serEng>>fNext;
serEng.readString(fSystemId);
serEng>>fLine;
serEng>>fCol;
}
}
开发者ID:mydw,项目名称:mydw,代码行数:20,代码来源:XSAnnotation.cpp
示例12: serialize
void SchemaAttDef::serialize(XSerializeEngine& serEng)
{
XMLAttDef::serialize(serEng);
if (serEng.isStoring())
{
serEng.writeSize (fElemId);
serEng<<(int)fPSVIScope;
serEng<<fAttName;
DatatypeValidator::storeDV(serEng, fDatatypeValidator);
/***
* Serialize ValueVectorOf<unsigned int>
***/
XTemplateSerializer::storeObject(fNamespaceList, serEng);
serEng<<fBaseAttDecl;
}
else
{
serEng.readSize (fElemId);
int i;
serEng>>i;
fPSVIScope = (PSVIDefs::PSVIScope)i;
serEng>>fAttName;
fDatatypeValidator = DatatypeValidator::loadDV(serEng);
/***
* Deserialize ValueVectorOf<unsigned int>
***/
XTemplateSerializer::loadObject(&fNamespaceList, 8, false, serEng);
serEng>>fBaseAttDecl;
}
}
开发者ID:JohnWilliam1988,项目名称:TCIDE,代码行数:41,代码来源:SchemaAttDef.cpp
示例13: serialize
void DTDGrammar::serialize(XSerializeEngine& serEng)
{
Grammar::serialize(serEng);
//don't serialize fDefaultEntities
if (serEng.isStoring())
{
/***
*
* Serialize NameIdPool<DTDElementDecl>* fElemDeclPool;
* Serialize NameIdPool<DTDEntityDecl>* fEntityDeclPool;
* Serialize NameIdPool<XMLNotationDecl>* fNotationDeclPool;
***/
XTemplateSerializer::storeObject(fElemDeclPool, serEng);
XTemplateSerializer::storeObject(fEntityDeclPool, serEng);
XTemplateSerializer::storeObject(fNotationDeclPool, serEng);
serEng<<fRootElemId;
serEng<<fValidated;
/***
* serialize() method shall be used to store object
* which has been created in ctor
***/
fGramDesc->serialize(serEng);
}
else
{
/***
*
* Deserialize NameIdPool<DTDElementDecl>* fElemDeclPool;
* Deserialize NameIdPool<DTDEntityDecl>* fEntityDeclPool;
* Deerialize NameIdPool<XMLNotationDecl>* fNotationDeclPool;
***/
XTemplateSerializer::loadObject(&fElemDeclPool, 109, 128, serEng);
fElemNonDeclPool = 0;
XTemplateSerializer::loadObject(&fEntityDeclPool, 109, 128, serEng);
XTemplateSerializer::loadObject(&fNotationDeclPool, 109, 128, serEng);
serEng>>fRootElemId;
serEng>>fValidated;
/***
* serialize() method shall be used to load object
* which has been created in ctor
***/
fGramDesc->serialize(serEng);
}
}
开发者ID:js422,项目名称:PERL,代码行数:53,代码来源:DTDGrammar.cpp
示例14: serialize
void SchemaAttDef::serialize(XSerializeEngine& serEng)
{
XMLAttDef::serialize(serEng);
if (serEng.isStoring())
{
serEng<<fElemId;
serEng<<(int)fValidity;
serEng<<(int)fValidation;
serEng<<(int)fPSVIScope;
serEng<<fAttName;
DatatypeValidator::storeDV(serEng, fDatatypeValidator);
DatatypeValidator::storeDV(serEng, fAnyDatatypeValidator);
DatatypeValidator::storeDV(serEng, (DatatypeValidator*)fMemberTypeValidator);
/***
* Serialize ValueVectorOf<unsigned int>
***/
XTemplateSerializer::storeObject(fNamespaceList, serEng);
serEng<<fBaseAttDecl;
}
else
{
serEng>>fElemId;
int i;
serEng>>i;
fValidity = (PSVIDefs::Validity)i;
serEng>>i;
fValidation = (PSVIDefs::Validation)i;
serEng>>i;
fPSVIScope = (PSVIDefs::PSVIScope)i;
serEng>>fAttName;
fDatatypeValidator = DatatypeValidator::loadDV(serEng);
fAnyDatatypeValidator = DatatypeValidator::loadDV(serEng);
fMemberTypeValidator = DatatypeValidator::loadDV(serEng);
/***
* Deserialize ValueVectorOf<unsigned int>
***/
XTemplateSerializer::loadObject(&fNamespaceList, 8, false, serEng);
serEng>>fBaseAttDecl;
}
}
开发者ID:mydw,项目名称:mydw,代码行数:53,代码来源:SchemaAttDef.cpp
示例15: serialize
void XMLStringPool::serialize(XSerializeEngine& serEng)
{
/***
* Since we are pretty sure that fIdMap and fHashTable is
* not shared by any other object, therefore there is no owned/referenced
* issue. Thus we can serialize the raw data only, rather than serializing
* both fIdMap and fHashTable.
*
* And we can rebuild the fIdMap and fHashTable out of the raw data during
* deserialization.
*
***/
if (serEng.isStoring())
{
serEng<<fCurId;
for (unsigned int index = 1; index < fCurId; index++)
{
const XMLCh* stringData = getValueForId(index);
serEng.writeString(stringData);
}
}
else
{
unsigned int mapSize;
serEng>>mapSize;
assert(1 == fCurId); //make sure empty
for (unsigned int index = 1; index < mapSize; index++)
{
XMLCh* stringData;
serEng.readString(stringData);
addNewEntry(stringData);
//we got to deallocate this string
//since stringpool will duplicate this string in the PoolElem and own that copy
fMemoryManager->deallocate(stringData);
}
}
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:39,代码来源:StringPool.cpp
示例16: serialize
void XMLAbstractDoubleFloat::serialize(XSerializeEngine& serEng)
{
//REVISIT: may not need to call base since it does nothing
XMLNumber::serialize(serEng);
if (serEng.isStoring())
{
serEng << fValue;
serEng << fType;
serEng << fDataConverted;
serEng << fDataOverflowed;
serEng << fSign;
serEng.writeString(fRawData);
// Do not serialize fFormattedString
}
else
{
serEng >> fValue;
int type = 0;
serEng >> type;
fType = (LiteralType) type;
serEng >> fDataConverted;
serEng >> fDataOverflowed;
serEng >> fSign;
serEng.readString(fRawData);
// Set it to 0 force it to re-format if needed
fFormattedString = 0;
}
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:38,代码来源:XMLAbstractDoubleFloat.cpp
示例17: serialize
void XMLElementDecl::serialize(XSerializeEngine& serEng)
{
if (serEng.isStoring())
{
serEng<<fElementName;
serEng<<(int) fCreateReason;
serEng.writeSize (fId);
serEng<<fExternalElement;
}
else
{
serEng>>fElementName;
int i;
serEng>>i;
fCreateReason=(CreateReasons)i;
serEng.readSize (fId);
serEng>>fExternalElement;
}
}
开发者ID:kanbang,项目名称:Colt,代码行数:23,代码来源:XMLElementDecl.cpp
示例18: serialize
void XercesAttGroupInfo::serialize(XSerializeEngine& serEng)
{
if (serEng.isStoring())
{
serEng<<fTypeWithId;
serEng<<fNameId;
serEng<<fNamespaceId;
/***
*
* Serialize RefVectorOf<SchemaAttDef>* fAttributes;
*
***/
XTemplateSerializer::storeObject(fAttributes, serEng);
/***
*
* Serialize RefVectorOf<SchemaAttDef>* fAnyAttributes;
*
***/
XTemplateSerializer::storeObject(fAnyAttributes, serEng);
serEng<<fCompleteWildCard;
}
else
{
serEng>>fTypeWithId;
serEng>>fNameId;
serEng>>fNamespaceId;
/***
*
* Deserialize RefVectorOf<SchemaAttDef>* fAttributes;
*
***/
XTemplateSerializer::loadObject(&fAttributes, 4, true, serEng);
/***
*
* Deserialize RefVectorOf<SchemaAttDef>* fAnyAttributes;
*
***/
XTemplateSerializer::loadObject(&fAnyAttributes, 2, true, serEng);
serEng>>fCompleteWildCard;
}
}
开发者ID:kanbang,项目名称:Colt,代码行数:50,代码来源:XercesAttGroupInfo.cpp
示例19: serialize
void IC_KeyRef::serialize(XSerializeEngine& serEng)
{
IdentityConstraint::serialize(serEng);
if (serEng.isStoring())
{
IdentityConstraint::storeIC(serEng, fKey);
}
else
{
fKey = IdentityConstraint::loadIC(serEng);
}
}
开发者ID:kanbang,项目名称:Colt,代码行数:14,代码来源:IC_KeyRef.cpp
示例20: serialize
void XercesNodeTest::serialize(XSerializeEngine& serEng)
{
if (serEng.isStoring())
{
serEng<<fType;
serEng<<fName;
}
else
{
serEng>>fType;
serEng>>fName;
}
}
开发者ID:brock7,项目名称:TianLong,代码行数:14,代码来源:XercesXPath.cpp
注:本文中的XSerializeEngine类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论