source: trunk/lib/Commitment.h @ 1305

Last change on this file since 1305 was 1305, checked in by Peter Johansson, 11 years ago

prefer passing const&

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1#ifndef _theplu_svndigest_commitment_
2#define _theplu_svndigest_commitment_
3
4// $Id: Commitment.h 1305 2010-11-15 01:51:47Z peter $
5
6/*
7  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009 Peter Johansson
9
10  This file is part of svndigest, http://dev.thep.lu.se/svndigest
11
12  svndigest is free software; you can redistribute it and/or modify it
13  under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 3 of the License, or
15  (at your option) any later version.
16
17  svndigest is distributed in the hope that it will be useful, but
18  WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21
22  You should have received a copy of the GNU General Public License
23  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
24*/
25
26#include <string>
27
28#include <subversion-1/svn_types.h>
29
30namespace theplu {
31namespace svndigest {
32
33  /**
34     The Commitment is an aggregrate containing the information from
35     one commitment in the log.
36
37     \see SVNlog
38  */
39  class Commitment {
40  public:
41
42    /**
43       \brief Default contructor.
44    */
45    Commitment(void);
46
47    /**
48       \brief The contructor.
49    */
50    Commitment(const std::string& author, const std::string& date, 
51               const std::string& msg, svn_revnum_t rev);
52
53    /**
54       \return Author
55    */
56    inline const std::string& author(void) const { return author_; }
57
58    /**
59       \return Date
60    */
61    inline const std::string& date(void) const { return date_; }
62
63    /**
64       \return Message
65    */
66    inline const std::string& message(void) const { return msg_; }
67
68    /**
69       \return Revision
70    */
71    inline svn_revnum_t revision(void) const { return rev_; }
72
73  private:
74    // Using compiler-generated Copy Constructor.
75    // Commitment(const Commitment&);
76    //
77    // Using compiler-generated Copy assignment.
78    // Commitment& operator=(const Commitment&);
79
80    std::string author_;
81    std::string date_;
82    std::string msg_;
83    svn_revnum_t rev_;
84
85  };
86
87 
88  struct GreaterRevision
89  {
90    inline bool operator()(const Commitment& lhs, const Commitment& rhs)
91    { return lhs.revision()>rhs.revision(); }
92  };
93
94  struct LessRevision
95  {
96    inline bool operator()(const Commitment& lhs, const Commitment& rhs)
97    { return lhs.revision()<rhs.revision(); }
98  };
99
100}} // end of namespace svndigest and namespace theplu
101
102#endif
Note: See TracBrowser for help on using the repository browser.