Wolframe, 0.0.3

_Wolframe::Version Class Reference

version class More...

#include <version.hpp>

Public Member Functions

 Version ()
 Empty Version constructor. This will contruct a Version object having major and minor versions set to 0, no revision number and no build number. More...
 
 Version (const Version &o)
 
 Version (const char *version, const char *format="%M.%m%|.%r%|.%b")
 Parse a version string. More...
 
 Version (unsigned long version)
 Build a version object from an unsigned long The format of the number is MMmmrrbbb. More...
 
 Version (unsigned short M, unsigned short m)
 
 Version (unsigned short M, unsigned short m, unsigned short r)
 
 Version (unsigned short M, unsigned short m, unsigned short r, unsigned b)
 
unsigned short Major () const
 Returns the major number of the version. More...
 
unsigned short Minor () const
 Returns the minor number of the version. More...
 
unsigned short Revision () const
 Returns the revision number of the version. More...
 
unsigned Build () const
 Returns the build number of the version. More...
 
bool operator== (const Version &other) const
 
bool operator!= (const Version &other) const
 
bool operator> (const Version &other) const
 
bool operator>= (const Version &other) const
 
bool operator< (const Version &other) const
 
bool operator<= (const Version &other) const
 
bool isCompatible (const Version &other) const
 
std::string toString () const
 Print the version in 'major.minor.revision.build' format. More...
 
std::string toString (const char *format) const
 Print the version using custom format. More...
 
unsigned long toNumber () const
 Output the version as an unsigned long The format of the output is MMmmrrbbb. More...
 

Private Attributes

unsigned short m_major
 Major version. More...
 
unsigned short m_minor
 Minor version. More...
 
unsigned short m_revision
 Revision. More...
 
bool m_hasRevision
 Is revision present ? More...
 
unsigned m_build
 Build number. More...
 
bool m_hasBuild
 Is build number present ? More...
 

Detailed Description

version class

Constructor & Destructor Documentation

_Wolframe::Version::Version ( )
inline

Empty Version constructor. This will contruct a Version object having major and minor versions set to 0, no revision number and no build number.

_Wolframe::Version::Version ( const Version o)
inline
_Wolframe::Version::Version ( const char *  version,
const char *  format = "%M.%m%|.%r%|.%b" 
)
explicit

Parse a version string.

Parameters
[in]versionthe version string to parse
[in]formatthe format string of the version:
  • M = Major version
  • m = Minor version
  • r = revision
  • b = build number
  • %% = %
  • %| = Accepted end of version string (if the version string ends here, the input is accepted. If not parsing is continued with the rest of the format string as pattern)
_Wolframe::Version::Version ( unsigned long  version)

Build a version object from an unsigned long The format of the number is MMmmrrbbb.

_Wolframe::Version::Version ( unsigned short  M,
unsigned short  m 
)
_Wolframe::Version::Version ( unsigned short  M,
unsigned short  m,
unsigned short  r 
)
_Wolframe::Version::Version ( unsigned short  M,
unsigned short  m,
unsigned short  r,
unsigned  b 
)

Member Function Documentation

unsigned _Wolframe::Version::Build ( ) const
inline

Returns the build number of the version.

bool _Wolframe::Version::isCompatible ( const Version other) const

Test if the other version is compatible with this version using the usual OSS versioning schemas

unsigned short _Wolframe::Version::Major ( ) const
inline

Returns the major number of the version.

unsigned short _Wolframe::Version::Minor ( ) const
inline

Returns the minor number of the version.

bool _Wolframe::Version::operator!= ( const Version other) const
inline
bool _Wolframe::Version::operator< ( const Version other) const
inline
bool _Wolframe::Version::operator<= ( const Version other) const
inline
bool _Wolframe::Version::operator== ( const Version other) const
bool _Wolframe::Version::operator> ( const Version other) const
bool _Wolframe::Version::operator>= ( const Version other) const
inline
unsigned short _Wolframe::Version::Revision ( ) const
inline

Returns the revision number of the version.

unsigned long _Wolframe::Version::toNumber ( ) const

Output the version as an unsigned long The format of the output is MMmmrrbbb.

Note
All numbers (major, minor...) will be cut to the 2 most significant decimal digits except for the build number which will be cut to 3 decimal digits
std::string _Wolframe::Version::toString ( ) const

Print the version in 'major.minor.revision.build' format.

std::string _Wolframe::Version::toString ( const char *  format) const

Print the version using custom format.

Parameters
formatthe format string

Member Data Documentation

unsigned _Wolframe::Version::m_build
private

Build number.

bool _Wolframe::Version::m_hasBuild
private

Is build number present ?

bool _Wolframe::Version::m_hasRevision
private

Is revision present ?

unsigned short _Wolframe::Version::m_major
private

Major version.

unsigned short _Wolframe::Version::m_minor
private

Minor version.

unsigned short _Wolframe::Version::m_revision
private

Revision.


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