本文整理汇总了C++中StringVector::add方法的典型用法代码示例。如果您正苦于以下问题:C++ StringVector::add方法的具体用法?C++ StringVector::add怎么用?C++ StringVector::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringVector
的用法示例。
在下文中一共展示了StringVector::add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: throw
void
checkForUnmatchedPatterns(
const Configuration * cfg,
const StringVector & namesList,
const StringVector & wildcardedNamesAndTypes,
StringVector & unmatchedPatterns) throw(ConfigurationException)
{
int i;
int len;
const char * wildcardedName;
unmatchedPatterns.empty();
//--------
// Check if there is a wildcarded name that does not match anything
//--------
len = wildcardedNamesAndTypes.length();
for (i = 0; i < len; i += 3) {
wildcardedName = wildcardedNamesAndTypes[i+1];
if (!doesPatternMatchAnyUnexpandedNameInList(cfg, wildcardedName,
namesList))
{
unmatchedPatterns.add(wildcardedName);
}
}
}
示例2:
void
ConfigScope::listLocalNames(
Configuration::Type typeMask,
StringVector & vec) const
{
int i;
int countWanted;
int countUnwanted;
ConfigScopeEntry * entry;
//--------
// Iterate over all the entries in the hash table and copy
// their names into the StringVector
//--------
vec.empty();
vec.ensureCapacity(m_numEntries);
countWanted = 0;
countUnwanted = 0;
for (i = 0; i < m_tableSize; i++) {
entry = m_table[i].m_next;
while (entry) {
if (entry->type() & typeMask) {
vec.add(entry->name());
countWanted++;
} else {
countUnwanted++;
}
entry = entry->m_next;
}
}
assert(countWanted + countUnwanted == m_numEntries);
}
示例3: listFilter
void
ConfigScope::listScopedNamesHelper(
const char * prefix,
Configuration::Type typeMask,
bool recursive,
const StringVector & filterPatterns,
StringVector & vec) const
{
int i;
ConfigScopeEntry * entry;
StringBuffer scopedName;
//--------
// Iterate over all the entries in the hash table and copy
// their locally-scoped names into the StringVector
//--------
vec.ensureCapacity(vec.length() + m_numEntries);
for (i = 0; i < m_tableSize; i++) {
entry = m_table[i].m_next;
while (entry) {
scopedName = prefix;
if (prefix[0] != '\0') {
scopedName.append(".");
}
scopedName.append(entry->name());
if ((entry->type() & typeMask)
&& listFilter(scopedName.c_str(), filterPatterns))
{
vec.add(scopedName);
}
if (recursive && entry->type() == Configuration::CFG_SCOPE) {
entry->item()->scopeVal()->listScopedNamesHelper(
scopedName.c_str(), typeMask,
true, filterPatterns, vec);
}
entry = entry->m_next;
}
}
}