本文整理汇总了C++中common::StringMap::setVal方法的典型用法代码示例。如果您正苦于以下问题:C++ StringMap::setVal方法的具体用法?C++ StringMap::setVal怎么用?C++ StringMap::setVal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::StringMap
的用法示例。
在下文中一共展示了StringMap::setVal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildMap
bool Databases::buildMap(const dBase &db, Common::StringMap &map) const {
int fLanguage = findField(db, "Langage", dBase::kTypeString);
int fGroup = findField(db, "Nom" , dBase::kTypeString);
int fSection = findField(db, "Section", dBase::kTypeString);
int fKeyword = findField(db, "Motcle" , dBase::kTypeString);
int fText = findField(db, "Texte" , dBase::kTypeString);
if ((fLanguage < 0) || (fGroup < 0) || (fSection < 0) || (fKeyword < 0) || (fText < 0))
return false;
const Common::Array<dBase::Record> &records = db.getRecords();
Common::Array<dBase::Record>::const_iterator record;
for (record = records.begin(); record != records.end(); ++record) {
Common::String key;
key += db.getString(*record, fLanguage) + ":";
key += db.getString(*record, fGroup ) + ":";
key += db.getString(*record, fSection ) + ":";
key += db.getString(*record, fKeyword );
map.setVal(key, db.getString(*record, fText));
}
return true;
}