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