Changeset 13669 for trunk/FACT++
- Timestamp:
- 05/12/12 12:36:50 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Configuration.cc
r13005 r13669 1367 1367 1368 1368 size_t max = 0; 1369 for ( map<string,string>::const_iteratorit=fWildcardOptions.begin(); it!=fWildcardOptions.end(); it++)1369 for (auto it=fWildcardOptions.begin(); it!=fWildcardOptions.end(); it++) 1370 1370 if (it->second.length()>max) 1371 1371 max = it->second.length(); 1372 1372 1373 1373 cout.setf(ios_base::left); 1374 for ( map<string,string>::const_iteratorit=fWildcardOptions.begin(); it!=fWildcardOptions.end(); it++)1374 for (auto it=fWildcardOptions.begin(); it!=fWildcardOptions.end(); it++) 1375 1375 cout << setw(max+1) << it->second << " : " << it->first <<endl; 1376 } 1377 1378 const vector<string> Configuration::GetWildcardOptions(const std::string &opt) const 1379 { 1380 vector<string> rc; 1381 1382 for (auto it=fWildcardOptions.begin(); it!=fWildcardOptions.end(); it++) 1383 { 1384 if (it->second == opt) 1385 rc.push_back(it->first); 1386 } 1387 1388 return rc; 1376 1389 } 1377 1390 -
trunk/FACT++/src/Configuration.h
r13005 r13669 120 120 121 121 const std::map<std::string,std::string> &GetWildcardOptions() const { return fWildcardOptions; } 122 const std::vector<std::string> GetWildcardOptions(const std::string &opt) const; 123 124 template<class T> 125 const std::map<std::string,T> GetOptions(const std::string &opt) 126 { 127 const std::vector<std::string> rc = GetWildcardOptions(opt+'*'); 128 129 std::map<std::string,T> map; 130 for (auto it=rc.begin(); it!=rc.end(); it++) 131 map[it->substr(opt.length())] = Get<T>(*it); 132 133 return map; 134 } 122 135 123 136 std::multimap<std::string, std::string> GetOptions() const;
Note:
See TracChangeset
for help on using the changeset viewer.