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...
 
std::string str () const
 A string representation as major.minor. More...
 
int canonical () const noexcept
 From version to canonical integer value. More...
 
int compare (const versionNumber &other) const noexcept
 Compare differences in the versions. More...
 

Static Public Member Functions

static versionNumber canonical (int verNum) noexcept
 From canonical integer value to version. 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::canonical(), and 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 173 of file IOstreamOption.C.

References dict, keyType::LITERAL, dictionary::readIfPresent(), and IOstreamOption::versionNumber::versionNumber().

Here is the call graph for this function:

Member Function Documentation

◆ str()

std::string str ( ) const
inline

A string representation as major.minor.

Definition at line 126 of file IOstreamOption.H.

◆ canonical() [1/2]

int canonical ( ) const
inlinenoexcept

From version to canonical integer value.

Definition at line 137 of file IOstreamOption.H.

Referenced by decomposedBlockData::readBlocks(), and decomposedBlockData::writeData().

Here is the caller graph for this function:

◆ canonical() [2/2]

static versionNumber canonical ( int  verNum)
inlinestaticnoexcept

From canonical integer value to version.

Definition at line 143 of file IOstreamOption.H.

References IOstreamOption::versionNumber::versionNumber().

Here is the call graph for this function:

◆ 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 152 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:

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