Ignore:
Timestamp:
Oct 24, 2010, 1:57:56 AM (12 years ago)
Author:
Peter Johansson
Message:

move 'update copyright' code from File class to CopyrightVisitor? class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/CopyrightVisitor.h

    r1237 r1239  
    2929
    3030#include <map>
     31#include <set>
    3132#include <string>
    3233
     
    5354
    5455    /**
     56       Doing nothing
    5557     */
    5658    void leave(Directory& dir);
    5759
    5860    /**
     61       Updating copyright in \a file
    5962     */
    60     void visit(File& dir);
     63    void visit(File& file);
    6164
    6265  private:
     
    6568    const std::map<int, svn_revnum_t>& year2rev_;
    6669    bool ignore_cache_;
     70
     71    /**
     72       \return copyright block
     73
     74       Create a Copyright block from \a year2auth and prefix each line
     75       with \a prefix.
     76     */
     77    std::string copyright_block(const std::map<int, std::set<Alias> >& year2auth,
     78                                const std::string& prefix) const;
     79
     80    /**
     81       Create a map from year to set of authors.
     82     */
     83    void create_year2alias(std::map<int, std::set<Alias> >&, const File& file);
     84
     85    /**
     86       Look from copyright block in file \a path.
     87
     88       \param path file to look for copyright
     89       \param block found copyright block
     90       \param start_at_line line number of first line in found block
     91       \param end_at_line line number of first line after found block
     92
     93       \return true if Copyright block is found
     94     */
     95    bool detect_copyright(const std::string& path, std::string& block,
     96                          size_t& start_at_line, size_t& end_at_line,
     97                          std::string& prefix) const;
     98
     99
     100    /**
     101       Update the copyright in \a file.
     102     */
     103    void update_copyright(const File& file);
     104
     105    /**
     106       Doing the actual print of copyright statement
     107
     108       \param path to file
     109       \param block new copyright block
     110       \param start_at_line line number of first line in old block
     111       \param end_at_line line number of first line after old block
     112     */
     113    void update_copyright(const std::string& path, const std::string& block,
     114                          size_t start_at_line, size_t end_at_line) const;
    67115  };
    68116}} // end of namespace svndigest and namespace theplu
Note: See TracChangeset for help on using the changeset viewer.