mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-04 21:09:21 +08:00
Fabric: toString methods were moved into DebugStringConvertible with an implementation in .cpp file
Summary: They need to be in DebugStringConvertible because it depends on they (and because `debugStringConvertibleUtils` depends on `DebugStringConvertible`). We also moved they implementation to cpp file to avoid leaking Folly's features to consumer namespace. Reviewed By: mdvacca Differential Revision: D14715080 fbshipit-source-id: 7277e17b39a14a2d7ba7e5a9b44a70178feb1045
This commit is contained in:
committed by
Facebook Github Bot
parent
97e064b696
commit
cabc9d1ab3
@@ -12,8 +12,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <folly/Conv.h>
|
||||
#include <folly/Optional.h>
|
||||
#include <react/debug/DebugStringConvertible.h>
|
||||
#include <react/debug/DebugStringConvertibleItem.h>
|
||||
|
||||
@@ -22,22 +20,6 @@ namespace react {
|
||||
|
||||
#if RN_DEBUG_STRING_CONVERTIBLE
|
||||
|
||||
inline std::string toString(const std::string &value) {
|
||||
return value;
|
||||
}
|
||||
inline std::string toString(const int &value) {
|
||||
return folly::to<std::string>(value);
|
||||
}
|
||||
inline std::string toString(const bool &value) {
|
||||
return folly::to<std::string>(value);
|
||||
}
|
||||
inline std::string toString(const float &value) {
|
||||
return folly::to<std::string>(value);
|
||||
}
|
||||
inline std::string toString(const double &value) {
|
||||
return folly::to<std::string>(value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline SharedDebugStringConvertible
|
||||
debugStringConvertibleItem(std::string name, T value, T defaultValue = {}) {
|
||||
|
||||
Reference in New Issue
Block a user