本文整理汇总了C++中PropertyPtr::SetPropertyIdentifier方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyPtr::SetPropertyIdentifier方法的具体用法?C++ PropertyPtr::SetPropertyIdentifier怎么用?C++ PropertyPtr::SetPropertyIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyPtr
的用法示例。
在下文中一共展示了PropertyPtr::SetPropertyIdentifier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseXML
bool SpineItem::ParseXML(SpineItemPtr& sharedMe, xmlNodePtr node)
{
SetXMLIdentifier(_getProp(node, "id"));
_idref = _getProp(node, "idref");
if ( _getProp(node, "linear").tolower() == "false" )
_linear = false;
auto holder = std::dynamic_pointer_cast<PropertyHolder>(sharedMe);
string properties = _getProp(node, "properties");
if ( !properties.empty() )
{
for ( auto& property : properties.split(REGEX_NS::regex(",?\\s+")) )
{
PropertyPtr prop = std::make_shared<Property>(holder);
prop->SetPropertyIdentifier(this->PropertyIRIFromString(property));
this->AddProperty(prop);
}
}
return true;
}
示例2: Unpack
//.........这里部分代码省略.........
continue;
}
PropertyPtr prop = std::dynamic_pointer_cast<Property>(found->second);
if ( prop )
{
// it's a property, so this is an extension
PropertyExtensionPtr extPtr = std::make_shared<PropertyExtension>(prop);
if ( extPtr->ParseMetaElement(node) )
prop->AddExtension(extPtr);
}
else
{
// not a property, so treat this as a plain property
shared_ptr<PropertyHolder> ptr = std::dynamic_pointer_cast<PropertyHolder>(found->second);
if ( ptr )
{
prop = std::make_shared<Property>(ptr);
if ( prop->ParseMetaElement(node) )
ptr->AddProperty(prop);
}
}
}
// now look at the <spine> element for properties
xmlNodePtr spineNode = xmlFirstElementChild(root);
for ( uint32_t i = 2; i < _spineCFIIndex; i += 2 )
spineNode = xmlNextElementSibling(spineNode);
string value = _getProp(spineNode, "page-progression-direction");
if ( !value.empty() )
{
PropertyPtr prop = std::make_shared<Property>(holderPtr);
prop->SetPropertyIdentifier(MakePropertyIRI("page-progression-direction"));
prop->SetValue(value);
AddProperty(prop);
}
}
catch (std::system_error& exc)
{
if ( metadataNodes != nullptr )
xmlXPathFreeNodeSet(metadataNodes);
if ( refineNodes != nullptr )
xmlXPathFreeNodeSet(refineNodes);
if ( exc.code().category() == epub_spec_category() )
throw;
return false;
}
catch (...)
{
if ( metadataNodes != nullptr )
xmlXPathFreeNodeSet(metadataNodes);
if ( refineNodes != nullptr )
xmlXPathFreeNodeSet(refineNodes);
return false;
}
xmlXPathFreeNodeSet(metadataNodes);
xmlXPathFreeNodeSet(refineNodes);
// now any content type bindings
xmlNodeSetPtr bindingNodes = nullptr;
try
{
bindingNodes = xpath.Nodes("/opf:package/opf:bindings/*");