Changeset 381 for trunk/lib/SVNblame.h


Ignore:
Timestamp:
Jun 21, 2007, 10:43:17 PM (14 years ago)
Author:
Jari Häkkinen
Message:

SVNblame redesigned.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/SVNblame.h

    r380 r381  
    3535  class SVN;
    3636
    37   ///
    38   /// The SVNblame class is a utility class for taking care of 'svn
    39   /// blame' information. An 'svn blame' is performed on an item, the
    40   /// blame information for each line is traversed with
    41   /// SVNblame.next() calls giving access to the blame information in
    42   /// a blame_information struct.
    43   ///
     37  /**
     38    The SVNblame class is a utility class for taking care of 'svn
     39    blame' information. An 'svn blame' is performed on an item, the
     40    blame information for each line is traversed with
     41     SVNblame.next_line() and SVNblame.valid() calls giving access to
     42     the blame information.
     43  */
    4444  class SVNblame {
    4545  public:
    4646
    47     ///
    48     /// @brief Information return by subversion (blame) API
    49     ///
    50     /// @see Subversion API for blame usage.
    51     ///
     47    /**
     48       @brief The contructor.
     49
     50       The constructor performs an 'svn blame' on \a path and
     51       initializes the SVNblame object for statistics traversal using
     52       SVNblame::next_line() and SVNblame::valid().
     53    */
     54    explicit SVNblame(const std::string& path);
     55
     56    /**
     57       @brief The destructor.
     58    */
     59    ~SVNblame(void);
     60
     61    /**
     62       @brief Retrieve the blame date for the current line.
     63
     64       If current line is outside blame entries the behaviour is
     65       undefined.
     66
     67       @return The date.
     68    */
     69    std::string author(void);
     70
     71    /**
     72       Returns true if item is binary false otherwise
     73
     74       Binary files are invalid for 'svn blame'.
     75    */
     76    bool binary(void);
     77
     78    /**
     79       @brief Retrieve the blame date for the current line.
     80
     81       If current line is outside blame entries the behaviour is
     82       undefined.
     83
     84       @return The date.
     85    */
     86    std::string date(void);
     87
     88    /**
     89       @brief Retrieve the content of the current line.
     90
     91       If current line is outside blame entries the behaviour is
     92       undefined.
     93
     94       @return The line content.
     95    */
     96    std::string line(void);
     97
     98    /**
     99       @brief Retrieve the line number of the current line.
     100
     101       If current line is outside blame entries the behaviour is
     102       undefined.
     103
     104       @return The line number.
     105    */
     106    apr_int64_t line_no(void);
     107
     108    /**
     109       @brief Skip to the next line.
     110
     111       @return False if no more blame information is available, true
     112       otherwise.
     113    */
     114    bool next_line(void);
     115
     116    /**
     117       @brief Retrieve the blame revision of the current line.
     118
     119       If current line is outside blame entries the behaviour is
     120       undefined.
     121
     122       @return The blame revision.
     123    */
     124    svn_revnum_t revision(void);
     125
     126    /**
     127       @brief Check if more blame information is available.
     128
     129       @return True if valid information exists, false otherwise.
     130    */
     131    bool valid(void);
     132
     133  private:
     134
     135    /**
     136       @brief Copy Constructor, not implemented.
     137    */
     138    SVNblame(const SVNblame&);
     139
     140    /**
     141       @brief Information return by subversion (blame) API
     142
     143       @see Subversion API for blame usage.
     144    */
    52145    struct blame_information {
    53146      apr_int64_t line_no;
     
    57150      std::string line;
    58151    };
    59 
    60     ///
    61     /// @brief The contructor.
    62     ///
    63     /// The constructor performs an 'svn blame' on \a path and
    64     /// initializes the SVNblame object for statistics traversal using
    65     /// SVNblame::next().
    66     ///
    67     explicit SVNblame(const std::string& path);
    68 
    69     ///
    70     /// @brief The destructor.
    71     ///
    72     ~SVNblame(void);
    73 
    74     ///
    75     /// @brief Returns true if item is binary false otherwise
    76     ///
    77     /// Binary files are invalid for 'svn blame'.
    78     ///
    79     inline bool binary(void) { return binary_; }
    80 
    81     /**
    82        Traverse all lines in the item for statistics analysis. There
    83        is currently no way to reset the pointer to the beginning of
    84        item. The pointer is only valid while the SVNblame object is in
    85        scope.
    86 
    87        @return Pointer to a blame_information struct if more lines are
    88        available NULL otherwise.
    89 
    90        @see struct blame_information.
    91     */
    92     const blame_information* next(void);
    93 
    94   private:
    95 
    96     ///
    97     /// @brief Copy Constructor, not implemented.
    98     ///
    99     SVNblame(const SVNblame&);
    100152
    101153    // binary_ is true if item in any revision has been binary.
Note: See TracChangeset for help on using the changeset viewer.