| 76 | } |
| 77 | |
| 78 | std::optional<YGJustify> mapJustifyContent(std::string_view justifyContent) { |
| 79 | switch (Switch::hash(justifyContent)) { |
| 80 | case "flex-start"_hash: return YGJustifyFlexStart; |
| 81 | case "center"_hash: return YGJustifyCenter; |
| 82 | case "flex-end"_hash: return YGJustifyFlexEnd; |
| 83 | case "space-between"_hash: return YGJustifySpaceBetween; |
| 84 | case "space-around"_hash: return YGJustifySpaceAround; |
| 85 | case "space-evenly"_hash: return YGJustifySpaceEvenly; |
| 86 | } |
| 87 | Warn("invalid CSS JustifyContent: \"{}\", should be one of \"flex-start\", \"center\", \"flex-end\", \"space-between\", \"space-around\" and \"space-evenly\"", justifyContent); |
| 88 | return std::nullopt; |
| 89 | } |
| 90 | |
| 91 | std::optional<YGPositionType> mapPositionType(std::string_view positionType) { |
| 92 | switch (Switch::hash(positionType)) { |