Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Mezzanine::SimpleVersion Class Reference

A very basic class for expressing an API or syntax version. More...

#include <version.h>

Public Member Functions

 SimpleVersion ()
 Blank Constructor.
 
 SimpleVersion (const SimpleVersion &Other)
 Copy Constructor. More...
 
 SimpleVersion (const String &ToParse)
 String Constructor. More...
 
 SimpleVersion (const UInt16 VerMajor, const UInt16 VerMinor)
 Number Constructor. More...
 
Boole FromString (const String &ToParse, const Char8 Delim= '.')
 Parses a String expressing a simple version. More...
 
Boole operator!= (const SimpleVersion &Other) const
 Inequality comparison operator. More...
 
Boole operator< (const SimpleVersion &Other) const
 Less than comparison operator. More...
 
Boole operator<= (const SimpleVersion &Other) const
 Less than or equal to comparison operator. More...
 
void operator= (const SimpleVersion &Other)
 Assignment operator. More...
 
Boole operator== (const SimpleVersion &Other) const
 Equality comparison operator. More...
 
Boole operator> (const SimpleVersion &Other) const
 Greater than comparison operator. More...
 
Boole operator>= (const SimpleVersion &Other) const
 Greater than or equal to comparison operator. More...
 
String ToString (const Char8 Delim= '.') const
 Converts this version into a String. More...
 

Public Attributes

UInt16 Major
 The Major component of the version to be expressed.
 
UInt16 Minor
 The Minor component of the version to be expressed.
 

Protected Member Functions

void ConvertToUInt16 (const String &ToConvert, UInt16 &Var)
 Convenience method for converting text to numbers. More...
 

Detailed Description

A very basic class for expressing an API or syntax version.

Definition at line 53 of file version.h.

Constructor & Destructor Documentation

Mezzanine::SimpleVersion::SimpleVersion ( const SimpleVersion Other)
inline

Copy Constructor.

Parameters
OtherThe other SimpleVersion to be copied.

Definition at line 83 of file version.h.

Mezzanine::SimpleVersion::SimpleVersion ( const String ToParse)
inline

String Constructor.

Parameters
ToParseThe String to be parsed.

Definition at line 90 of file version.h.

Mezzanine::SimpleVersion::SimpleVersion ( const UInt16  VerMajor,
const UInt16  VerMinor 
)
inline

Number Constructor.

Parameters
VerMajorThe Major component of the version to be expressed.
VerMinorThe Minor component of the version to be expressed.

Definition at line 96 of file version.h.

Member Function Documentation

void Mezzanine::SimpleVersion::ConvertToUInt16 ( const String ToConvert,
UInt16 Var 
)
inlineprotected

Convenience method for converting text to numbers.

Remarks
Other methods in the mezzanine to do this exist, but creating a basic implementation here to avoid a dependency for one small simple thing.
Parameters
ToConvertThe String to be converted.
VarThe UInt16 to populate from the provided String.

Definition at line 60 of file version.h.

Boole Mezzanine::SimpleVersion::FromString ( const String ToParse,
const Char8  Delim = '.' 
)
inline

Parses a String expressing a simple version.

Remarks
This method expects a short character sequence where the middle character is the Delimiter separating the two components.
Parameters
ToParseThe String to be parsed.
DelimThe delimiter to be used for separating the version components.
Returns
Returns true if the String was successfully parsed, false if there was a failure.

Definition at line 109 of file version.h.

Boole Mezzanine::SimpleVersion::operator!= ( const SimpleVersion Other) const
inline

Inequality comparison operator.

Parameters
OtherThe other SimpleVersion to be compared to.
Returns
Returns true if the two SimpleVersions are inequal.

Definition at line 186 of file version.h.

Boole Mezzanine::SimpleVersion::operator< ( const SimpleVersion Other) const
inline

Less than comparison operator.

Parameters
OtherThe other SimpleVersion to be compared to.
Returns
Returns true if this compares less than the other SimpleVersion.

Definition at line 144 of file version.h.

Boole Mezzanine::SimpleVersion::operator<= ( const SimpleVersion Other) const
inline

Less than or equal to comparison operator.

Parameters
OtherThe other SimpleVersion to be compared to.
Returns
Returns true if this compares less than or equal to the other SimpleVersion.

Definition at line 153 of file version.h.

void Mezzanine::SimpleVersion::operator= ( const SimpleVersion Other)
inline

Assignment operator.

Parameters
OtherThe other SimpleVersion to assign to this.

Definition at line 135 of file version.h.

Boole Mezzanine::SimpleVersion::operator== ( const SimpleVersion Other) const
inline

Equality comparison operator.

Parameters
OtherThe other SimpleVersion to be compared to.
Returns
Returns true if the two SimpleVersions are equal.

Definition at line 181 of file version.h.

Boole Mezzanine::SimpleVersion::operator> ( const SimpleVersion Other) const
inline

Greater than comparison operator.

Parameters
OtherThe other SimpleVersion to be compared to.
Returns
Returns true if this compares greater than the other SimpleVersion.

Definition at line 162 of file version.h.

Boole Mezzanine::SimpleVersion::operator>= ( const SimpleVersion Other) const
inline

Greater than or equal to comparison operator.

Parameters
OtherThe other SimpleVersion to be compared to.
Returns
Returns true if this compares greater than or equal to the other SimpleVersion.

Definition at line 171 of file version.h.

String Mezzanine::SimpleVersion::ToString ( const Char8  Delim = '.') const
inline

Converts this version into a String.

Parameters
DelimThe delimiter to be used for separating the version components.
Returns
Returns a String expressing this version.

Definition at line 123 of file version.h.


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