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