SvnCpp
revision.hpp
Go to the documentation of this file.
1 /*
2  * ====================================================================
3  * Copyright (c) 2002-2009 The RapidSvn Group. All rights reserved.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program (in the file GPL.txt.
17  * If not, see <http://www.gnu.org/licenses/>.
18  *
19  * This software consists of voluntary contributions made by many
20  * individuals. For exact contribution history, see the revision
21  * history and logs, available at http://rapidsvn.tigris.org/.
22  * ====================================================================
23  */
24 
25 #ifndef _SVNCPP_REVISION_HPP_
26 #define _SVNCPP_REVISION_HPP_
27 
28 // subversion api
29 #include "svn_types.h"
30 #include "svn_opt.h"
31 
32 // svncpp
33 #include "datetime.hpp"
34 
35 namespace svn
36 {
42  class Revision
43  {
44  private:
45  svn_opt_revision_t m_revision;
46 
47  void
48  init(const svn_opt_revision_t * revision);
49 
50  public:
51  static const Revision START;
52  static const Revision BASE;
53  static const Revision HEAD;
54  static const Revision WORKING;
55  static const Revision UNSPECIFIED;
56 
62  Revision(const svn_opt_revision_t * revision);
63 
69  Revision(const svn_revnum_t revnum);
70 
76  Revision(const svn_opt_revision_kind kind = svn_opt_revision_unspecified);
77 
83  Revision(const DateTime dateTime);
84 
90  Revision(const Revision & revision);
91 
95  const svn_opt_revision_t *
96  revision() const;
97 
102  operator svn_opt_revision_t * ()
103  {
104  return &m_revision;
105  }
106 
110  svn_revnum_t
111  revnum() const;
112 
116  svn_opt_revision_kind
117  kind() const;
118 
123  operator svn_opt_revision_kind() const
124  {
125  return kind();
126  }
127 
131  apr_time_t
132  date() const;
133  };
134 }
135 
136 #endif
137 /* -----------------------------------------------------------------
138  * local variables:
139  * eval: (load-file "../../rapidsvn-dev.el")
140  * end:
141  */
static const Revision UNSPECIFIED
Definition: revision.hpp:55
Revision(const svn_opt_revision_t *revision)
apr_time_t date() const
static const Revision WORKING
Definition: revision.hpp:54
Definition: revision.hpp:42
Definition: annotate_line.hpp:31
static const Revision BASE
Definition: revision.hpp:52
svn_opt_revision_kind kind() const
static const Revision START
Definition: revision.hpp:51
Definition: datetime.hpp:39
static const Revision HEAD
Definition: revision.hpp:53
const svn_opt_revision_t * revision() const
svn_revnum_t revnum() const