SvnCpp
revision.hpp
Go to the documentation of this file.
1 /*
2  * ====================================================================
3  * Copyright (c) 2002-2018 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 Lesser General Public License as
7  * published by the Free Software Foundation, either version 3 of the
8  * License, or (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 Lesser General Public
16  * License along with this program (in the file LGPL.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  static const Revision PREVIOUS;
57 
63  Revision(const svn_opt_revision_t * revision);
64 
70  Revision(const svn_revnum_t revnum);
71 
77  Revision(const svn_opt_revision_kind kind = svn_opt_revision_unspecified);
78 
84  Revision(const DateTime dateTime);
85 
91  Revision(const Revision & revision);
92 
96  const svn_opt_revision_t *
97  revision() const;
98 
103  operator svn_opt_revision_t * ()
104  {
105  return &m_revision;
106  }
107 
111  svn_revnum_t
112  revnum() const;
113 
117  svn_opt_revision_kind
118  kind() const;
119 
124  operator svn_opt_revision_kind() const
125  {
126  return kind();
127  }
128 
132  apr_time_t
133  date() const;
134  };
135 }
136 
137 #endif
138 /* -----------------------------------------------------------------
139  * local variables:
140  * eval: (load-file "../../rapidsvn-dev.el")
141  * end:
142  */
svn::Revision::Revision
Revision(const svn_opt_revision_t *revision)
datetime.hpp
svn::Revision
Definition: revision.hpp:42
svn::Revision::revnum
svn_revnum_t revnum() const
svn::Revision::date
apr_time_t date() const
svn::Revision::WORKING
static const Revision WORKING
Definition: revision.hpp:54
svn::Revision::revision
const svn_opt_revision_t * revision() const
svn::Revision::HEAD
static const Revision HEAD
Definition: revision.hpp:53
svn::Revision::BASE
static const Revision BASE
Definition: revision.hpp:52
svn
Definition: annotate_line.hpp:31
svn::Revision::PREVIOUS
static const Revision PREVIOUS
Definition: revision.hpp:56
svn::Revision::UNSPECIFIED
static const Revision UNSPECIFIED
Definition: revision.hpp:55
svn::Revision::kind
svn_opt_revision_kind kind() const
svn::DateTime
Definition: datetime.hpp:39
svn::Revision::START
static const Revision START
Definition: revision.hpp:51