libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal::Version Class Reference
Inheritance diagram for gimbal::Version:

Public Member Functions

 Version (GblVersion version)
 
 Version (GblVersionInfo info)
 
 Version (uint8_t major, uint16_t minor, uint8_t patch)
 
 Version (std::string_view string)
 
constexpr uint8_t getMajor (void) const
 
constexpr uint16_t getMinor (void) const
 
constexpr uint8_t getPatch (void) const
 
constexpr GblVersion getValue (void) const
 
constexpr GblVersionInfo getInfo (void) const
 
std::string toString (void) const
 

Detailed Description

Definition at line 10 of file gimbal_version.hpp.

Constructor & Destructor Documentation

◆ Version() [1/3]

gimbal::Version::Version ( GblVersion  version)
inline

Definition at line 13 of file gimbal_version.hpp.

13: PrimitiveBase(version) {}

◆ Version() [2/3]

gimbal::Version::Version ( GblVersionInfo  info)
inline

Definition at line 14 of file gimbal_version.hpp.

14: Version(GBL_VERSION_MAKE(info.major, info.minor, info.patch)) {}
#define GBL_VERSION_MAKE(major, minor, patch)
Encodes a GblVersion from its constituents.

◆ Version() [3/3]

gimbal::Version::Version ( uint8_t  major,
uint16_t  minor,
uint8_t  patch 
)
inline

Definition at line 15 of file gimbal_version.hpp.

15: Version(GblVersionInfo{ major, minor, patch }) {}

Member Function Documentation

◆ getMajor()

constexpr uint8_t gimbal::Version::getMajor ( void  ) const
inlineconstexpr

Definition at line 18 of file gimbal_version.hpp.

18{ return GBL_VERSION_EXTRACT_MAJOR(*this); }

◆ getMinor()

constexpr uint16_t gimbal::Version::getMinor ( void  ) const
inlineconstexpr

Definition at line 19 of file gimbal_version.hpp.

19{ return GBL_VERSION_EXTRACT_MINOR(*this); }

◆ getPatch()

constexpr uint8_t gimbal::Version::getPatch ( void  ) const
inlineconstexpr

Definition at line 20 of file gimbal_version.hpp.

20{ return GBL_VERSION_EXTRACT_PATCH(*this); }

◆ getValue()

constexpr GblVersion gimbal::Version::getValue ( void  ) const
inlineconstexpr

Definition at line 22 of file gimbal_version.hpp.

22{ return getPrimitiveValue(); }

◆ getInfo()

constexpr GblVersionInfo gimbal::Version::getInfo ( void  ) const
inlineconstexpr

Definition at line 23 of file gimbal_version.hpp.

23 {
24 return { getMajor(), getMinor(), getPatch() };
25 }

◆ toString()

std::string gimbal::Version::toString ( void  ) const
inline

Definition at line 27 of file gimbal_version.hpp.

27 {
28 char buffer[GBL_VERSION_STRING_SIZE_MAX] = { 0 };
29 const auto info = getInfo();
30 const GBL_RESULT result = gblVersionInfoString(&info, buffer, sizeof(buffer));
31 // GBL_ASSERT(GBL_RESULT_SUCCESS(result));
32 return buffer;
33 }
GBL_RESULT

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