Changeset 1459


Ignore:
Timestamp:
Jan 9, 2012, 3:49:37 AM (11 years ago)
Author:
Peter Johansson
Message:

quote consistently. update release year

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/.release_year

    r1323 r1459  
    1 2011
     12012
  • trunk/lib/Configuration.cc

    r1442 r1459  
    5353
    5454
    55   void Configuration::add_codon(std::string key, std::string start, 
     55  void Configuration::add_codon(std::string key, std::string start,
    5656                                std::string end)
    5757  {
     
    6262      if (i->first == key)
    6363        iter = i;
    64    
     64
    6565    if (iter==string2codons_.end())
    6666      string2codons_.push_back(std::make_pair(key, VectorPair(1,p)));
     
    8989  {
    9090    std::ostringstream ss;
    91     if (const std::vector<std::pair<std::string, std::string> >* 
     91    if (const std::vector<std::pair<std::string, std::string> >*
    9292        codons = codon(path)) {
    9393      using std::string;
    9494      typedef std::vector<std::pair<string, string> >::const_iterator citerator;
    95       for ( citerator codon=codons->begin(); codon!=codons->end(); ++codon) 
     95      for ( citerator codon=codons->begin(); codon!=codons->end(); ++codon)
    9696        ss << codon->first << codon->second;
    9797    }
     
    105105    return result;
    106106  }
    107  
    108 
    109   const std::vector<std::pair<std::string, std::string> >* 
    110   Configuration::codon(std::string file_name) const 
     107
     108
     109  const std::vector<std::pair<std::string, std::string> >*
     110  Configuration::codon(std::string file_name) const
    111111  {
    112112    if (const std::pair<std::string,std::string>* dict=dictionary(file_name))
     
    132132  }
    133133
    134   const std::pair<std::string,std::string>* 
     134  const std::pair<std::string,std::string>*
    135135  Configuration::dictionary(std::string lhs) const
    136136  {
     
    204204      }
    205205      if (section == "copyright-alias"){
    206         std::map<std::string,Alias>::iterator iter = 
     206        std::map<std::string,Alias>::iterator iter =
    207207          copyright_alias_.lower_bound(lhs);
    208208        if (iter!=copyright_alias_.end() && iter->first==lhs){
     
    211211          throw Config_error(line, mess.str());
    212212        }
    213        
     213
    214214        // insert alias
    215215        copyright_alias_.insert(iter,std::make_pair(lhs, Alias(rhs,copyright_alias_.size())));
     
    246246          tab_size_ = strtoul(rhs.c_str(), NULL, 10);
    247247          if (tab_size_==0) {
    248             throw Config_error(line, 
     248            throw Config_error(line,
    249249                       "invalid value: tab-size must be a positive integer");
    250250          }
     
    277277        }
    278278        author_color_[lhs] = rhs;
    279       }     
     279      }
    280280      else if (section == "parsing-codons") {
    281281        if (!parsing_found) {
     
    284284          string2codons_.clear();
    285285        }
    286        
     286
    287287        if (codon(lhs)) {
    288288          std::stringstream mess;
     
    292292               i!=string2codons_.end(); ++i) {
    293293            if (fnmatch(lhs.c_str(), i->first.c_str())) {
    294               mess << "`" << i->first << "'";
     294              mess << "'" << i->first << "'";
    295295              break;
    296296            }
     
    313313            else if (start.size()<3) {
    314314              std::stringstream mess;
    315               mess << "start-code `" << start << "' is invalid";
     315              mess << "start-code '" << start << "' is invalid";
    316316              throw std::runtime_error(mess.str());
    317317            }
     
    322322            else if (end.size()<3) {
    323323              std::stringstream mess;
    324               mess << "end-code `" << end << "' is invalid";
     324              mess << "end-code '" << end << "' is invalid";
    325325              throw std::runtime_error(mess.str());
    326326            }
     
    334334          add_codon(lhs, start, end);
    335335        }
    336       } 
     336      }
    337337      else if (section == "file-name-dictionary") {
    338338        if (!dictionary_found) {
     
    341341          dictionary_.clear();
    342342        }
    343        
     343
    344344        if (const std::pair<std::string, std::string>* entry=dictionary(lhs)) {
    345345          std::stringstream mess;
    346346          mess << "clashes with previous given file name pattern: "
    347                << "`" << entry->first << "'";
     347               << "'" << entry->first << "'";
    348348          throw Config_error(line, mess.str());
    349349        }
    350350        lhs = trim(lhs);
    351351        rhs = trim(rhs);
    352         if (!lhs.empty() && !rhs.empty()) 
     352        if (!lhs.empty() && !rhs.empty())
    353353          dictionary_.push_back(std::make_pair(lhs, rhs));
    354354        else if (!lhs.empty() || !rhs.empty()) {
    355355          throw Config_error(line, "");
    356356        }
    357       } 
     357      }
    358358      else if (section == "svn-props") {
    359359        svn_props_.push_back(std::make_pair(lhs, empty_str_map_));
     
    376376          }
    377377          catch (std::runtime_error e) {
    378             throw Config_error(line, 
     378            throw Config_error(line,
    379379                               "unknown format: " + rhs + "\n" + e.what());
    380380          }
     
    385385          }
    386386          catch (std::runtime_error e) {
    387             throw Config_error(line, 
     387            throw Config_error(line,
    388388                               "unknown format: " + rhs + "\n" + e.what());
    389389          }
     
    400400      std::ostringstream oss;
    401401      oss << "Valid arguments are:\n"
    402           << "  - `none'\n"
    403           << "  - `pdf'\n"
    404           << "  - `png'\n"
    405           << "  - `svg'";
     402          << "  - 'none'\n"
     403          << "  - 'pdf'\n"
     404          << "  - 'png'\n"
     405          << "  - 'svg'";
    406406      throw std::runtime_error(oss.str());
    407407    }
     
    415415      std::ostringstream oss;
    416416      oss << "Valid arguments are:\n"
    417           << "  - `none'\n"
    418           << "  - `png'\n"
    419           << "  - `svg'";
     417          << "  - 'none'\n"
     418          << "  - 'png'\n"
     419          << "  - 'svg'";
    420420      throw std::runtime_error(oss.str());
    421421    }
     
    440440
    441441
    442   std::string 
     442  std::string
    443443  Configuration::translate(const std::string& str,
    444444                           const std::pair<std::string, std::string>& dic) const
     
    450450      mess << "invalid config file: "
    451451           << "expression " << dic.first << " is invalid";
    452       throw std::runtime_error(mess.str());       
    453     }
    454     for (std::string::const_iterator i(dic.second.begin()); 
     452      throw std::runtime_error(mess.str());
     453    }
     454    for (std::string::const_iterator i(dic.second.begin());
    455455         i!=dic.second.end(); ++i) {
    456456      if (*i == '$') {
     
    464464          if (n)
    465465            mess << "because " << n << " is a too large.";
    466           throw std::runtime_error(mess.str());       
     466          throw std::runtime_error(mess.str());
    467467        }
    468468        res += vec[n-1];
     
    494494  {
    495495    if (str.size()>0 && str[0]=='\n')
    496       return std::string("\\n") + str.substr(1); 
     496      return std::string("\\n") + str.substr(1);
    497497    return str;
    498498  }
     
    503503    if (str.size()<2 || str[0]!=c || str[str.size()-1]!=c){
    504504      std::stringstream mess;
    505       mess << "expected `" << str << "' to be surrounded by `" << c << "'";
     505      mess << "expected '" << str << "' to be surrounded by '" << c << "'";
    506506      throw std::runtime_error(mess.str());
    507507    }
     
    587587  Configuration::svn_properties(const std::string& filename) const
    588588  {
    589     // reverse backwards as we prefer to to pick properties defined later 
    590     std::vector<props>::const_reverse_iterator iter = 
     589    // reverse backwards as we prefer to to pick properties defined later
     590    std::vector<props>::const_reverse_iterator iter =
    591591      find_fn(svn_props_.rbegin(), svn_props_.rend(), filename);
    592592    if (iter==svn_props_.rend())
     
    657657      os << "no\n";
    658658    os << "# defining start of copyright statement\n";
    659     os << "copyright-string = " << conf.copyright_string_ << "\n"; 
     659    os << "copyright-string = " << conf.copyright_string_ << "\n";
    660660
    661661    os << "\n"
     
    674674    PairSecondCompare<const std::string, Alias, IdCompare> comp(id);
    675675    std::sort(vec.begin(),vec.end(), comp);
    676              
     676
    677677
    678678    for (vector::const_iterator i(vec.begin()); i!=vec.end(); ++i) {
     
    704704       << "[svn-props]\n";
    705705    os << "# COPYING = svndigest:ignore\n";
    706     std::vector<props>::const_iterator p=conf.svn_props_.begin(); 
     706    std::vector<props>::const_iterator p=conf.svn_props_.begin();
    707707    for ( ; p!=conf.svn_props_.end(); ++p) {
    708708      os << p->first << " = ";
     
    729729    os << "\n"
    730730       << "### Section for setting dictionary for file names.\n"
    731        << "### Prior looking for file name pattern in section " 
     731       << "### Prior looking for file name pattern in section "
    732732       << "[parsing-codons],\n"
    733733       << "### the file name may be translated according to the rules \n"
    734734       << "### in this section. In default setting there is, for example,\n"
    735        << "### a rule to translate `<FILENAME>.in' to `<FILENAME>'.\n"
     735       << "### a rule to translate '<FILENAME>.in' to '<FILENAME>'.\n"
    736736       << "### The format of the entries is:\n"
    737737       << "###    file-name-pattern = new-name\n"
     
    741741    os << "[file-name-dictionary]\n";
    742742    for (size_t i=0; i<conf.dictionary_.size(); ++i)
    743       os << conf.dictionary_[i].first << " = " 
    744          << conf.dictionary_[i].second << "\n"; 
     743      os << conf.dictionary_[i].first << " = "
     744         << conf.dictionary_[i].second << "\n";
    745745
    746746    if (!conf.string2codons_.empty()) {
     
    755755         << "[parsing-codons]\n";
    756756      for (size_t i=0; i<conf.string2codons_.size(); ++i) {
    757         os << conf.string2codons_[i].first << " = "; 
     757        os << conf.string2codons_[i].first << " = ";
    758758        for (size_t j=0; j<conf.string2codons_[i].second.size(); ++j) {
    759759          if (j)
    760760            os << "  ;  ";
    761           os << "\"" << trans_beg_code(conf.string2codons_[i].second[j].first) 
    762              << "\":\"" 
    763              << trans_end_code(conf.string2codons_[i].second[j].second) 
    764              << "\""; 
     761          os << "\"" << trans_beg_code(conf.string2codons_[i].second[j].first)
     762             << "\":\""
     763             << trans_end_code(conf.string2codons_[i].second[j].second)
     764             << "\"";
    765765        }
    766766        os << "\n";
     
    770770  }
    771771
    772  
     772
    773773  Config_error::Config_error(const std::string& line,const std::string& message)
    774     : std::runtime_error(std::string("line: `") + line +
     774    : std::runtime_error(std::string("line: '") + line +
    775775                         std::string("' is invalid.\n") + message)
    776776  {}
  • trunk/lib/CopyrightVisitor.cc

    r1457 r1459  
    140140    if (!detect_copyright(file.path(),old_block, start_line, end_line, prefix)){
    141141      if (Configuration::instance().missing_copyright_warning())
    142         std::cerr << "svncopyright: warning: no copyright statement found in `"
     142        std::cerr << "svncopyright: warning: no copyright statement found in '"
    143143                  << file.path() << "'\n";
    144144      return;
     
    231231      // if alias not found for author
    232232      if (i==alias_.end()) {
    233         std::cerr << "svncopyright: warning: no copyright alias found for `"
     233        std::cerr << "svncopyright: warning: no copyright alias found for '"
    234234                  << *user << "'\n";
    235235        // insert alias to avoid multiple warnings.
  • trunk/lib/main_utility.cc

    r1430 r1459  
    4747      assert(is.good());
    4848      if (verbose)
    49         std::cout << "Reading configuration file: `" << file << "'\n";
     49        std::cout << "Reading configuration file: '" << file << "'\n";
    5050      try {
    5151        config.load(is);
  • trunk/lib/utility.cc

    r1439 r1459  
    214214    if (code){
    215215      std::stringstream ss;
    216       ss << "mkdir: `" << dir << "': ";
     216      ss << "mkdir: '" << dir << "': ";
    217217      throw yat::utility::errno_error(ss.str());
    218218    }
Note: See TracChangeset for help on using the changeset viewer.