IOstreamOption::versionNumber Class Reference

Representation of a major/minor version number. More...

Public Member Functions

constexpr versionNumber () noexcept
 
constexpr versionNumber (int major, int minor) noexcept
 Construct from major, number. More...
 
constexpr versionNumber (const float ver) noexcept
 Construct from floating-point version number. More...
 
 versionNumber (const std::string &verNum)
 Construct by parsing string "major.minor". More...
 
 versionNumber (const token &tok)
 Construct from token (float, word, string) More...
 
 versionNumber (const word &keyword, const dictionary &dict)
 Failsafe construct from dictionary lookup. More...
 
int compare (const versionNumber &other) const noexcept
 Compare differences in the versions. More...
 
int canonical () noexcept
 The canonical major/minor pair as an integer value. More...
 
int getMajor () const noexcept
 Return the major version number. More...
 
int getMinor () const noexcept
 Return the minor version number. More...
 
std::string str () const
 A string representation of major.minor. More...
 

Detailed Description

Representation of a major/minor version number.

Definition at line 85 of file IOstreamOption.H.

Constructor & Destructor Documentation

◆ versionNumber() [1/6]

constexpr versionNumber ( )
inlineconstexprnoexcept

Default construct current version. The value (2.0) corresponds to the current version.

Definition at line 96 of file IOstreamOption.H.

Referenced by IOstreamOption::versionNumber::versionNumber().

Here is the caller graph for this function:

◆ versionNumber() [2/6]

constexpr versionNumber ( int  major,
int  minor 
)
inlineconstexprnoexcept

Construct from major, number.

Definition at line 102 of file IOstreamOption.H.

◆ versionNumber() [3/6]

constexpr versionNumber ( const float  ver)
inlineexplicitconstexprnoexcept

Construct from floating-point version number.

Definition at line 108 of file IOstreamOption.H.

◆ versionNumber() [4/6]

versionNumber ( const std::string &  verNum)
explicit

Construct by parsing string "major.minor".

Definition at line 144 of file IOstreamOption.C.

◆ versionNumber() [5/6]

versionNumber ( const token tok)
explicit

Construct from token (float, word, string)

Definition at line 150 of file IOstreamOption.C.

References token::info(), token::isNumber(), token::isStringType(), Foam::nl, token::number(), token::stringToken(), IOstreamOption::versionNumber::versionNumber(), and WarningInFunction.

Here is the call graph for this function:

◆ versionNumber() [6/6]

versionNumber ( const word keyword,
const dictionary dict 
)

Failsafe construct from dictionary lookup.

Definition at line 174 of file IOstreamOption.C.

References dict, and keyType::LITERAL.

Member Function Documentation

◆ compare()

int compare ( const versionNumber other) const
inlinenoexcept

Compare differences in the versions.

Negative when 'this' is less than other. Positive when 'this' is greater than other.

Definition at line 128 of file IOstreamOption.H.

Referenced by Foam::operator!=(), Foam::operator<(), Foam::operator<=(), Foam::operator==(), Foam::operator>(), and Foam::operator>=().

Here is the caller graph for this function:

◆ canonical()

int canonical ( )
inlinenoexcept

The canonical major/minor pair as an integer value.

Definition at line 134 of file IOstreamOption.H.

◆ getMajor()

int getMajor ( ) const
inlinenoexcept

Return the major version number.

Definition at line 140 of file IOstreamOption.H.

Referenced by IOstreamOption::versionNumber::str().

Here is the caller graph for this function:

◆ getMinor()

int getMinor ( ) const
inlinenoexcept

Return the minor version number.

Definition at line 146 of file IOstreamOption.H.

Referenced by IOstreamOption::versionNumber::str().

Here is the caller graph for this function:

◆ str()

std::string str ( ) const
inline

A string representation of major.minor.

Definition at line 152 of file IOstreamOption.H.

References IOstreamOption::versionNumber::getMajor(), and IOstreamOption::versionNumber::getMinor().

Referenced by decomposedBlockData::writeData().

Here is the call graph for this function:
Here is the caller graph for this function:

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