#include <version.hpp>

Classes | |
| struct | not_sane_exception |
| Thrown when trying to compare an non-sane version_info object. More... | |
Public Member Functions | |
| version_info () | |
| Default constructor. | |
| version_info (const version_info &) | |
| Copy constructor. | |
| version_info (const std::string &) | |
| String constructor. | |
| version_info (unsigned int major, unsigned int minor, unsigned int revision_level, bool sane=true, char special_separator='\0', const std::string &special=std::string()) | |
| Simple list constructor. | |
| version_info & | operator= (const version_info &o) |
| Assignment operator. | |
| bool | good () const |
| bool | is_canonical () const |
| unsigned int | major_version () const |
| Retrieves the major version number (X in "X.Y.Z"). | |
| unsigned int | minor_version () const |
| Retrieves the minor version number (Y in "X.Y.Z"). | |
| unsigned int | revision_level () const |
| Retrieves the revision level (Z in "X.Y.Z"). | |
| const std::string & | special_version () const |
| It is sometimes useful so append special build/distribution information to version numbers, in the form of "X.Y.Z+svn", "X.Y.Za", etcetera. | |
| char | special_version_separator () const |
| Retrieves the special version separator. | |
| void | set_major_version (unsigned int) |
| Set major version number. | |
| void | set_minor_version (unsigned int) |
| Set minor version number. | |
| void | set_revision_level (unsigned int) |
| Set revision level. | |
| void | set_special_version (const std::string &str) |
| Set special version string. | |
| unsigned int | get_component (size_t index) const |
| Returns a component from a non-canonically formatted version string (i.e. | |
| void | set_component (size_t index, unsigned int value) |
| Sets a component in a non-canonically formatted version string (i.e. | |
| const std::vector< unsigned int > & | components () const |
| Read-only access to complete vector of components. | |
| std::string | str () const |
| Returns a formatted string of the form A.B.C[.x1[.x2[...]]]kS, where xN stand for non-canonical version components, k for the suffix separator, and S for the suffix string. | |
| operator std::string () const | |
| Syntactic shortcut for str(). | |
Protected Member Functions | |
| void | assign (const version_info &) |
| Assign from other version_info object. | |
Private Attributes | |
| std::vector< unsigned int > | nums_ |
| std::string | special_ |
| char | special_separator_ |
| bool | sane_ |
Definition at line 31 of file version.hpp.
| version_info::version_info | ( | ) |
Default constructor.
Definition at line 30 of file version.cpp.
| version_info::version_info | ( | const version_info & | o | ) |
Copy constructor.
Definition at line 22 of file version.cpp.
| version_info::version_info | ( | const std::string & | str | ) |
String constructor.
Definition at line 44 of file version.cpp.
References components(), lexical_cast(), nums_, sane_, special_, special_separator_, utils::split(), and utils::strip().

| version_info::version_info | ( | unsigned int | major, | |
| unsigned int | minor, | |||
| unsigned int | revision_level, | |||
| bool | sane = true, |
|||
| char | special_separator = '\0', |
|||
| const std::string & | special = std::string() | |||
| ) |
| void version_info::assign | ( | const version_info & | o | ) | [protected] |
Assign from other version_info object.
Definition at line 106 of file version.cpp.
References nums_, sane_, special_, and special_separator_.
Referenced by operator=().

| const std::vector<unsigned int>& version_info::components | ( | ) | const [inline] |
Read-only access to complete vector of components.
Definition at line 125 of file version.hpp.
References nums_.
Referenced by version_info().

| unsigned int version_info::get_component | ( | size_t | index | ) | const [inline] |
Returns a component from a non-canonically formatted version string (i.e.
'D' from A.B.C.D is index 3). The index may be in the [0,3) range; in such case, this function works identically to the canonical version numbers extractors.
Definition at line 106 of file version.hpp.
References nums_.
| bool version_info::good | ( | ) | const [inline] |
Definition at line 51 of file version.hpp.
References sane_.
Referenced by BOOST_AUTO_TEST_CASE().

| bool version_info::is_canonical | ( | ) | const |
Definition at line 165 of file version.cpp.
Referenced by BOOST_AUTO_TEST_CASE().

| unsigned int version_info::major_version | ( | ) | const |
Retrieves the major version number (X in "X.Y.Z").
Definition at line 153 of file version.cpp.
References nums_.
Referenced by BOOST_AUTO_TEST_CASE(), savegame::loadgame::check_version_compatibility(), and get_version_path_suffix().

| unsigned int version_info::minor_version | ( | ) | const |
Retrieves the minor version number (Y in "X.Y.Z").
Definition at line 157 of file version.cpp.
References nums_.
Referenced by BOOST_AUTO_TEST_CASE(), savegame::loadgame::check_version_compatibility(), and get_version_path_suffix().

| version_info::operator std::string | ( | ) | const [inline] |
Syntactic shortcut for str().
Definition at line 137 of file version.hpp.
References str().

| version_info& version_info::operator= | ( | const version_info & | o | ) | [inline] |
Assignment operator.
Definition at line 46 of file version.hpp.
References assign().

| unsigned int version_info::revision_level | ( | ) | const |
Retrieves the revision level (Z in "X.Y.Z").
Definition at line 161 of file version.cpp.
References nums_.
Referenced by BOOST_AUTO_TEST_CASE().

| void version_info::set_component | ( | size_t | index, | |
| unsigned int | value | |||
| ) | [inline] |
Sets a component in a non-canonically formatted version string (i.e.
'D' from A.B.C.D is index 3). The index may be in the [0,3) range; in such case, this function works identically to the canonical version numbers setters.
Definition at line 120 of file version.hpp.
References nums_.
| void version_info::set_major_version | ( | unsigned int | v | ) |
| void version_info::set_minor_version | ( | unsigned int | v | ) |
| void version_info::set_revision_level | ( | unsigned int | v | ) |
| void version_info::set_special_version | ( | const std::string & | str | ) | [inline] |
| const std::string& version_info::special_version | ( | ) | const [inline] |
It is sometimes useful so append special build/distribution information to version numbers, in the form of "X.Y.Z+svn", "X.Y.Za", etcetera.
This member function retrieves such if available.
Definition at line 72 of file version.hpp.
References special_.
Referenced by BOOST_AUTO_TEST_CASE(), operator!=(), operator<(), operator==(), and operator>().

| char version_info::special_version_separator | ( | ) | const [inline] |
Retrieves the special version separator.
For the "X.Y.Z+blah" string, it would be '+'. On the other hand, it would be a null (ASCII 00) character if the string was "X.Y.Za".
Definition at line 81 of file version.hpp.
References special_separator_.
Referenced by BOOST_AUTO_TEST_CASE().

| std::string version_info::str | ( | ) | const |
Returns a formatted string of the form A.B.C[.x1[.x2[...]]]kS, where xN stand for non-canonical version components, k for the suffix separator, and S for the suffix string.
Definition at line 117 of file version.cpp.
References nums_, special_, and special_separator_.
Referenced by BOOST_AUTO_TEST_CASE(), savegame::loadgame::check_version_compatibility(), preprocessor_data::get_chunk(), operator std::string(), addon_info::write(), and addon_info::write_minimal().

std::vector<unsigned int> version_info::nums_ [private] |
Definition at line 144 of file version.hpp.
Referenced by assign(), components(), get_component(), is_canonical(), major_version(), minor_version(), revision_level(), set_component(), set_major_version(), set_minor_version(), set_revision_level(), str(), and version_info().
bool version_info::sane_ [private] |
Definition at line 147 of file version.hpp.
Referenced by assign(), good(), is_canonical(), and version_info().
std::string version_info::special_ [private] |
Definition at line 145 of file version.hpp.
Referenced by assign(), set_special_version(), special_version(), str(), and version_info().
char version_info::special_separator_ [private] |
Definition at line 146 of file version.hpp.
Referenced by assign(), special_version_separator(), str(), and version_info().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:17:54 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |