Ignore:
Timestamp:
Jan 8, 2008, 3:40:37 PM (14 years ago)
Author:
Peter Johansson
Message:

fixes linetype Copyright

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/lib/LineTypeParser.h

    r550 r552  
    1 #ifndef _theplu_svndigest_parser_
    2 #define _theplu_svndigest_parser_
     1#ifndef _theplu_svndigest_line_type_parser_
     2#define _theplu_svndigest_line_type_parser_
    33
    44// $Id$
     
    3434
    3535  /**
    36      \brief Class parsing files
     36     \brief differentiate code, comments, and blank lines
    3737     
    3838     Class gets parsing rules from Configuration. Which rules depends
     
    4141     which can be accessed through function type(void).
    4242  */
    43   class Parser
     43  class LineTypeParser
    4444  {
    4545  public:
     
    4747    /// see 'doc/readmea.txt' for info on what is code, comment, and other.
    4848    ///
     49    // do not change these without checking in Stats class
    4950    enum line_type {
    50       copyright,
    51       other,
    52       comment,
    53       code
     51      copyright = 0,
     52      other = 1,
     53      comment = 2,
     54      code = 3,
     55      comment_or_copy = 4,
     56      total = 5 // total should always be the largest
    5457    };
    5558
     
    5861    /// \param filename is used to decide which parsing rules to use
    5962    ///
    60     explicit Parser(std::string filename);
     63    explicit LineTypeParser(std::string filename);
     64
     65    const std::string& block(void) const { return block_; }
     66    inline bool copyright_found(void) const { return copyright_found_; }
     67
     68    inline size_t end_line(void) const { return end_line_; }
    6169
    6270    /**
     
    6775       The line is parsed and added to internal vector. 
    6876     */
    69     line_type parse(const std::string& line);
     77    line_type parse(std::string line);
     78
     79    const std::string& prefix(void) const { return copyright_prefix_; }
     80
     81    inline size_t start_line(void) const { return start_line_; }
    7082
    7183    ///
     
    7688  private:
    7789    // no copy allowed
    78     Parser(const Parser& other);
    79     Parser& operator=(const Parser&);
     90    LineTypeParser(const LineTypeParser& other);
     91    LineTypeParser& operator=(const LineTypeParser&);
    8092
    8193    line_type code_mode(const std::string& line);
     
    8395
    8496    size_t mode_;
     97    bool post_copyright_;
     98    bool copyright_found_;
     99    std::string copyright_prefix_;
     100    std::string block_;
     101    size_t start_line_;
     102    size_t end_line_;
    85103   
    86104    std::vector<line_type> type_;
Note: See TracChangeset for help on using the changeset viewer.