Changeset 226 for trunk/lib/File.cc


Ignore:
Timestamp:
Mar 11, 2007, 8:32:41 PM (15 years ago)
Author:
Peter Johansson
Message:

added reading of config file in Parameter closes ##106 and #98. Move function check_target from svndigest.cc to utility.cc and changed name to node_exist. added support for aliases in Copyright update refs #36

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/File.cc

    r225 r226  
    3232#include <fstream>
    3333#include <iostream>
     34#include <map>
    3435#include <string>
    3536
     
    153154
    154155
    155   void File::print_copyright(const std::vector<std::string>& dates,
    156                              const std::vector<std::string>& authors) const
     156  void File::print_copyright
     157  (const std::vector<std::string>& dates,
     158   const std::vector<std::string>& authors,
     159   const std::map<std::string, std::string>& alias) const
    157160  {
    158161    if (ignore())
     
    160163    assert(dates.size()==authors.size());
    161164    using namespace std;
     165    cout << "Copyright: " << local_path() << std::endl;
    162166    SVN* svn=SVN::instance();
    163167    vector<size_t> rev=svn->revisions(path());
     
    169173      time_t sec = str2time(dates[*i]);
    170174      tm* timeinfo = gmtime(&sec);
    171       copyright[timeinfo->tm_year].insert(authors[*i]);
     175
     176      // find username in map of aliases
     177      map<string, string>::const_iterator name = alias.find(authors[*i]);
     178      // if alias exist insert alias
     179      if (name != alias.begin() )
     180        copyright[timeinfo->tm_year].insert(name->second);
     181      else
     182        // else insert user name
     183        copyright[timeinfo->tm_year].insert(authors[*i]);
    172184    }
    173185   
Note: See TracChangeset for help on using the changeset viewer.