本文整理汇总了C++中SmartPtrCXmlElement类的典型用法代码示例。如果您正苦于以下问题:C++ SmartPtrCXmlElement类的具体用法?C++ SmartPtrCXmlElement怎么用?C++ SmartPtrCXmlElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SmartPtrCXmlElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CAF_CM_STATIC_FUNC_VALIDATE
void PropertyXml::add(
const SmartPtrCPropertyDoc propertyDoc,
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("PropertyXml", "add");
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(propertyDoc);
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string nameVal = propertyDoc->getName();
CAF_CM_VALIDATE_STRING(nameVal);
thisXml->addAttribute("name", nameVal);
const std::string typeVal =
EnumConvertersXml::convertPropertyTypeToString(propertyDoc->getType());
CAF_CM_VALIDATE_STRING(typeVal);
thisXml->addAttribute("type", typeVal);
const std::deque<std::string> valueVal =
propertyDoc->getValue();
CAF_CM_VALIDATE_STL(valueVal);
if (! valueVal.empty()) {
for (TConstIterator<std::deque<std::string> > valueIter(valueVal);
valueIter; valueIter++) {
const SmartPtrCXmlElement valueXml =
thisXml->createAndAddElement("value");
valueXml->setValue(*valueIter);
}
}
}
CAF_CM_EXIT;
}
示例2: add
void ClassFieldXml::add(
const SmartPtrCClassFieldDoc classFieldDoc,
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("ClassFieldXml", "add");
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(classFieldDoc);
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string namespaceValVal = classFieldDoc->getNamespaceVal();
CAF_CM_VALIDATE_STRING(namespaceValVal);
thisXml->addAttribute("namespace", namespaceValVal);
const std::string nameVal = classFieldDoc->getName();
CAF_CM_VALIDATE_STRING(nameVal);
thisXml->addAttribute("name", nameVal);
const std::string versionVal = classFieldDoc->getVersion();
CAF_CM_VALIDATE_STRING(versionVal);
thisXml->addAttribute("version", versionVal);
const std::string fieldVal = classFieldDoc->getField();
CAF_CM_VALIDATE_STRING(fieldVal);
thisXml->addAttribute("field", fieldVal);
}
CAF_CM_EXIT;
}
示例3: add
void ResponseHeaderXml::add(
const SmartPtrCResponseHeaderDoc responseHeaderDoc,
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("ResponseHeaderXml", "add");
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(responseHeaderDoc);
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string versionVal = responseHeaderDoc->getVersion();
CAF_CM_VALIDATE_STRING(versionVal);
thisXml->addAttribute("version", versionVal);
const std::string createdDateTimeVal = responseHeaderDoc->getCreatedDateTime();
CAF_CM_VALIDATE_STRING(createdDateTimeVal);
thisXml->addAttribute("createdDateTime", createdDateTimeVal);
const std::string sequenceNumberVal =
CStringConv::toString<uint32>(responseHeaderDoc->getSequenceNumber());
CAF_CM_VALIDATE_STRING(sequenceNumberVal);
thisXml->addAttribute("sequenceNumber", sequenceNumberVal);
const std::string isFinalResponseVal = responseHeaderDoc->getIsFinalResponse() ? "true" : "false";
CAF_CM_VALIDATE_STRING(isFinalResponseVal);
thisXml->addAttribute("isFinalResponse", isFinalResponseVal);
const std::string sessionIdVal =
BasePlatform::UuidToString(responseHeaderDoc->getSessionId());
if (! sessionIdVal.empty()) {
thisXml->addAttribute("sessionId", sessionIdVal);
}
}
CAF_CM_EXIT;
}
示例4: CAF_CM_STATIC_FUNC_VALIDATE
SmartPtrCAttachmentNameCollectionDoc AttachmentNameCollectionXml::parse(
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("AttachmentNameCollectionXml", "parse");
SmartPtrCAttachmentNameCollectionDoc attachmentNameCollectionDoc;
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const CXmlElement::SmartPtrCElementCollection nameChildrenXml =
thisXml->findRequiredChildren("attachmentName");
std::deque<std::string> nameVal;
if (! nameChildrenXml.IsNull() && ! nameChildrenXml->empty()) {
for (TConstIterator<CXmlElement::CElementCollection> nameXmlIter(*nameChildrenXml);
nameXmlIter; nameXmlIter++) {
const SmartPtrCXmlElement nameXml = nameXmlIter->second;
const std::string name = nameXml->findRequiredAttribute("name");
nameVal.push_back(name);
}
}
attachmentNameCollectionDoc.CreateInstance();
attachmentNameCollectionDoc->initialize(
nameVal);
}
CAF_CM_EXIT;
return attachmentNameCollectionDoc;
}
示例5: parse
SmartPtrCCmdlUnionDoc CmdlUnionXml::parse(
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("CmdlUnionXml", "parse");
SmartPtrCCmdlUnionDoc cmdlUnionDoc;
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string namespaceValStrVal =
thisXml->findRequiredAttribute("namespace");
const std::string namespaceValVal = namespaceValStrVal;
const std::string nameStrVal =
thisXml->findRequiredAttribute("name");
const std::string nameVal = nameStrVal;
const std::string versionStrVal =
thisXml->findRequiredAttribute("version");
const std::string versionVal = versionStrVal;
cmdlUnionDoc.CreateInstance();
cmdlUnionDoc->initialize(
namespaceValVal,
nameVal,
versionVal);
}
CAF_CM_EXIT;
return cmdlUnionDoc;
}
示例6: CAF_CM_STATIC_FUNC_VALIDATE
void ActionClassInstanceXml::add(
const SmartPtrCActionClassInstanceDoc actionClassInstanceDoc,
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("ActionClassInstanceXml", "add");
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(actionClassInstanceDoc);
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string namespaceValVal = actionClassInstanceDoc->getNamespaceVal();
CAF_CM_VALIDATE_STRING(namespaceValVal);
thisXml->addAttribute("namespace", namespaceValVal);
const std::string nameVal = actionClassInstanceDoc->getName();
CAF_CM_VALIDATE_STRING(nameVal);
thisXml->addAttribute("name", nameVal);
const std::string versionVal = actionClassInstanceDoc->getVersion();
CAF_CM_VALIDATE_STRING(versionVal);
thisXml->addAttribute("version", versionVal);
const SmartPtrCInstanceOperationCollectionDoc instanceOperationCollectionVal =
actionClassInstanceDoc->getInstanceOperationCollection();
CAF_CM_VALIDATE_SMARTPTR(instanceOperationCollectionVal);
const SmartPtrCXmlElement instanceOperationCollectionXml =
thisXml->createAndAddElement("instanceOperationCollection");
InstanceOperationCollectionXml::add(instanceOperationCollectionVal, instanceOperationCollectionXml);
}
CAF_CM_EXIT;
}
示例7: CAF_CM_FUNCNAME
SmartPtrCXmlElement CConfigProvider::findXmlElement(
const std::deque<std::string>& keyPathCollection,
const SmartPtrCXmlElement& rootXml) const {
CAF_CM_FUNCNAME("findXmlElement");
SmartPtrCXmlElement xmlRc;
CAF_CM_ENTER {
CAF_CM_VALIDATE_STL(keyPathCollection);
CAF_CM_VALIDATE_SMARTPTR(rootXml);
xmlRc = rootXml;
for (std::deque<std::string>::const_iterator keyPathIter = keyPathCollection.begin();
keyPathIter != keyPathCollection.end();
keyPathIter++) {
const std::string keyPath = *keyPathIter;
if (keyPathIter == keyPathCollection.begin()) {
if (xmlRc->getName().compare(keyPath) != 0) {
CAF_CM_EXCEPTIONEX_VA2(NoSuchElementException, ERROR_NOT_FOUND,
"Root element does not match - %s != %s", keyPath.c_str(), xmlRc->getName().c_str());
}
} else {
xmlRc = xmlRc->findRequiredChild(keyPath);
}
}
}
CAF_CM_EXIT;
return xmlRc;
}
示例8: parse
SmartPtrCLoggingLevelElemDoc LoggingLevelElemXml::parse(
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("LoggingLevelElemXml", "parse");
SmartPtrCLoggingLevelElemDoc loggingLevelElemDoc;
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string componentStrVal =
thisXml->findRequiredAttribute("component");
LOGGINGCOMPONENT_TYPE componentVal = LOGGINGCOMPONENT_NONE;
if (! componentStrVal.empty()) {
componentVal = EnumConvertersXml::convertStringToLoggingComponentType(componentStrVal);
}
const std::string levelStrVal =
thisXml->findRequiredAttribute("level");
LOGGINGLEVEL_TYPE levelVal = LOGGINGLEVEL_NONE;
if (! levelStrVal.empty()) {
levelVal = EnumConvertersXml::convertStringToLoggingLevelType(levelStrVal);
}
loggingLevelElemDoc.CreateInstance();
loggingLevelElemDoc->initialize(
componentVal,
levelVal);
}
CAF_CM_EXIT;
return loggingLevelElemDoc;
}
示例9: parse
SmartPtrCEventKeyDoc EventKeyXml::parse(
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("EventKeyXml", "parse");
SmartPtrCEventKeyDoc eventKeyDoc;
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string nameStrVal =
thisXml->findRequiredAttribute("name");
const std::string nameVal = nameStrVal;
const std::string valueStrVal =
thisXml->findRequiredAttribute("value");
const std::string valueVal = valueStrVal;
eventKeyDoc.CreateInstance();
eventKeyDoc->initialize(
nameVal,
valueVal);
}
CAF_CM_EXIT;
return eventKeyDoc;
}
示例10: CAF_CM_STATIC_FUNC_VALIDATE
SmartPtrCCmdlMetadataDoc CmdlMetadataXml::parse(
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("CmdlMetadataXml", "parse");
SmartPtrCCmdlMetadataDoc cmdlMetadataDoc;
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string nameStrVal =
thisXml->findRequiredAttribute("name");
const std::string nameVal = nameStrVal;
const SmartPtrCXmlElement valueXml =
thisXml->findRequiredChild("value");
std::string valueVal;
if (! valueXml.IsNull()) {
valueVal = valueXml->getValue();
}
cmdlMetadataDoc.CreateInstance();
cmdlMetadataDoc->initialize(
nameVal,
valueVal);
}
CAF_CM_EXIT;
return cmdlMetadataDoc;
}
示例11: CAF_CM_STATIC_FUNC_VALIDATE
void DiagDeleteValueXml::add(
const SmartPtrCDiagDeleteValueDoc diagDeleteValueDoc,
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("DiagDeleteValueXml", "add");
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(diagDeleteValueDoc);
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string jobIdVal =
BasePlatform::UuidToString(diagDeleteValueDoc->getJobId());
CAF_CM_VALIDATE_STRING(jobIdVal);
thisXml->addAttribute("jobId", jobIdVal);
const std::string fileAliasVal = diagDeleteValueDoc->getFileAlias();
CAF_CM_VALIDATE_STRING(fileAliasVal);
thisXml->addAttribute("fileAlias", fileAliasVal);
const std::string valueNameVal =
diagDeleteValueDoc->getValueName();
CAF_CM_VALIDATE_STRING(valueNameVal);
const SmartPtrCXmlElement valueNameXml =
thisXml->createAndAddElement("valueName");
valueNameXml->setValue(valueNameVal);
}
CAF_CM_EXIT;
}
示例12: CAF_CM_STATIC_FUNC_VALIDATE
SmartPtrCInstallProviderSpecDoc InstallProviderSpecXml::parse(
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("InstallProviderSpecXml", "parse");
SmartPtrCInstallProviderSpecDoc installProviderSpecDoc;
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string clientIdStrVal =
thisXml->findRequiredAttribute("clientId");
UUID clientIdVal = CAFCOMMON_GUID_NULL;
if (! clientIdStrVal.empty()) {
BasePlatform::UuidFromString(clientIdStrVal.c_str(), clientIdVal);
}
const std::string providerNamespaceStrVal =
thisXml->findRequiredAttribute("providerNamespace");
const std::string providerNamespaceVal = providerNamespaceStrVal;
const std::string providerNameStrVal =
thisXml->findRequiredAttribute("providerName");
const std::string providerNameVal = providerNameStrVal;
const std::string providerVersionStrVal =
thisXml->findRequiredAttribute("providerVersion");
const std::string providerVersionVal = providerVersionStrVal;
const CXmlElement::SmartPtrCElementCollection packageValChildrenXml =
thisXml->findRequiredChildren("package");
std::deque<SmartPtrCMinPackageElemDoc> packageValVal;
if (! packageValChildrenXml.IsNull() && ! packageValChildrenXml->empty()) {
for (TConstIterator<CXmlElement::CElementCollection> packageValXmlIter(*packageValChildrenXml);
packageValXmlIter; packageValXmlIter++) {
const SmartPtrCXmlElement packageValXml = packageValXmlIter->second;
const SmartPtrCMinPackageElemDoc packageValDoc =
MinPackageElemXml::parse(packageValXml);
packageValVal.push_back(packageValDoc);
}
}
installProviderSpecDoc.CreateInstance();
installProviderSpecDoc->initialize(
clientIdVal,
providerNamespaceVal,
providerNameVal,
providerVersionVal,
packageValVal);
}
CAF_CM_EXIT;
return installProviderSpecDoc;
}
示例13: CAF_CM_STATIC_FUNC_VALIDATE
SmartPtrCErrorResponseDoc ErrorResponseXml::parse(
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("ErrorResponseXml", "parse");
SmartPtrCErrorResponseDoc errorResponseDoc;
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string clientIdStrVal =
thisXml->findOptionalAttribute("clientId");
UUID clientIdVal = CAFCOMMON_GUID_NULL;
if (! clientIdStrVal.empty()) {
BasePlatform::UuidFromString(clientIdStrVal.c_str(), clientIdVal);
}
const std::string requestIdStrVal =
thisXml->findOptionalAttribute("requestId");
UUID requestIdVal = CAFCOMMON_GUID_NULL;
if (! requestIdStrVal.empty()) {
BasePlatform::UuidFromString(requestIdStrVal.c_str(), requestIdVal);
}
const std::string pmeIdVal =
thisXml->findOptionalAttribute("pmeId");
const SmartPtrCXmlElement responseHeaderXml =
thisXml->findOptionalChild("responseHeader");
SmartPtrCResponseHeaderDoc responseHeaderVal;
if (! responseHeaderXml.IsNull()) {
responseHeaderVal = ResponseHeaderXml::parse(responseHeaderXml);
}
const SmartPtrCXmlElement errorMessageXml =
thisXml->findOptionalChild("errorMessage");
std::string errorMessageVal;
if (! errorMessageXml.IsNull()) {
errorMessageVal = errorMessageXml->getValue();
}
errorResponseDoc.CreateInstance();
errorResponseDoc->initialize(
clientIdVal,
requestIdVal,
pmeIdVal,
responseHeaderVal,
errorMessageVal);
}
CAF_CM_EXIT;
return errorResponseDoc;
}
示例14: CAF_CM_STATIC_FUNC_VALIDATE
std::string XmlRoots::savePersistenceToString(
const SmartPtrCPersistenceDoc persistenceDoc) {
CAF_CM_STATIC_FUNC_VALIDATE("XmlRoots", "savePersistenceToString");
CAF_CM_VALIDATE_SMARTPTR(persistenceDoc);
const std::string schemaNamespace = DocXmlUtils::getSchemaNamespace("fx");
const std::string schemaLocation = DocXmlUtils::getSchemaLocation("fx/Persistence.xsd");
const SmartPtrCXmlElement rootXml = CXmlUtils::createRootElement(
"persistence", schemaNamespace, schemaLocation);
PersistenceXml::add(persistenceDoc, rootXml);
return rootXml->saveToString();
}
示例15: CAF_CM_STATIC_FUNC_VALIDATE
SmartPtrCDiagRequestDoc DiagRequestXml::parse(
const SmartPtrCXmlElement thisXml) {
CAF_CM_STATIC_FUNC_VALIDATE("DiagRequestXml", "parse");
SmartPtrCDiagRequestDoc diagRequestDoc;
CAF_CM_ENTER {
CAF_CM_VALIDATE_SMARTPTR(thisXml);
const std::string clientIdStrVal =
thisXml->findRequiredAttribute("clientId");
UUID clientIdVal = CAFCOMMON_GUID_NULL;
if (! clientIdStrVal.empty()) {
BasePlatform::UuidFromString(clientIdStrVal.c_str(), clientIdVal);
}
const std::string requestIdStrVal =
thisXml->findRequiredAttribute("requestId");
UUID requestIdVal = CAFCOMMON_GUID_NULL;
if (! requestIdStrVal.empty()) {
BasePlatform::UuidFromString(requestIdStrVal.c_str(), requestIdVal);
}
const std::string pmeIdVal =
thisXml->findRequiredAttribute("pmeId");
const SmartPtrCXmlElement requestHeaderXml =
thisXml->findRequiredChild("requestHeader");
SmartPtrCRequestHeaderDoc requestHeaderVal;
if (! requestHeaderXml.IsNull()) {
requestHeaderVal = RequestHeaderXml::parse(requestHeaderXml);
}
const SmartPtrCXmlElement batchXml =
thisXml->findRequiredChild("batch");
SmartPtrCDiagBatchDoc batchVal;
if (! batchXml.IsNull()) {
batchVal = DiagBatchXml::parse(batchXml);
}
diagRequestDoc.CreateInstance();
diagRequestDoc->initialize(
clientIdVal,
requestIdVal,
pmeIdVal,
requestHeaderVal,
batchVal);
}
CAF_CM_EXIT;
return diagRequestDoc;
}