/src/yoga/yoga/enums/Unit.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) Meta Platforms, Inc. and affiliates. |
3 | | * |
4 | | * This source code is licensed under the MIT license found in the |
5 | | * LICENSE file in the root directory of this source tree. |
6 | | */ |
7 | | |
8 | | // @generated by enums.py |
9 | | // clang-format off |
10 | | #pragma once |
11 | | |
12 | | #include <cstdint> |
13 | | #include <yoga/YGEnums.h> |
14 | | #include <yoga/enums/YogaEnums.h> |
15 | | |
16 | | namespace facebook::yoga { |
17 | | |
18 | | enum class Unit : uint8_t { |
19 | | Undefined = YGUnitUndefined, |
20 | | Point = YGUnitPoint, |
21 | | Percent = YGUnitPercent, |
22 | | Auto = YGUnitAuto, |
23 | | MaxContent = YGUnitMaxContent, |
24 | | FitContent = YGUnitFitContent, |
25 | | Stretch = YGUnitStretch, |
26 | | }; |
27 | | |
28 | | template <> |
29 | 0 | constexpr int32_t ordinalCount<Unit>() { |
30 | 0 | return 7; |
31 | 0 | } |
32 | | |
33 | 0 | constexpr Unit scopedEnum(YGUnit unscoped) { |
34 | 0 | return static_cast<Unit>(unscoped); |
35 | 0 | } |
36 | | |
37 | 0 | constexpr YGUnit unscopedEnum(Unit scoped) { |
38 | 0 | return static_cast<YGUnit>(scoped); |
39 | 0 | } |
40 | | |
41 | 0 | inline const char* toString(Unit e) { |
42 | 0 | return YGUnitToString(unscopedEnum(e)); |
43 | 0 | } |
44 | | |
45 | | } // namespace facebook::yoga |