63 NumConverter << ToConvert;
91 { this->FromString(ToParse); }
112 size_t DelimPos = ToParse.find(Delim);
113 if( DelimPos != String::npos ) {
114 ConvertToUInt16(ToParse.substr(0,DelimPos),this->Major);
115 ConvertToUInt16(ToParse.substr(DelimPos + 1),this->Minor);
126 ConvertStream << this->Major << Delim << this->Minor;
127 return ConvertStream.str();
136 { this->Major = Other.
Major; this->Minor = Other.
Minor; }
146 if( this->Major < Other.
Major )
return true;
147 else if( this->Major > Other.
Major )
return false;
148 else return ( this->Minor < Other.
Minor );
155 if( this->Major < Other.
Major )
return true;
156 else if( this->Major > Other.
Major )
return false;
157 else return ( this->Minor <= Other.
Minor );
164 if( this->Major > Other.
Major )
return true;
165 else if( this->Major < Other.
Major )
return false;
166 else return ( this->Minor > Other.
Minor );
173 if( this->Major > Other.
Major )
return true;
174 else if( this->Major < Other.
Major )
return false;
175 else return ( this->Minor >= Other.
Minor );
182 {
return ( this->Major == Other.
Major && this->Minor == Other.
Minor ); }
187 {
return ( this->Major != Other.
Major || this->Minor != Other.
Minor ); }
205 NumConverter << ToConvert;
235 PreRelease(Other.PreRelease),
236 MetaData(Other.MetaData)
241 { this->FromString(ToParse); }
262 MetaData(VerMetaData)
279 size_t DelimPos = ToParse.find(
'.');
280 if( DelimPos != String::npos ) {
281 ConvertToUInt16(ToParse.substr(StartPos,DelimPos),TempVer.
Major);
283 StartPos = DelimPos + 1;
284 DelimPos = ToParse.find(
'.',StartPos);
285 if( DelimPos != String::npos ) {
286 ConvertToUInt16(ToParse.substr(StartPos,DelimPos - StartPos),TempVer.
Minor);
288 StartPos = DelimPos + 1;
289 DelimPos = ToParse.find_first_of(
"-+",StartPos);
290 ConvertToUInt16(ToParse.substr(StartPos,DelimPos - StartPos),TempVer.
Patch);
291 if( DelimPos != String::npos && ToParse.at(DelimPos) ==
'-' ) {
292 StartPos = DelimPos + 1;
293 DelimPos = ToParse.find(
'+',StartPos);
294 TempVer.
PreRelease = ToParse.substr(StartPos,DelimPos - StartPos);
296 if( DelimPos != String::npos && ToParse.at(DelimPos) ==
'+' ) {
297 StartPos = DelimPos + 1;
298 TempVer.
MetaData = ToParse.substr(StartPos);
314 ConvertStream << this->Major <<
'.' << this->Minor <<
'.' << this->Patch;
315 if( !this->PreRelease.empty() ) {
316 ConvertStream <<
'-' << this->PreRelease;
318 if( !this->MetaData.empty() ) {
319 ConvertStream <<
'+' << this->MetaData;
321 return ConvertStream.str();
331 this->Major = Other.
Major;
332 this->Minor = Other.
Minor;
333 this->Patch = Other.
Patch;
347 if( this->Major < Other.
Major )
return true;
348 else if( this->Major > Other.
Major )
return false;
350 if( this->Minor < Other.
Minor )
return true;
351 else if( this->Minor > Other.
Minor )
return false;
353 if( this->Patch < Other.
Patch )
return true;
354 else if( this->Patch > Other.
Patch )
return false;
356 return ( this->PreRelease < Other.
PreRelease );
364 if( this->Major < Other.
Major )
return true;
365 else if( this->Major > Other.
Major )
return false;
367 if( this->Minor < Other.
Minor )
return true;
368 else if( this->Minor > Other.
Minor )
return false;
370 if( this->Patch < Other.
Patch )
return true;
371 else if( this->Patch > Other.
Patch )
return false;
373 return ( this->PreRelease <= Other.
PreRelease );
381 if( this->Major > Other.
Major )
return true;
382 else if( this->Major < Other.
Major )
return false;
384 if( this->Minor > Other.
Minor )
return true;
385 else if( this->Minor < Other.
Minor )
return false;
387 if( this->Patch > Other.
Patch )
return true;
388 else if( this->Patch < Other.
Patch )
return false;
390 return ( this->PreRelease > Other.
PreRelease );
398 if( this->Major > Other.
Major )
return true;
399 else if( this->Major < Other.
Major )
return false;
401 if( this->Minor > Other.
Minor )
return true;
402 else if( this->Minor < Other.
Minor )
return false;
404 if( this->Patch > Other.
Patch )
return true;
405 else if( this->Patch < Other.
Patch )
return false;
407 return ( this->PreRelease >= Other.
PreRelease );
414 {
return ( this->Major == Other.
Major && this->Minor == Other.
Minor && this->Patch == Other.
Patch && this->PreRelease == Other.
PreRelease ); }
419 {
return ( this->Major != Other.
Major || this->Minor != Other.
Minor || this->Patch != Other.
Patch || this->PreRelease != Other.
PreRelease ); }
void operator=(const SimpleVersion &Other)
Assignment operator.
SimpleVersion(const SimpleVersion &Other)
Copy Constructor.
void ConvertToUInt16(const String &ToConvert, UInt16 &Var)
Convenience method for converting text to numbers.
SemanticVersion(const UInt16 VerMajor, const UInt16 VerMinor, const UInt16 VerPatch, const String &VerDesc, const String &VerMetaData)
Descriptive Constructor.
bool Boole
Generally acts a single bit, true or false.
SimpleVersion(const UInt16 VerMajor, const UInt16 VerMinor)
Number Constructor.
Boole operator==(const SimpleVersion &Other) const
Equality comparison operator.
UInt16 Patch
The Patch component of the version to be expressed.
A Version class matching the Semantic Version specification.
SemanticVersion(const SemanticVersion &Other)
Copy Constructor.
SemanticVersion(const String &ToParse)
Parse Constructor.
Boole operator!=(const SimpleVersion &Other) const
Inequality comparison operator.
All the definitions for datatypes as well as some basic conversion functions are defined here...
void operator=(const SemanticVersion &Other)
Assignment operator.
SimpleVersion(const String &ToParse)
String Constructor.
Boole operator<(const SimpleVersion &Other) const
Less than comparison operator.
UInt16 Major
The Major component of the version to be expressed.
UInt16 Major
The Major component of the version to be expressed.
SimpleVersion()
Blank Constructor.
Boole operator!=(const SemanticVersion &Other) const
Inequality comparison operator.
Boole operator>(const SimpleVersion &Other) const
Greater than comparison operator.
String PreRelease
An optional pre-release string providing additional context for the version.
std::stringstream StringStream
A Datatype used for streaming operations with strings.
UInt16 Minor
The Minor component of the version to be expressed.
char Char8
A datatype to represent one character.
uint16_t UInt16
An 16-bit unsigned integer.
Boole operator>=(const SimpleVersion &Other) const
Greater than or equal to comparison operator.
Boole FromString(const String &ToParse, const Char8 Delim= '.')
Parses a String expressing a simple version.
A very basic class for expressing an API or syntax version.
Boole operator>=(const SemanticVersion &Other) const
Greater than or equal to comparison operator.
Boole operator>(const SemanticVersion &Other) const
Greater than comparison operator.
String ToString() const
Converts this version into a String.
SemanticVersion()
Blank Constructor.
Boole FromString(const String &ToParse)
Parses a String expressing a simple version.
Boole operator<=(const SimpleVersion &Other) const
Less than or equal to comparison operator.
Boole operator<(const SemanticVersion &Other) const
Less than comparison operator.
The bulk of the engine components go in this namspace.
String ToString(const Char8 Delim= '.') const
Converts this version into a String.
UInt16 Minor
The Minor component of the version to be expressed.
String MetaData
An optional component for build meta data associated with the version.
Boole operator==(const SemanticVersion &Other) const
Equality comparison operator.
void ConvertToUInt16(const String &ToConvert, UInt16 &Var)
Convenience method for converting text to numbers.
std::string String
A datatype used to a series of characters.
SemanticVersion(const UInt16 VerMajor, const UInt16 VerMinor, const UInt16 VerPatch)
Number Component Constructor.
Boole operator<=(const SemanticVersion &Other) const
Less than or equal to comparison operator.