本文整理汇总了C++中ConfigGroup::AppendConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigGroup::AppendConfig方法的具体用法?C++ ConfigGroup::AppendConfig怎么用?C++ ConfigGroup::AppendConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigGroup
的用法示例。
在下文中一共展示了ConfigGroup::AppendConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateOneElementGroups
void SzarpConfigs::CreateOneElementGroups(ConfigList* config_groups, ConfigNameHash& titles) {
for (ConfigNameHash::iterator i = titles.begin(); i != titles.end() ; ++i) {
const wxString& prefix = i->first;
ConfigGroup* confgroup = new ConfigGroup;
confgroup->AppendConfig(prefix, titles[prefix]);
confgroup->group_name = titles[prefix];
config_groups->push_back(confgroup);
}
}
示例2: CreateGroups
void SzarpConfigs::CreateGroups(ConfigList* result, MPW& prefix_map, ConfigNameHash &titles) {
for (MPW::iterator i = prefix_map.begin(); i != prefix_map.end(); ++i) {
const set<wxString>& prefixes = i->first;
set<wxString, NoCaseCmp>& words = i->second;
if (prefixes.size() <= 1)
continue;
set<wxString>::iterator j;
wxString title;
for (j = prefixes.begin(); j != prefixes.end(); j++) {
ConfigNameHash::iterator k = titles.find(*j);
if (k != titles.end()) {
title = k->second;
break;
}
}
if (j == prefixes.end())
continue;
ConfigGroup* confgroup = new ConfigGroup;
wxString& group_name = confgroup->group_name;
wxStringTokenizer tknz(title,
_T(" \t\r\n"),
wxTOKEN_STRTOK);
while (tknz.HasMoreTokens()) {
wxString token = tknz.GetNextToken();
if (words.find(token) != words.end())
group_name += token + _T(" ");
}
int prefix_count = 0;
for (set<wxString>::iterator k = prefixes.begin(); k != prefixes.end(); k++) {
ConfigNameHash::iterator l = titles.find(*k);
if (l == titles.end())
continue;
prefix_count++;
confgroup->AppendConfig(*k, l->second);
}
if (prefix_count <= 1) {
delete confgroup;
continue;
}
result->push_back(confgroup);
for (set<wxString>::iterator k = prefixes.begin(); k != prefixes.end(); k++) {
titles.erase(*k);
}
}
}