mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Fabric: Text types conversions & better debug printing
Summary: Trivial. Reviewed By: fkgozali Differential Revision: D7863489 fbshipit-source-id: c7b9852e104ca12eea144473ed8e1f2973a36df7
This commit is contained in:
committed by
Facebook Github Bot
parent
37652f26b4
commit
582e1bded3
@@ -20,6 +20,7 @@ rn_xplat_cxx_library(
|
||||
header_namespace = "",
|
||||
exported_headers = subdir_glob(
|
||||
[
|
||||
("", "*.h"),
|
||||
("primitives", "*.h"),
|
||||
("componentdescriptor", "*.h"),
|
||||
("layout", "*.h"),
|
||||
|
||||
20
ReactCommon/fabric/core/debugStringConvertibleUtils.h
Normal file
20
ReactCommon/fabric/core/debugStringConvertibleUtils.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <fabric/debug/debugStringConvertibleUtils.h>
|
||||
#include <fabric/core/layoutValuesConversions.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
DEBUG_STRING_CONVERTIBLE_TEMPLATE(LayoutDirection, stringFromLayoutDirection)
|
||||
DEBUG_STRING_CONVERTIBLE_TEMPLATE(DisplayType, stringFromDisplayType)
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
32
ReactCommon/fabric/core/layout/layoutValuesConversions.h
Normal file
32
ReactCommon/fabric/core/layout/layoutValuesConversions.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <fabric/core/LayoutPrimitives.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
inline std::string stringFromLayoutDirection(const LayoutDirection &layoutDirection) {
|
||||
switch (layoutDirection) {
|
||||
case LayoutDirection::Undefined: return "undefined";
|
||||
case LayoutDirection::LeftToRight: return "ltr";
|
||||
case LayoutDirection::RightToLeft: return "rtl";
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string stringFromDisplayType(const DisplayType &displayType) {
|
||||
switch (displayType) {
|
||||
case DisplayType::None: return "none";
|
||||
case DisplayType::Flex: return "flex";
|
||||
case DisplayType::Inline: return "inline";
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
Reference in New Issue
Block a user