clang API Documentation
Represents a version number in the form major[.minor[.subminor]]. More...
#include <VersionTuple.h>
Public Member Functions | |
VersionTuple () | |
VersionTuple (unsigned Major) | |
VersionTuple (unsigned Major, unsigned Minor, bool UsesUnderscores=false) | |
VersionTuple (unsigned Major, unsigned Minor, unsigned Subminor, bool UsesUnderscores=false) | |
bool | empty () const |
Determine whether this version information is empty (e.g., all version components are zero). | |
unsigned | getMajor () const |
Retrieve the major version number. | |
Optional< unsigned > | getMinor () const |
Retrieve the minor version number, if provided. | |
Optional< unsigned > | getSubminor () const |
Retrieve the subminor version number, if provided. | |
bool | usesUnderscores () const |
void | UseDotAsSeparator () |
std::string | getAsString () const |
Retrieve a string representation of the version number. | |
bool | tryParse (StringRef string) |
Try to parse the given string as a version number. | |
Friends | |
bool | operator== (const VersionTuple &X, const VersionTuple &Y) |
Determine if two version numbers are equivalent. If not provided, minor and subminor version numbers are considered to be zero. | |
bool | operator!= (const VersionTuple &X, const VersionTuple &Y) |
Determine if two version numbers are not equivalent. | |
bool | operator< (const VersionTuple &X, const VersionTuple &Y) |
Determine whether one version number precedes another. | |
bool | operator> (const VersionTuple &X, const VersionTuple &Y) |
Determine whether one version number follows another. | |
bool | operator<= (const VersionTuple &X, const VersionTuple &Y) |
Determine whether one version number precedes or is equivalent to another. | |
bool | operator>= (const VersionTuple &X, const VersionTuple &Y) |
Determine whether one version number follows or is equivalent to another. |
Represents a version number in the form major[.minor[.subminor]].
Definition at line 26 of file VersionTuple.h.
clang::VersionTuple::VersionTuple | ( | ) | [inline] |
Definition at line 35 of file VersionTuple.h.
Referenced by tryParse().
clang::VersionTuple::VersionTuple | ( | unsigned | Major | ) | [inline, explicit] |
Definition at line 39 of file VersionTuple.h.
clang::VersionTuple::VersionTuple | ( | unsigned | Major, |
unsigned | Minor, | ||
bool | UsesUnderscores = false |
||
) | [inline, explicit] |
Definition at line 44 of file VersionTuple.h.
clang::VersionTuple::VersionTuple | ( | unsigned | Major, |
unsigned | Minor, | ||
unsigned | Subminor, | ||
bool | UsesUnderscores = false |
||
) | [inline, explicit] |
Definition at line 50 of file VersionTuple.h.
bool clang::VersionTuple::empty | ( | ) | const [inline] |
Determine whether this version information is empty (e.g., all version components are zero).
Definition at line 58 of file VersionTuple.h.
Referenced by CheckAvailability(), checkAvailabilityAttr(), clang::AvailabilityChange::isValid(), clang::Sema::mergeAvailabilityAttr(), and versionsMatch().
std::string VersionTuple::getAsString | ( | ) | const |
Retrieve a string representation of the version number.
Definition at line 19 of file VersionTuple.cpp.
Referenced by clang::driver::toolchains::Darwin::addMinVersionArgs(), checkAvailabilityAttr(), clang::driver::toolchains::Darwin::ComputeEffectiveClangTriple(), and clang::Sema::mergeAvailabilityAttr().
unsigned clang::VersionTuple::getMajor | ( | ) | const [inline] |
Retrieve the major version number.
Definition at line 61 of file VersionTuple.h.
Referenced by clang::ASTWriter::AddVersionTuple(), InitializePredefinedMacros(), and clang::operator<<().
Optional<unsigned> clang::VersionTuple::getMinor | ( | ) | const [inline] |
Retrieve the minor version number, if provided.
Definition at line 64 of file VersionTuple.h.
Referenced by clang::ASTWriter::AddVersionTuple(), InitializePredefinedMacros(), and clang::operator<<().
Optional<unsigned> clang::VersionTuple::getSubminor | ( | ) | const [inline] |
Retrieve the subminor version number, if provided.
Definition at line 71 of file VersionTuple.h.
Referenced by clang::ASTWriter::AddVersionTuple(), InitializePredefinedMacros(), and clang::operator<<().
bool VersionTuple::tryParse | ( | StringRef | string | ) |
Try to parse the given string as a version number.
true
if the string does not match the regular expression [0-9]+(\.[0-9]+(\.[0-9]+)) Definition at line 57 of file VersionTuple.cpp.
References parseInt(), and VersionTuple().
Referenced by clang::ObjCRuntime::tryParse().
void clang::VersionTuple::UseDotAsSeparator | ( | ) | [inline] |
Definition at line 81 of file VersionTuple.h.
Referenced by CheckAvailability().
bool clang::VersionTuple::usesUnderscores | ( | ) | const [inline] |
Definition at line 77 of file VersionTuple.h.
Referenced by clang::operator<<().
bool operator!= | ( | const VersionTuple & | X, |
const VersionTuple & | Y | ||
) | [friend] |
Determine if two version numbers are not equivalent.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 95 of file VersionTuple.h.
bool operator< | ( | const VersionTuple & | X, |
const VersionTuple & | Y | ||
) | [friend] |
Determine whether one version number precedes another.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 103 of file VersionTuple.h.
bool operator<= | ( | const VersionTuple & | X, |
const VersionTuple & | Y | ||
) | [friend] |
Determine whether one version number precedes or is equivalent to another.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 121 of file VersionTuple.h.
bool operator== | ( | const VersionTuple & | X, |
const VersionTuple & | Y | ||
) | [friend] |
Determine if two version numbers are equivalent. If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 87 of file VersionTuple.h.
bool operator> | ( | const VersionTuple & | X, |
const VersionTuple & | Y | ||
) | [friend] |
Determine whether one version number follows another.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 112 of file VersionTuple.h.
bool operator>= | ( | const VersionTuple & | X, |
const VersionTuple & | Y | ||
) | [friend] |
Determine whether one version number follows or is equivalent to another.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 130 of file VersionTuple.h.