clang API Documentation

Public Member Functions | Friends
clang::VersionTuple Class Reference

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

#include <VersionTuple.h>

List of all members.

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< unsignedgetMinor () const
 Retrieve the minor version number, if provided.
Optional< unsignedgetSubminor () 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.

Detailed Description

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

Definition at line 26 of file VersionTuple.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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 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.

Returns:
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().

Definition at line 81 of file VersionTuple.h.

Referenced by CheckAvailability().

Definition at line 77 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 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.


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