source: trunk/lib/Commitment.h @ 256

Last change on this file since 256 was 256, checked in by Peter Johansson, 14 years ago

reimplementing some part of print_main_page using Commitment class

  • 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 256 2007-04-30 11:17:36Z peter $
5
6/*
7  Copyright (C) 2007 Peter Johansson
8
9  This file is part of svndigest, http://lev.thep.lu.se/trac/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 "Date.h"
28
29#include <string>
30
31namespace theplu {
32namespace svndigest {
33
34  /**
35     The Commitment is an aggregrate containing the information from
36     one commitment in the log.
37
38     \see SVNlog
39  */
40  class Commitment {
41  public:
42
43    /**
44       \brief Default contructor.
45    */
46    Commitment(void);
47
48    /**
49       \brief The contructor.
50    */
51    Commitment(std::string author, const Date& date, std::string msg, 
52               size_t rev);
53
54    /**
55       \return Author
56    */
57    inline std::string author(void) const { return author_; }
58
59    /**
60       \return Date
61    */
62    inline const Date& date(void) const { return date_; }
63
64    /**
65       \return Message
66    */
67    inline std::string message(void) const { return msg_; }
68
69    /**
70       \return Revision
71    */
72    inline size_t revision(void) const { return rev_; }
73
74  private:
75    // Using compiler-generated Copy Constructor.
76    // Commitment(const Commitment&);
77    //
78    // Using compiler-generated Copy assignment.
79    // Commitment& operator=(const Commitment&);
80
81    std::string author_;
82    Date date_;
83    std::string msg_;
84    size_t rev_;
85
86  };
87
88 
89  struct GreaterRevision
90  {
91    inline bool operator()(const Commitment& lhs, const Commitment& rhs)
92    { return lhs.revision()>rhs.revision(); }
93  };
94
95}} // end of namespace svndigest and namespace theplu
96
97#endif
Note: See TracBrowser for help on using the repository browser.