mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Support for (de)serializing config values (#42750)
Summary: X-link: https://github.com/facebook/yoga/pull/1571 Pull Request resolved: https://github.com/facebook/react-native/pull/42750 tsia. This is state we need to capture as it can drastically affect the benchmark times Reviewed By: NickGerleman Differential Revision: D53203385 fbshipit-source-id: 47178458d039df90fb15d8a420f9e0f17e4fe6ca
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3c2b2b181c
commit
e1afa023aa
-35
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// @generated by enums.py
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
public enum YogaPrintOptions {
|
||||
LAYOUT(1),
|
||||
STYLE(2),
|
||||
CHILDREN(4);
|
||||
|
||||
private final int mIntValue;
|
||||
|
||||
YogaPrintOptions(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
public int intValue() {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static YogaPrintOptions fromInt(int value) {
|
||||
switch (value) {
|
||||
case 1: return LAYOUT;
|
||||
case 2: return STYLE;
|
||||
case 4: return CHILDREN;
|
||||
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -223,18 +223,6 @@ const char* YGPositionTypeToString(const YGPositionType value) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
const char* YGPrintOptionsToString(const YGPrintOptions value) {
|
||||
switch (value) {
|
||||
case YGPrintOptionsLayout:
|
||||
return "layout";
|
||||
case YGPrintOptionsStyle:
|
||||
return "style";
|
||||
case YGPrintOptionsChildren:
|
||||
return "children";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
const char* YGUnitToString(const YGUnit value) {
|
||||
switch (value) {
|
||||
case YGUnitUndefined:
|
||||
|
||||
@@ -120,13 +120,6 @@ YG_ENUM_DECL(
|
||||
YGPositionTypeRelative,
|
||||
YGPositionTypeAbsolute)
|
||||
|
||||
YG_ENUM_DECL(
|
||||
YGPrintOptions,
|
||||
YGPrintOptionsLayout = 1,
|
||||
YGPrintOptionsStyle = 2,
|
||||
YGPrintOptionsChildren = 4)
|
||||
YG_DEFINE_ENUM_FLAG_OPERATORS(YGPrintOptions)
|
||||
|
||||
YG_ENUM_DECL(
|
||||
YGUnit,
|
||||
YGUnitUndefined,
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// @generated by enums.py
|
||||
// clang-format off
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <yoga/YGEnums.h>
|
||||
#include <yoga/enums/YogaEnums.h>
|
||||
|
||||
namespace facebook::yoga {
|
||||
|
||||
enum class PrintOptions : uint32_t {
|
||||
Layout = YGPrintOptionsLayout,
|
||||
Style = YGPrintOptionsStyle,
|
||||
Children = YGPrintOptionsChildren,
|
||||
};
|
||||
|
||||
YG_DEFINE_ENUM_FLAG_OPERATORS(PrintOptions)
|
||||
|
||||
constexpr PrintOptions scopedEnum(YGPrintOptions unscoped) {
|
||||
return static_cast<PrintOptions>(unscoped);
|
||||
}
|
||||
|
||||
constexpr YGPrintOptions unscopedEnum(PrintOptions scoped) {
|
||||
return static_cast<YGPrintOptions>(scoped);
|
||||
}
|
||||
|
||||
inline const char* toString(PrintOptions e) {
|
||||
return YGPrintOptionsToString(unscopedEnum(e));
|
||||
}
|
||||
|
||||
} // namespace facebook::yoga
|
||||
Reference in New Issue
Block a user