Changeset 1227


Ignore:
Timestamp:
Oct 17, 2010, 11:16:13 PM (13 years ago)
Author:
Peter Johansson
Message:

refs #476 and #385. Move parsing to CopyrightVisitor?. Only parse Files because Directories have no copyrigt to update.

Location:
branches/visitor
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/visitor/bin/svncopyright.cc

    r1119 r1227  
    6767    Directory tree(0,option.root(),"");
    6868
    69     if (option.verbose())
    70       std::cout << "Parsing directory tree" << std::endl;
    71     tree.parse(option.verbose(), option.ignore_cache());
    72     update_copyright(tree, option.verbose());
     69    update_copyright(tree, option.verbose(), option.ignore_cache());
    7370  }
    7471  catch (std::runtime_error& e) {
  • branches/visitor/lib/CopyrightVisitor.cc

    r1225 r1227  
    3131  CopyrightVisitor::CopyrightVisitor(std::map<std::string, Alias>& alias,
    3232                                     bool verbose,
    33                                      const std::map<int,svn_revnum_t>& year2rev)
    34     : NodeVisitor(), alias_(alias), verbose_(verbose), year2rev_(year2rev)
     33                                     const std::map<int,svn_revnum_t>& year2rev,
     34                                     bool ignore_cache)
     35    : NodeVisitor(), alias_(alias), verbose_(verbose), year2rev_(year2rev),
     36      ignore_cache_(ignore_cache)
    3537  {}
    3638
     
    5153  void CopyrightVisitor::visit(File& file)
    5254  {
     55    file.parse(verbose_, ignore_cache_);
    5356    file.print_copyright(alias_, verbose_, year2rev_);
    5457  }
  • branches/visitor/lib/CopyrightVisitor.h

    r1225 r1227  
    4242  public:
    4343    CopyrightVisitor(std::map<std::string, Alias>&, bool verbose,
    44                      const std::map<int, svn_revnum_t>& year2rev);
     44                     const std::map<int, svn_revnum_t>& year2rev,
     45                     bool ignore_cache);
    4546
    4647    /**
     
    6162    bool verbose_;
    6263    const std::map<int, svn_revnum_t>& year2rev_;
     64    bool ignore_cache_;
    6365  };
    6466}} // end of namespace svndigest and namespace theplu
  • branches/visitor/lib/main_utility.cc

    r1225 r1227  
    5959
    6060
    61   void update_copyright(Node& tree, bool verbose)
     61  void update_copyright(Node& tree, bool verbose, bool ignore_cache)
    6262  {
    6363    if (verbose)
     
    7979    }
    8080
    81     CopyrightVisitor visitor(alias, verbose, year2rev);
     81    CopyrightVisitor visitor(alias, verbose, year2rev, ignore_cache);
    8282    tree.traverse(visitor);
    8383  }
  • branches/visitor/lib/main_utility.h

    r1225 r1227  
    4646     \brief update copyright statements in \a node
    4747   */
    48   void update_copyright(Node& node, bool verbose);
     48  void update_copyright(Node& node, bool verbose, bool ignore_cache);
    4949
    5050}} // end of namespace svndigest end of namespace theplu
Note: See TracChangeset for help on using the changeset viewer.