| Flutter Impeller |

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
impeller::Version Struct Reference

`#include <version.h>`

## Public Member Functions
constexpr | Version (size_t p_major=0, size_t p_minor=0, size_t p_patch=0)
constexpr bool | IsAtLeast (const Version &other) const
std::string | ToString () const

## Static Public Member Functions
static std::optional< Version > | FromVector (const std::vector< size_t > &version)

## Public Attributes
size_t | major_version
size_t | minor_version
size_t | patch_version

## Detailed Description

Definition at line 16 of file version.h.

## Constructor & Destructor Documentation

## ◆ Version()

constexpr impeller::Version::Version | ( | size_t | p_major = `0`,
|  | size_t | p_minor = `0`,
|  | size_t | p_patch = `0`
| ) |  |
| inlineexplicitconstexpr

Definition at line 22 of file version.h.

25 : major_version(p_major),
26 minor_version(p_minor),
27 patch_version(p_patch) {}

## Member Function Documentation

## ◆ FromVector()

std::optional< Version > impeller::Version::FromVector | ( | const std::vector< size_t > & | version | ) |
| static

Definition at line 11 of file version.cc.

11 {
12 if (version.size() == 0) {
13 return Version{0, 0, 0};
14 }
15 if (version.size() == 1) {
16 return Version{version[0], 0, 0};
17 }
18 if (version.size() == 2) {
19 return Version{version[0], version[1], 0};
20 }
21 if (version.size() == 3) {
22 return Version{version[0], version[1], version[2]};
23 }
24 return std::nullopt;
25 }

Referenced by impeller::DetermineVersion().

## ◆ IsAtLeast()

constexpr bool impeller::Version::IsAtLeast | ( | const Version & | other | ) | const
| inlineconstexpr

Definition at line 31 of file version.h.

31 {
32 return std::tie(major_version, minor_version, patch_version) >=
33 std::tie(other.major_version, other.minor_version,
34 other.patch_version);
35 }

References major_version, minor_version, and patch_version.

Referenced by impeller::DescriptionGLES::DescriptionGLES().

## ◆ ToString()

std::string impeller::Version::ToString | ( |  | ) | const

Definition at line 27 of file version.cc.

27 {
28 std::stringstream stream;
29 stream << major_version << "." << minor_version << "." << patch_version;
30 return stream.str();
31 }

References major_version, minor_version, and patch_version.

Referenced by impeller::DriverInfoVK::DumpToLog().

## Member Data Documentation

## ◆ major_version

size_t impeller::Version::major_version

Definition at line 18 of file version.h.

Referenced by IsAtLeast(), and ToString().

## ◆ minor_version

size_t impeller::Version::minor_version

Definition at line 19 of file version.h.

Referenced by IsAtLeast(), and ToString().

## ◆ patch_version

size_t impeller::Version::patch_version

Definition at line 20 of file version.h.

Referenced by IsAtLeast(), and ToString().

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

- impeller/base/version.h
- impeller/base/version.cc

impeller::Version::patch_version
size_t patch_version
Definition: version.h:20
impeller::Version::minor_version
size_t minor_version
Definition: version.h:19
impeller::Version::major_version
size_t major_version
Definition: version.h:18
impeller::Version::Version
constexpr Version(size_t p_major=0, size_t p_minor=0, size_t p_patch=0)
Definition: version.h:22