Changeset 1052 for trunk/lib/Configuration.cc
- Timestamp:
- Apr 18, 2010, 4:39:57 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Configuration.cc
r1038 r1052 83 83 Configuration::codon(std::string file_name) const 84 84 { 85 std::cout << "file_name: " << file_name << std::endl; 85 86 if (const std::pair<std::string,std::string>* dict=dictionary(file_name)) 86 87 file_name = translate(file_name, *dict); 87 88 for (String2Codons::const_iterator i(string2codons_.begin()); 88 89 i!=string2codons_.end(); ++i) { 89 if (svndigest::equal(file_name.begin(), file_name.end(), 90 i->first.begin(), i->first.end()) ) { 90 if (fnmatch(i->first.c_str(), file_name.c_str())) 91 91 return &i->second; 92 }93 92 } 94 93 return NULL; … … 106 105 { 107 106 for (size_t i=0; i<dictionary_.size(); ++i) 108 if (svndigest::equal(lhs.begin(), lhs.end(), 109 dictionary_[i].first.begin(), 110 dictionary_[i].first.end())) 107 if (fnmatch(lhs.c_str(), dictionary_[i].first.c_str())) 111 108 return &dictionary_[i]; 112 109 return NULL; … … 230 227 for (String2Codons::const_iterator i(string2codons_.begin()); 231 228 i!=string2codons_.end(); ++i) { 232 if (svndigest::equal(lhs.begin(), lhs.end(), 233 i->first.begin(), i->first.end()) ) { 229 if (fnmatch(lhs.c_str(), i->first.c_str())) { 234 230 mess << "`" << i->first << "'"; 235 231 break; … … 370 366 const std::pair<std::string, std::string>& dic) const 371 367 { 372 assert(svndigest::equal(str.begin(), str.end(),373 dic.first.begin(), dic.first.end()));374 368 std::string res; 375 369 std::vector<std::string> vec; 376 regexp(str.begin(), str.end(), dic.first.begin(), dic.first.end(), vec); 370 if (!regexp(str.begin(), str.end(), dic.first.begin(),dic.first.end(),vec)){ 371 std::stringstream mess; 372 mess << "svndigest: invalid config file: " 373 << "expression " << dic.first << " is invalid"; 374 throw std::runtime_error(mess.str()); 375 } 377 376 for (std::string::const_iterator i(dic.second.begin()); 378 377 i!=dic.second.end(); ++i) { … … 387 386 if (n) 388 387 mess << "because " << n << " is a too large."; 389 throw std::runtime_error( "");388 throw std::runtime_error(mess.str()); 390 389 } 391 390 res += vec[n-1];
Note: See TracChangeset
for help on using the changeset viewer.