本文整理汇总了C++中AttributeMap::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ AttributeMap::clear方法的具体用法?C++ AttributeMap::clear怎么用?C++ AttributeMap::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttributeMap
的用法示例。
在下文中一共展示了AttributeMap::clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetContent
// This sets the various recording data to the values they should have
// before reading in some text.
inline void RestrictedXmlParser::ResetContent()
{
fileProlog.assign( "" );
rootName.assign( "" );
rootAttributes.clear();
currentName.assign( "" );
currentAttributes.clear();
currentBody.assign( "" );
currentElementIsEmpty = true;
}
示例2: while
vector<AttributeMap> Ldap::search(string base, int scope, string filter, const StringList& attribs) {
if(bound == false) {
return vector<AttributeMap>();
}
LDAPSearchResults* lr = lc->search(base, scope, filter,attribs, false);
LDAPEntry* le;
const LDAPAttribute* la;
StringList s;
vector<AttributeMap> result;
AttributeMap temp;
int i = 0;
while( (le = lr->getNext()) ) {
for(StringList::const_iterator
it =attribs.begin();
it!=attribs.end();
it++)
{
//cout << endl << "Name: " << *it << " |";
la = le->getAttributeByName(*it);
if(la == NULL) continue;
s = la->getValues();
for(StringList::const_iterator
st = s.begin();
st != s.end();
st ++)
{
// concatenates multivalues with |
temp[*it] += (i>0?"|"+*st:*st);
i++;
}
i=0;
}
//cout << endl;
if(temp.size() > 0) {
result.push_back(temp);
temp.clear();
}
}
return result;
}
示例3: ReadNextElement
// This moves forward in the current content to parse until the next
// element start tag is found, then that element is read in until its end
// tag is found, and the character just after that is where the next call
// of this function will resume. The element just parsed is accessible
// through CurrentName() for its name, CurrentAttributes() for its
// attributes, and CurrentBody() for the text between the start and end
// tags. The return value is true if an element was read in, or false if no
// more valid elements could be found. (If no further elements are
// found, the next call of this function will do nothing, as the next
// character will just be the EOF character.)
inline bool RestrictedXmlParser::ReadNextElement()
{
if( ReadToNextTagOpener( NULL ) )
{
currentName.assign( "" );
currentAttributes.clear();
currentBody.assign( "" );
currentElementIsEmpty = true;
ReadStartTag( currentName,
¤tAttributes,
NULL );
if( !currentElementIsEmpty )
{
RecordToEndOfElement( currentName );
}
return true;
}
return false;
}