clang  3.7.0
Public Member Functions | Friends | List of all members
clang::VersionTuple Class Reference

Represents a version number in the form major[.minor[.subminor[.build]]]. 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)
 
 VersionTuple (unsigned Major, unsigned Minor, unsigned Subminor, unsigned Build, bool UsesUnderscores=false)
 
bool empty () const
 Determine whether this version information is empty (e.g., all version components are zero). More...
 
unsigned getMajor () const
 Retrieve the major version number. More...
 
Optional< unsignedgetMinor () const
 Retrieve the minor version number, if provided. More...
 
Optional< unsignedgetSubminor () const
 Retrieve the subminor version number, if provided. More...
 
Optional< unsignedgetBuild () const
 Retrieve the build version number, if provided. More...
 
bool usesUnderscores () const
 
void UseDotAsSeparator ()
 
std::string getAsString () const
 Retrieve a string representation of the version number. More...
 
bool tryParse (StringRef string)
 Try to parse the given string as a version number. More...
 

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. More...
 
bool operator!= (const VersionTuple &X, const VersionTuple &Y)
 Determine if two version numbers are not equivalent. More...
 
bool operator< (const VersionTuple &X, const VersionTuple &Y)
 Determine whether one version number precedes another. More...
 
bool operator> (const VersionTuple &X, const VersionTuple &Y)
 Determine whether one version number follows another. More...
 
bool operator<= (const VersionTuple &X, const VersionTuple &Y)
 Determine whether one version number precedes or is equivalent to another. More...
 
bool operator>= (const VersionTuple &X, const VersionTuple &Y)
 Determine whether one version number follows or is equivalent to another. More...
 

Detailed Description

Represents a version number in the form major[.minor[.subminor[.build]]].

Definition at line 26 of file VersionTuple.h.

Constructor & Destructor Documentation

clang::VersionTuple::VersionTuple ( )
inline

Definition at line 37 of file VersionTuple.h.

Referenced by tryParse().

clang::VersionTuple::VersionTuple ( unsigned  Major)
inlineexplicit

Definition at line 41 of file VersionTuple.h.

clang::VersionTuple::VersionTuple ( unsigned  Major,
unsigned  Minor,
bool  UsesUnderscores = false 
)
inlineexplicit

Definition at line 45 of file VersionTuple.h.

clang::VersionTuple::VersionTuple ( unsigned  Major,
unsigned  Minor,
unsigned  Subminor,
bool  UsesUnderscores = false 
)
inlineexplicit

Definition at line 50 of file VersionTuple.h.

clang::VersionTuple::VersionTuple ( unsigned  Major,
unsigned  Minor,
unsigned  Subminor,
unsigned  Build,
bool  UsesUnderscores = false 
)
inlineexplicit

Definition at line 56 of file VersionTuple.h.

Member Function Documentation

bool clang::VersionTuple::empty ( ) const
inline
std::string VersionTuple::getAsString ( ) const
Optional<unsigned> clang::VersionTuple::getBuild ( ) const
inline

Retrieve the build version number, if provided.

Definition at line 86 of file VersionTuple.h.

References clang::None.

Referenced by clang::operator<<().

unsigned clang::VersionTuple::getMajor ( ) const
inline
Optional<unsigned> clang::VersionTuple::getMinor ( ) const
inline
Optional<unsigned> clang::VersionTuple::getSubminor ( ) const
inline
bool VersionTuple::tryParse ( StringRef  string)

Try to parse the given string as a version number.

Returns
true if the string does not match the regular expression [0-9]+(.[0-9]+){0,3}

Definition at line 59 of file VersionTuple.cpp.

References parseInt(), and VersionTuple().

Referenced by clang::driver::tools::visualstudio::getMSVCVersion(), ParseLangArgs(), and clang::ObjCRuntime::tryParse().

void clang::VersionTuple::UseDotAsSeparator ( )
inline

Definition at line 96 of file VersionTuple.h.

Referenced by CheckAvailability().

bool clang::VersionTuple::usesUnderscores ( ) const
inline

Definition at line 92 of file VersionTuple.h.

Referenced by clang::operator<<().

Friends And Related Function Documentation

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 111 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 119 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 137 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 102 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 128 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 146 of file VersionTuple.h.


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