Loading...
Searching...
No Matches
apache::subversion::svnxx::revision Class Reference

A revision, see svn_opt_revision_t. More...

`#include <svnxx/revision.hpp>`

## Public Types

enum class | number : svn_revnum_t { invalid = SVN_INVALID_REVNUM }
| Revision number type. More...
enum class | kind : std::int8_t { unspecified = svn_opt_revision_unspecified , number = svn_opt_revision_number , date = svn_opt_revision_date , committed = svn_opt_revision_committed , previous = svn_opt_revision_previous , base = svn_opt_revision_base , working = svn_opt_revision_working , head = svn_opt_revision_head }
| Revision kind discriminator (see svn_opt_revision_kind). More...
template<typename Duration>
using | time = std::chrono::time_point<std::chrono::system_clock, Duration>
| Revision by date/time uses the system clock.
using | usec = std::chrono::microseconds
| The resolution of the stored date/time.

## Public Member Functions

| revision () noexcept
| Default constructor.
| revision (kind revkind)
| Construct a revision of the given kind.
| revision (number revnum_) noexcept
| Construct a numbered revision.
template<typename D>
| revision (time< D > time_) noexcept
| Construct a dated revision from a system clock time point.
revision & | operator= (const revision &that)
| Assignment operator.
kind | get_kind () const noexcept
| Return the revision kind.
number | get_number () const
| Return the revision number.
template<typename D>
time< D > | get_date () const
| Return the revision date/time as a system clock time point.

## Related Symbols

(Note that these are not member symbols.)
using | revnum = revision::number
| revision::number alias for convenience.
bool | operator== (const revision &a, const revision &b)
| Equality comparison.
bool | operator!= (const revision &a, const revision &b)
| Inequality comparison.
tristate | operator< (const revision &a, const revision &b)
| Ordering: less-than (operator <).
tristate | operator> (const revision &a, const revision &b)
| Ordering: greater-than (operator >).
tristate | operator<= (const revision &a, const revision &b)
| Ordering: less-or-equal (operator <=).
tristate | operator>= (const revision &a, const revision &b)
| Ordering: greater-or-equal (operator >=).

## Detailed Description

A revision, see svn_opt_revision_t.

The `revision` can represent a revision number, a point in time in the repository or a property of the working copy or repository node (see revision::kind).

Definition at line 48 of file revision.hpp.

## Member Typedef Documentation

## time

template<typename Duration>

using apache::subversion::svnxx::revision::time = std::chrono::time_point<std::chrono::system_clock, Duration>

Revision by date/time uses the system clock.

Definition at line 63 of file revision.hpp.

## usec

using apache::subversion::svnxx::revision::usec = std::chrono::microseconds

The resolution of the stored date/time.

Definition at line 68 of file revision.hpp.

## Member Enumeration Documentation

## kind

enum class apache::subversion::svnxx::revision::kind : std::int8_t

strong

Revision kind discriminator (see svn_opt_revision_kind).

Definition at line 74 of file revision.hpp.

## number

enum class apache::subversion::svnxx::revision::number : svn_revnum_t

strong

Revision number type.

Enumerator
invalid | Invalid revision number.

Definition at line 54 of file revision.hpp.

## Constructor & Destructor Documentation

## revision() [1/4]

apache::subversion::svnxx::revision::revision | ( |  | ) |

inline noexcept

Default constructor.

Postcondition
  get_kind() == kind::unspecified.

Definition at line 90 of file revision.hpp.

Referenced by operator!=(), operator<(), operator<=(), operator=(), operator==(), operator>(), and operator>=().

## revision() [2/4]

apache::subversion::svnxx::revision::revision | ( | kind | revkind | ) |

inline explicit

Construct a revision of the given kind.

Precondition
  The revkind argument may be any `kind` value except kind::number or kind::date, which require additional parameters and therefore have their own constructors.

Postcondition
  get_kind() == revkind.

Exceptions

  std::invalid_argument | if the revkind value precondition is not met.

Definition at line 103 of file revision.hpp.

## revision() [3/4]

apache::subversion::svnxx::revision::revision | ( | number | revnum_ | ) |

inline explicit noexcept

Construct a numbered revision.

Postcondition
  get_kind() == kind::number.

Definition at line 114 of file revision.hpp.

## revision() [4/4]

template<typename D>

apache::subversion::svnxx::revision::revision | ( | time< D > | time_ | ) |

inline explicit noexcept

Construct a dated revision from a system clock time point.

Postcondition
  get_kind() == kind::date.

Definition at line 124 of file revision.hpp.

## Member Function Documentation

## get_date()

template<typename D>

time< D > apache::subversion::svnxx::revision::get_date | ( |  | ) | const

inline

Return the revision date/time as a system clock time point.

Precondition
  get_kind() == kind::date.

Exceptions

  std::logic_error | if the precondition is not met.

Definition at line 167 of file revision.hpp.

Referenced by operator<(), operator==(), and operator>().

## get_kind()

kind apache::subversion::svnxx::revision::get_kind | ( |  | ) | const

inline noexcept

Return the revision kind.

Definition at line 144 of file revision.hpp.

Referenced by operator<(), operator==(), and operator>().

## get_number()

number apache::subversion::svnxx::revision::get_number | ( |  | ) | const

inline

Return the revision number.

Precondition
  get_kind() == kind::number.

Exceptions

  std::logic_error | if the precondition is not met.

Definition at line 154 of file revision.hpp.

Referenced by operator<(), operator==(), and operator>().

## operator=()

revision & apache::subversion::svnxx::revision::operator= | ( | const revision & | that | ) |

inline

Assignment operator.

Uses in-place destruction/construction to maintain the immutability of the revision kind.

Definition at line 134 of file revision.hpp.

References revision().

## Friends And Related Symbol Documentation

## operator!=()

bool operator!= | ( | const revision & | a,
|  | const revision & | b )

related

Inequality comparison.

Definition at line 211 of file revision.hpp.

References revision().

## operator<()

tristate operator< | ( | const revision & | a,
|  | const revision & | b )

related

Ordering: less-than (operator <).

Returns
  a `tristate` result of comparing two `revision` values, according to the following table:

  `<` | number | date | other
  --- | --- | --- | ---
  number | a.get_number() < b.get_number() | unknown | unknown
  date | unknown | a.get_date() < b.get_date() | unknown
  other | unknown | unknown | unknown

Definition at line 248 of file revision.hpp.

References get_date(), get_kind(), get_number(), revision(), and apache::subversion::svnxx::tristate::unknown().

## operator<=()

tristate operator<= | ( | const revision & | a,
|  | const revision & | b )

related

Ordering: less-or-equal (operator <=).

Returns
  a `tristate` result of comparing two `revision` values, according to the following table:

  `<=` | number | date | other
  --- | --- | --- | ---
  number | a.get_number() <= b.get_number() | unknown | unknown
  date | unknown | a.get_date() <= b.get_date() | unknown
  other | unknown | unknown | true† or unknown

  † true when a.get_kind() == b.get_kind().

Definition at line 339 of file revision.hpp.

References revision().

## operator==()

bool operator== | ( | const revision & | a,
|  | const revision & | b )

related

Equality comparison.

Definition at line 194 of file revision.hpp.

References get_date(), get_kind(), get_number(), and revision().

## operator>()

tristate operator> | ( | const revision & | a,
|  | const revision & | b )

related

Ordering: greater-than (operator >).

Returns
  a `tristate` result of comparing two `revision` values, according to the following table:

  `>` | number | date | other
  --- | --- | --- | ---
  number | a.get_number() > b.get_number() | unknown | unknown
  date | unknown | a.get_date() > b.get_date() | unknown
  other | unknown | unknown | unknown

Definition at line 293 of file revision.hpp.

References get_date(), get_kind(), get_number(), revision(), and apache::subversion::svnxx::tristate::unknown().

## operator>=()

tristate operator>= | ( | const revision & | a,
|  | const revision & | b )

related

Ordering: greater-or-equal (operator >=).

Returns
  a `tristate` result of comparing two `revision` values, according to the following table:

  `>=` | number | date | other
  --- | --- | --- | ---
  number | a.get_number() >= b.get_number() | unknown | unknown
  date | unknown | a.get_date() >= b.get_date() | unknown
  other | unknown | unknown | true† or unknown

  † true when a.get_kind() == b.get_kind().

Definition at line 377 of file revision.hpp.

References revision().

## revnum

using revnum = revision::number

related

revision::number alias for convenience.

Definition at line 188 of file revision.hpp.

## Field Documentation

## date

time<usec> apache::subversion::svnxx::revision::date

Definition at line 180 of file revision.hpp.

## revnum

number apache::subversion::svnxx::revision::revnum

Definition at line 179 of file revision.hpp.

The documentation for this class was generated from the following file:

- svnxx/revision.hpp