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

A Version class matching the Semantic Version specification. More...

#include <version.h>

+ Collaboration diagram for Mezzanine::SemanticVersion:

Public Member Functions

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

Public Attributes

UInt16 Major
 The Major component of the version to be expressed.
 
String MetaData
 An optional component for build meta data associated with the version.
 
UInt16 Minor
 The Minor component of the version to be expressed.
 
UInt16 Patch
 The Patch component of the version to be expressed.
 
String PreRelease
 An optional pre-release string providing additional context for the version.
 

Protected Member Functions

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

Detailed Description

A Version class matching the Semantic Version specification.

Definition at line 195 of file version.h.

Constructor & Destructor Documentation

Mezzanine::SemanticVersion::SemanticVersion ( const SemanticVersion Other)
inline

Copy Constructor.

Parameters
OtherThe other SemanticVersion to be copied.

Definition at line 231 of file version.h.

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

Parse Constructor.

Parameters
ToParseThe String to be parsed.

Definition at line 240 of file version.h.

Mezzanine::SemanticVersion::SemanticVersion ( const UInt16  VerMajor,
const UInt16  VerMinor,
const UInt16  VerPatch 
)
inline

Number Component Constructor.

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

Definition at line 246 of file version.h.

Mezzanine::SemanticVersion::SemanticVersion ( const UInt16  VerMajor,
const UInt16  VerMinor,
const UInt16  VerPatch,
const String VerDesc,
const String VerMetaData 
)
inline

Descriptive Constructor.

Parameters
VerMajorThe Major component of the version to be expressed.
VerMinorThe Minor component of the version to be expressed.
VerPatchThe Patch component of the version to be expressed.
VerDescAn optional description string providing additional context for the version.
VerMetaDataAn optional component for build meta data associated with the version.

Definition at line 257 of file version.h.

Member Function Documentation

void Mezzanine::SemanticVersion::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 202 of file version.h.

Boole Mezzanine::SemanticVersion::FromString ( const String ToParse)
inline

Parses a String expressing a simple version.

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

Definition at line 272 of file version.h.

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

Inequality comparison operator.

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

Definition at line 418 of file version.h.

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

Less than comparison operator.

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

Definition at line 344 of file version.h.

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

Less than or equal to comparison operator.

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

Definition at line 361 of file version.h.

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

Assignment operator.

Parameters
OtherThe other SemanticVersion to assign to this.

Definition at line 329 of file version.h.

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

Equality comparison operator.

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

Definition at line 413 of file version.h.

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

Greater than comparison operator.

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

Definition at line 378 of file version.h.

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

Greater than or equal to comparison operator.

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

Definition at line 395 of file version.h.

String Mezzanine::SemanticVersion::ToString ( ) const
inline

Converts this version into a String.

Returns
Returns a String expressing this version.

Definition at line 311 of file version.h.


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