Loading...
Searching...
No Matches
SdrVersion Class Reference

SdrVersion. More...

#include <declare.h>

Public Member Functions

SDR_API SdrVersion ()=default
 Create an invalid version.
 
SDR_API SdrVersion (int major, int minor=0)
 Create a version with the given major and minor numbers.
 
SDR_API SdrVersion (const std::string &x)
 Create a version from a string.
 
SDR_API SdrVersion GetAsDefault () const
 Return an equal version marked as default.
 
SDR_API int GetMajor () const
 Return the major version number or zero for an invalid version.
 
SDR_API int GetMinor () const
 Return the minor version number or zero for an invalid version.
 
SDR_API bool IsDefault () const
 Return true iff this version is marked as default.
 
SDR_API std::string GetString () const
 Return the version as a string.
 
SDR_API std::string GetStringSuffix () const
 Return the version as a identifier suffix.
 
SDR_API std::size_t GetHash () const
 Return a hash for the version.
 
SDR_API operator bool () const
 Return true iff the version is valid.
 
SDR_API bool operator! () const
 Return true iff the version is invalid.
 

Friends

SDR_API friend bool operator== (const SdrVersion &lhs, const SdrVersion &rhs)
 Return true iff versions are equal.
 
SDR_API friend bool operator!= (const SdrVersion &lhs, const SdrVersion &rhs)
 Return true iff versions are not equal.
 
SDR_API friend bool operator< (const SdrVersion &lhs, const SdrVersion &rhs)
 Return true iff the left side is less than the right side.
 
SDR_API friend bool operator<= (const SdrVersion &lhs, const SdrVersion &rhs)
 Return true iff the left side is less than or equal to the right side.
 
SDR_API friend bool operator> (const SdrVersion &lhs, const SdrVersion &rhs)
 Return true iff the left side is greater than the right side.
 
SDR_API friend bool operator>= (const SdrVersion &lhs, const SdrVersion &rhs)
 Return true iff the left side is greater than or equal to the right side.
 

Detailed Description

SdrVersion.

Definition at line 67 of file declare.h.

Constructor & Destructor Documentation

◆ SdrVersion() [1/3]

SDR_API SdrVersion ( )
default

Create an invalid version.

◆ SdrVersion() [2/3]

SDR_API SdrVersion ( int  major,
int  minor = 0 
)

Create a version with the given major and minor numbers.

Numbers must be non-negative, and at least one must be non-zero.
On failure generates an error and yields an invalid version.

◆ SdrVersion() [3/3]

SDR_API SdrVersion ( const std::string &  x)

Create a version from a string.

On failure generates an error and yields an invalid version.

Member Function Documentation

◆ GetAsDefault()

SDR_API SdrVersion GetAsDefault ( ) const
inline

Return an equal version marked as default.

It's permitted to mark an invalid version as the default.

Definition at line 85 of file declare.h.

◆ GetHash()

SDR_API std::size_t GetHash ( ) const
inline

Return a hash for the version.

Definition at line 110 of file declare.h.

◆ GetMajor()

SDR_API int GetMajor ( ) const
inline

Return the major version number or zero for an invalid version.

Definition at line 92 of file declare.h.

◆ GetMinor()

SDR_API int GetMinor ( ) const
inline

Return the minor version number or zero for an invalid version.

Definition at line 95 of file declare.h.

◆ GetString()

SDR_API std::string GetString ( ) const

Return the version as a string.

◆ GetStringSuffix()

SDR_API std::string GetStringSuffix ( ) const

Return the version as a identifier suffix.

◆ IsDefault()

SDR_API bool IsDefault ( ) const
inline

Return true iff this version is marked as default.

Definition at line 98 of file declare.h.

◆ operator bool()

SDR_API operator bool ( ) const
inlineexplicit

Return true iff the version is valid.

Definition at line 118 of file declare.h.

◆ operator!()

SDR_API bool operator! ( ) const
inline

Return true iff the version is invalid.

Definition at line 125 of file declare.h.

Friends And Related Function Documentation

◆ operator!=

SDR_API friend bool operator!= ( const SdrVersion lhs,
const SdrVersion rhs 
)
friend

Return true iff versions are not equal.

Definition at line 139 of file declare.h.

◆ operator<

SDR_API friend bool operator< ( const SdrVersion lhs,
const SdrVersion rhs 
)
friend

Return true iff the left side is less than the right side.

Definition at line 146 of file declare.h.

◆ operator<=

SDR_API friend bool operator<= ( const SdrVersion lhs,
const SdrVersion rhs 
)
friend

Return true iff the left side is less than or equal to the right side.

Definition at line 154 of file declare.h.

◆ operator==

SDR_API friend bool operator== ( const SdrVersion lhs,
const SdrVersion rhs 
)
friend

Return true iff versions are equal.

Definition at line 132 of file declare.h.

◆ operator>

SDR_API friend bool operator> ( const SdrVersion lhs,
const SdrVersion rhs 
)
friend

Return true iff the left side is greater than the right side.

Definition at line 162 of file declare.h.

◆ operator>=

SDR_API friend bool operator>= ( const SdrVersion lhs,
const SdrVersion rhs 
)
friend

Return true iff the left side is greater than or equal to the right side.

Definition at line 169 of file declare.h.


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