本文整理汇总了C++中memberlist::iterator::get方法的典型用法代码示例。如果您正苦于以下问题:C++ iterator::get方法的具体用法?C++ iterator::get怎么用?C++ iterator::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类memberlist::iterator
的用法示例。
在下文中一共展示了iterator::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get
bool ClassHandler::get(Core::BaseObject *obj, void *n) {
MemberNodeHandler *anyMemberHandler = NULL;
bool anyIsOptional = true;
for ( MemberList::iterator it = elements.begin();
it != elements.end(); ++it ) {
if ( it->tag == "" ) {
if ( anyMemberHandler == NULL ) {
anyMemberHandler = &*it;
anyIsOptional = it->optional;
}
}
else if ( equalsTag(n, it->tag.c_str(), it->nameSpace.c_str()) ) {
it->get(obj, n, this);
isOptional = it->optional;
memberHandler = &*it;
return true;
}
}
for ( MemberList::iterator it = childs.begin();
it != childs.end(); ++it ) {
if ( it->tag == "" ) {
if ( anyMemberHandler == NULL ) {
anyMemberHandler = &*it;
anyIsOptional = it->optional;
}
}
else if ( equalsTag(n, it->tag.c_str(), it->nameSpace.c_str()) ) {
it->get(obj, n, this);
isOptional = it->optional;
memberHandler = &*it;
return true;
}
}
if ( anyMemberHandler ) {
memberHandler = anyMemberHandler;
isOptional = anyIsOptional;
isAnyType = true;
return true;
}
return false;
}
示例2: init
bool ClassHandler::init(Core::BaseObject *obj, void *n, TagSet &mandatory) {
xmlNodePtr node = reinterpret_cast<xmlNodePtr>(n);
// Fill in mandatory tags
for ( MemberList::iterator it = attributes.begin();
it != attributes.end(); ++it ) {
if ( !it->optional ) mandatory.insert(it->tag);
}
for ( MemberList::iterator it = elements.begin();
it != elements.end(); ++it ) {
if ( !it->optional && !it->tag.empty() ) mandatory.insert(it->tag);
}
for ( MemberList::iterator it = childs.begin();
it != childs.end(); ++it ) {
if ( !it->optional && !it->tag.empty() ) mandatory.insert(it->tag);
}
if ( cdataUsed )
cdata.get(obj, n, this);
if ( attributes.empty() ) return true;
for ( xmlAttrPtr attr = node->properties; attr != NULL; attr = attr->next ) {
if ( attr->children ) {
for ( MemberList::iterator it = attributes.begin();
it != attributes.end(); ++it ) {
if ( equalsTag(attr, it->tag.c_str(), it->nameSpace.c_str()) ) {
if ( it->get(obj, attr, this) && !it->optional ) {
mandatory.erase(it->tag);
break;
}
}
}
}
}
return true;
}