Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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< VersionFromVector (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) {}
size_t patch_version
Definition version.h:20
size_t minor_version
Definition version.h:19
size_t major_version
Definition version.h:18

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}
Version

◆ 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 }

◆ 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}

Member Data Documentation

◆ major_version

size_t impeller::Version::major_version

Definition at line 18 of file version.h.

◆ minor_version

size_t impeller::Version::minor_version

Definition at line 19 of file version.h.

◆ patch_version

size_t impeller::Version::patch_version

Definition at line 20 of file version.h.


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