source: trunk/lib/Commitment.h @ 519

Last change on this file since 519 was 519, checked in by Jari Häkkinen, 14 years ago

trac moved to new location.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1#ifndef _theplu_svndigest_commitment_
2#define _theplu_svndigest_commitment_
3
4// $Id: Commitment.h 519 2007-12-23 20:14:50Z jari $
5
6/*
7  Copyright (C) 2007 Peter Johansson
8
9  This file is part of svndigest, http://trac.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 2 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 this program; if not, write to the Free Software
23  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  02111-1307, USA.
25*/
26
27#include <string>
28
29namespace theplu {
30namespace 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               size_t rev);
51
52    /**
53       \return Author
54    */
55    inline std::string author(void) const { return author_; }
56
57    /**
58       \return Date
59    */
60    inline std::string date(void) const { return date_; }
61
62    /**
63       \return Message
64    */
65    inline std::string message(void) const { return msg_; }
66
67    /**
68       \return Revision
69    */
70    inline size_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    size_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}} // end of namespace svndigest and namespace theplu
94
95#endif
Note: See TracBrowser for help on using the repository browser.