Version Class Reference

Represents a version with four integers, such as "1.0.2.14". More...

#include <Version.h>

List of all members.

Public Types

enum  EVersionQuality {
  QUALITY_DEV, QUALITY_ALPHA, QUALITY_BETA, QUALITY_RELEASE_CANDIDATE,
  QUALITY_GAMMA = QUALITY_RELEASE_CANDIDATE, QUALITY_STABLE, MAX_QUALITY
}
 Quality information on the version (alpha, beta, RC...). More...

Public Member Functions

 Version (UINT majorNumber=0, UINT minorNumber=0, UINT revision=0, UINT build=0, EVersionQuality quality=QUALITY_STABLE)
 Version (const Version &v)
 Version (const std::string &str)
 Constructs a Version object direclty from a string reprenstation (using fromString()).
std::string toString () const
 Writes a string representation of the version.
std::string toShortString () const
 Writes a string representation of the version, limited to 2 numbers.
bool fromString (const std::string &str)
 Parses a version text like "1.0.1.23" and stores the result into version array {1, 0, 1, 23}.
void reset ()
 Sets the version to be "0.0.0.0" and QUALITY_STABLE.
Versionoperator= (const Version &v)
bool operator== (const Version &v) const
 Equality does not test quality.
bool operator< (const Version &v) const
 Less-than does not test quality.

Public Attributes

UINT majorNumber
 Major (first) version number.
UINT minorNumber
 Minor (second) version number.
UINT revision
 Revision (third) number.
UINT build
 Build (fourth) number.
EVersionQuality quality
 Quality indicator.


Detailed Description

Represents a version with four integers, such as "1.0.2.14".

Author:
Sukender

Definition at line 39 of file Version.h.


Member Enumeration Documentation

Quality information on the version (alpha, beta, RC...).

Enumerator:
QUALITY_DEV 
QUALITY_ALPHA 
QUALITY_BETA 
QUALITY_RELEASE_CANDIDATE 
QUALITY_GAMMA 
QUALITY_STABLE 
MAX_QUALITY 

Definition at line 42 of file Version.h.


Constructor & Destructor Documentation

Version::Version ( UINT  majorNumber = 0,
UINT  minorNumber = 0,
UINT  revision = 0,
UINT  build = 0,
EVersionQuality  quality = QUALITY_STABLE 
) [inline]

Definition at line 52 of file Version.h.

Version::Version ( const Version v  )  [inline]

Definition at line 55 of file Version.h.

Version::Version ( const std::string &  str  )  [inline]

Constructs a Version object direclty from a string reprenstation (using fromString()).

Definition at line 57 of file Version.h.


Member Function Documentation

bool Version::fromString ( const std::string &  str  ) 

Parses a version text like "1.0.1.23" and stores the result into version array {1, 0, 1, 23}.

Returns:
true if parsing succeded.

Definition at line 69 of file Version.cpp.

References build, majorNumber, minorNumber, reset(), and revision.

bool Version::operator< ( const Version v  )  const [inline]

Less-than does not test quality.

Definition at line 82 of file Version.h.

References build, majorNumber, minorNumber, and revision.

Version& Version::operator= ( const Version v  )  [inline]

Definition at line 71 of file Version.h.

References build, majorNumber, minorNumber, quality, and revision.

bool Version::operator== ( const Version v  )  const [inline]

Equality does not test quality.

Definition at line 80 of file Version.h.

References build, majorNumber, minorNumber, and revision.

void Version::reset (  )  [inline]

Sets the version to be "0.0.0.0" and QUALITY_STABLE.

Definition at line 69 of file Version.h.

Referenced by fromString().

std::string Version::toShortString (  )  const

Writes a string representation of the version, limited to 2 numbers.

Definition at line 65 of file Version.cpp.

References format_str, majorNumber, minorNumber, quality, and VERSION_QUALITY_SHORT_STRS.

std::string Version::toString (  )  const

Writes a string representation of the version.

Definition at line 61 of file Version.cpp.

References build, format_str, majorNumber, minorNumber, quality, revision, and VERSION_QUALITY_SHORT_STRS.


Member Data Documentation

Build (fourth) number.

Definition at line 92 of file Version.h.

Referenced by fromString(), operator<(), operator=(), operator==(), and toString().

Major (first) version number.

Definition at line 89 of file Version.h.

Referenced by fromString(), operator<(), operator=(), operator==(), toShortString(), and toString().

Minor (second) version number.

Definition at line 90 of file Version.h.

Referenced by fromString(), operator<(), operator=(), operator==(), toShortString(), and toString().

Quality indicator.

Definition at line 94 of file Version.h.

Referenced by operator=(), toShortString(), and toString().

Revision (third) number.

Definition at line 91 of file Version.h.

Referenced by fromString(), operator<(), operator=(), operator==(), and toString().


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

Generated on Sun Jan 17 11:39:29 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9