Skip to content

Commit

Permalink
adding toString and fromRawValue conversion to view/accessibilityProp…
Browse files Browse the repository at this point in the history
…sConversions
  • Loading branch information
fabOnReact committed Nov 14, 2022
1 parent 3357873 commit 2fed660
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,26 @@ inline void fromRawValue(
const PropsParserContext &context,
const RawValue &value,
AccessibilityUnit &result) {
auto map = (butter::map<std::string, RawValue>)value;
/*
// don't use std::string instead use RawValue and add a toString conversion
auto map = (butter::map<std::string, std::string>)value;
auto hours = map.find("hours");
if (hours != map.end()) {
// This probably calls toString()
fromRawValue(context, hours->second, result.hours);
result.hours = hours->second;
}
*/
/*
if (value.hasType<std::string>()) {
auto string = "10";
auto string = toString(value);
result.hours = string;
} else {
LOG(ERROR) << "Can not set type string for AccessibilityUnit field hours";
}
*/
}

inline std::string toString(
const AccessibilityUnit &accessibilityUnit) {
return "default string";
}

inline std::string toString(
Expand Down

0 comments on commit 2fed660

Please sign in to comment.