| Flutter Impeller |

version.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #pragma once
6
7 #include <cstddef>
8 #include <optional>
9 #include <string>
10 #include <tuple>
11 #include <vector>
12
13 namespace impeller {
14
15 struct Version {
16 public:
17 size_t major_version;
18 size_t minor_version;
19 size_t patch_version;
20
21 constexpr explicit Version(size_t p_major = 0,
22 size_t p_minor = 0,
23 size_t p_patch = 0)
24 : major_version(p_major),
25 minor_version(p_minor),
26 patch_version(p_patch) {}
27
28 static std::optional<Version> FromVector(const std::vector<size_t>& version);
29
30 constexpr bool IsAtLeast(const Version& other) {
31 return std::tie(major_version, minor_version, patch_version) >=
32 std::tie(other.major_version, other.minor_version,
33 other.patch_version);
34 }
35
36 std::string ToString() const;
37 };
38
39 } // namespace impeller
impeller::Version::IsAtLeast
constexpr bool IsAtLeast(const Version &other)
Definition: version.h:30
impeller::Version
Definition: version.h:15
impeller::Version::patch_version
size_t patch_version
Definition: version.h:19
impeller::Version::ToString
std::string ToString() const
Definition: version.cc:27
impeller::Version::FromVector
static std::optional< Version > FromVector(const std::vector< size_t > &version)
Definition: version.cc:11
impeller::Version::minor_version
size_t minor_version
Definition: version.h:18
impeller::Version::major_version
size_t major_version
Definition: version.h:17
impeller
Definition: aiks_context.cc:10
impeller::Version::Version
constexpr Version(size_t p_major=0, size_t p_minor=0, size_t p_patch=0)
Definition: version.h:21