Fabric: Using templates to generate convertRawProp and debugStringConvertibleItem functions

Summary:
This diff opens a diffstack where we migrate the generation of all prop conversions (convertRawProp) and pretty-printing (debugStringConvertibleItem) functions to C++ templates (instead of using `#define`s).
So, this diff implements base versions of those functions as templated functions.
For now we still need #define-based version, but eventually, we will get rid of it.

Reviewed By: fkgozali

Differential Revision: D7958247

fbshipit-source-id: 24346297c1bd17e8054758f0eb84698eebfa21e2
This commit is contained in:
Valentin Shergin
2018-05-14 15:43:40 -07:00
committed by Facebook Github Bot
parent 2b827c9f13
commit 03fb77cc95
4 changed files with 29 additions and 2 deletions

View File

@@ -8,6 +8,7 @@
#include "ParagraphLocalData.h"
#include <fabric/debug/debugStringConvertibleUtils.h>
#include <fabric/attributedstring/debugStringConvertibleUtils.h>
namespace facebook {
namespace react {
@@ -38,7 +39,7 @@ std::string ParagraphLocalData::getDebugName() const {
SharedDebugStringConvertibleList ParagraphLocalData::getDebugProps() const {
return {
debugStringConvertibleItem("attributedString", attributedString_)
debugStringConvertibleItem("attributedString", attributedString_, "")
};
}