class Version
Defined at line 68 of file ../../tools/fidl/fidlc/src/versioning_types.h
A version represents a particular state of a platform.
The primary use case of FIDL versioning is to version the "fuchsia" platform
by API level, so versions are designed to accommodate API levels. A version
is one of the following 32-bit unsigned integers:
Normal
1, ..., 2^31-1
Special: see RFC-0246 for the definitions
0xFFD00000 NEXT
0xFFE00000 HEAD
0xFFF00000 PLATFORM / LEGACY
Infinite: only used internally to simplify algorithms
0x00000000 -inf
0xFFFFFFFF +inf
All others (i.e. 2^31 and up, apart from the listed exceptions) are invalid.
Public Members
static Version kNegInf
static Version kPosInf
static Version kNext
static Version kHead
static Version kLegacy
static const Version[] kSpecialVersions
Public Methods
std::optional<Version> From (uint32_t number)
Succeeds if `number` corresponds to a valid finite version.
std::optional<Version> Parse (std::string_view str)
Succeeds if `str` is the decimal number or name of a valid finite version.
std::string_view name ()
Returns the version's name. Panics if this is not a special version.
std::string ToString ()
Returns the RFC-0246 canonical string representation of the version.
Version Predecessor ()
Returns the version that comes before this one. Panics if infinite.
Version Successor ()
Returns the version that comes after this one. Panics if infinite.
uint32_t number ()
Returns the version's underlying number.
Defined at line 76 of file ../../tools/fidl/fidlc/src/versioning_types.h
bool operator== (const Version & rhs)
Defined at line 86 of file ../../tools/fidl/fidlc/src/versioning_types.h
bool operator!= (const Version & rhs)
Defined at line 87 of file ../../tools/fidl/fidlc/src/versioning_types.h
bool operator< (const Version & rhs)
Defined at line 88 of file ../../tools/fidl/fidlc/src/versioning_types.h
bool operator<= (const Version & rhs)
Defined at line 89 of file ../../tools/fidl/fidlc/src/versioning_types.h
bool operator> (const Version & rhs)
Defined at line 90 of file ../../tools/fidl/fidlc/src/versioning_types.h
bool operator>= (const Version & rhs)
Defined at line 91 of file ../../tools/fidl/fidlc/src/versioning_types.h