#include <CeylanVersion.h>
Public Types | |
typedef Ceylan::Uint8 | VersionNumber |
Describes a version number, a part of the full version identifier. | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
Version (VersionNumber major=0, VersionNumber minor=0, VersionNumber release=0) | |
Constructs a new version identifier. | |
Version (const std::string &versionText) | |
Constructs a new version identifier from a string of the form 'x.y.z' where x, y and z are textual representations of positive or null integers. | |
virtual | ~Version () throw () |
Basic virtual destructor. | |
virtual VersionNumber | getMajorNumber () const |
Returns the major number of this version identifier. | |
virtual void | setMajorNumber (VersionNumber newNumber) |
Sets the major number of this version identifier. | |
virtual VersionNumber | getMinorNumber () const |
Returns the minor number of this version identifier. | |
virtual void | setMinorNumber (VersionNumber newNumber) |
Sets the minor number of this version identifier. | |
virtual VersionNumber | getReleaseNumber () const |
Returns the release number (or patch number) of this version identifier. | |
virtual void | setReleaseNumber (VersionNumber newNumber) |
Sets the release number (or patch number) of this version identifier. | |
virtual bool | isCompatibleWith (const Version &expectedVersion) const |
Tells whether this version, taken as an actual library version, is compatible with the specified one, taken as a requested version. | |
virtual bool | canBeComparedWith (const Version &version) const |
Tells whether this version scheme is compatible with the one of the supplied version instance. | |
virtual const std::string | toString (VerbosityLevels level=high) const |
Returns a user-friendly description of the state of this object. | |
Static Public Member Functions | |
static const std::string | ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high) |
Returns a user-friendly description of this list of pointers to text displayable instances. | |
static TextOutputFormat | GetOutputFormat () |
Returns the current overall text format to be used by TextDisplayable instances. | |
static void | SetOutputFormat (TextOutputFormat newOutputFormat) |
Sets the current overall text format to be used by TextDisplayable instances. | |
Protected Member Functions | |
virtual bool | isUsualVersionSchemeCompliant () const |
Tells whether a Version instance (be it a child class or not), can be considered as a all-purpose usual version, or if it obeys to specific rules that prevent from comparing it according to the common rules. | |
Protected Attributes | |
VersionNumber | _major |
The major version number, i.e. the first version coordinate. | |
VersionNumber | _minor |
The minor version number, i.e. the second version coordinate. | |
VersionNumber | _release |
The release version number (or patch number), i.e. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
Version (const Version &source) | |
Copy constructor made private to ensure that it will be never called. | |
Version & | operator= (const Version &source) |
Assignment operator made private to ensure that it will be never called. |
(minor version).(release or patch version)
Definition at line 64 of file CeylanVersion.h.
Describes a version number, a part of the full version identifier.
Definition at line 76 of file CeylanVersion.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
Version::Version | ( | VersionNumber | major = 0 , |
|
VersionNumber | minor = 0 , |
|||
VersionNumber | release = 0 | |||
) | [explicit] |
Constructs a new version identifier.
major | the major version number. | |
minor | the minor version number. | |
release | the release version number, or the patch number. |
Definition at line 58 of file CeylanVersion.cc.
Version::Version | ( | const std::string & | versionText | ) | [explicit] |
Constructs a new version identifier from a string of the form 'x.y.z' where x, y and z are textual representations of positive or null integers.
versionText | a string describing the version, ex: "1.15.216" |
VersionException | if the string could not be transformed into a valid version. |
Definition at line 69 of file CeylanVersion.cc.
References _major, _minor, _release, dataUtils::e, Ceylan::formatStringList(), Ceylan::split(), Ceylan::stringToUnsignedLong(), Ceylan::Exception::toString(), and Ceylan::toString().
Version::~Version | ( | ) | throw () [virtual] |
Ceylan::Version::Version | ( | const Version & | source | ) | [private] |
Copy constructor made private to ensure that it will be never called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
bool Version::canBeComparedWith | ( | const Version & | version | ) | const [virtual] |
Tells whether this version scheme is compatible with the one of the supplied version instance.
Reimplemented in Ceylan::LibtoolVersion.
Definition at line 182 of file CeylanVersion.cc.
References isUsualVersionSchemeCompliant().
Referenced by operator<(), and operator==().
Version::VersionNumber Version::getMajorNumber | ( | ) | const [virtual] |
Returns the major number of this version identifier.
Definition at line 131 of file CeylanVersion.cc.
References _major.
Referenced by operator<(), operator==(), and Ceylan::Module::setVersion().
Version::VersionNumber Version::getMinorNumber | ( | ) | const [virtual] |
Returns the minor number of this version identifier.
Definition at line 145 of file CeylanVersion.cc.
References _minor.
Referenced by operator<(), operator==(), and Ceylan::Module::setVersion().
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
Version::VersionNumber Version::getReleaseNumber | ( | ) | const [virtual] |
Returns the release number (or patch number) of this version identifier.
Definition at line 159 of file CeylanVersion.cc.
References _release.
Referenced by operator<(), operator==(), and Ceylan::Module::setVersion().
bool Version::isCompatibleWith | ( | const Version & | expectedVersion | ) | const [virtual] |
Tells whether this version, taken as an actual library version, is compatible with the specified one, taken as a requested version.
Basically, for these all-purpose versions, the user-supplied version must exactly match this version to be deemed compatible with.
version | the library version expected by the user program, which corresponds to the headers it has been compiled with. |
VersionException | if the comparison of the two versions cannot be done, for example in the case where they belong to incompatible version schemes: this would be a meaningless operation. |
Reimplemented in Ceylan::LibtoolVersion.
Definition at line 173 of file CeylanVersion.cc.
bool Version::isUsualVersionSchemeCompliant | ( | ) | const [protected, virtual] |
Tells whether a Version instance (be it a child class or not), can be considered as a all-purpose usual version, or if it obeys to specific rules that prevent from comparing it according to the common rules.
For example, Libtool versions should not be mixed with basic versions, since their meaning differ.
Reimplemented in Ceylan::LibtoolVersion.
Definition at line 211 of file CeylanVersion.cc.
References generalUtils::true.
Referenced by canBeComparedWith().
Assignment operator made private to ensure that it will be never called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void Version::setMajorNumber | ( | VersionNumber | newNumber | ) | [virtual] |
Sets the major number of this version identifier.
Definition at line 138 of file CeylanVersion.cc.
References _major.
Referenced by Ceylan::Module::setVersion().
void Version::setMinorNumber | ( | VersionNumber | newNumber | ) | [virtual] |
Sets the minor number of this version identifier.
Definition at line 152 of file CeylanVersion.cc.
References _minor.
Referenced by Ceylan::Module::setVersion().
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
newOutputFormat | the new output format. |
Definition at line 72 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::Log::LogHolder::LogHolder().
void Version::setReleaseNumber | ( | VersionNumber | newNumber | ) | [virtual] |
Sets the release number (or patch number) of this version identifier.
Definition at line 166 of file CeylanVersion.cc.
References _release.
Referenced by Ceylan::Module::setVersion().
const std::string TextDisplayable::ToString | ( | std::list< TextDisplayable * > | displayables, | |
Ceylan::VerbosityLevels | level = Ceylan::high | |||
) | [static, inherited] |
Returns a user-friendly description of this list of pointers to text displayable instances.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
const string Version::toString | ( | VerbosityLevels | level = high |
) | const [virtual] |
Returns a user-friendly description of the state of this object.
level | the requested verbosity level. |
Implements Ceylan::TextDisplayable.
Reimplemented in Ceylan::LibtoolVersion.
Definition at line 189 of file CeylanVersion.cc.
References _major, _minor, _release, Ceylan::low, Ceylan::medium, and Ceylan::toNumericalString().
Referenced by Ceylan::LibtoolVersion::isCompatibleWith(), operator<(), operator==(), and Ceylan::Module::toString().
VersionNumber Ceylan::Version::_major [protected] |
The major version number, i.e. the first version coordinate.
Definition at line 219 of file CeylanVersion.h.
Referenced by Ceylan::LibtoolVersion::checkConsistency(), Ceylan::LibtoolVersion::getCurrentInterfaceNumber(), getMajorNumber(), Ceylan::LibtoolVersion::setCurrentInterfaceNumber(), setMajorNumber(), toString(), Ceylan::LibtoolVersion::toString(), and Version().
VersionNumber Ceylan::Version::_minor [protected] |
The minor version number, i.e. the second version coordinate.
Definition at line 223 of file CeylanVersion.h.
Referenced by getMinorNumber(), Ceylan::LibtoolVersion::getRevisionInterfaceNumber(), setMinorNumber(), Ceylan::LibtoolVersion::setRevisionInterfaceNumber(), toString(), Ceylan::LibtoolVersion::toString(), and Version().
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().
VersionNumber Ceylan::Version::_release [protected] |
The release version number (or patch number), i.e.
the third version coordinate.
Definition at line 231 of file CeylanVersion.h.
Referenced by Ceylan::LibtoolVersion::checkConsistency(), Ceylan::LibtoolVersion::getInterfaceAge(), getReleaseNumber(), Ceylan::LibtoolVersion::setInterfaceAge(), setReleaseNumber(), toString(), Ceylan::LibtoolVersion::toString(), and Version().