| 43 | } |
| 44 | |
| 45 | std::optional<YGDirection> mapDirection(std::string_view dir) { |
| 46 | switch (Switch::hash(dir)) { |
| 47 | case "ltr"_hash: return YGDirectionLTR; |
| 48 | case "rtl"_hash: return YGDirectionRTL; |
| 49 | case "inherit"_hash: return YGDirectionInherit; |
| 50 | } |
| 51 | Warn("invalid CSS Direction: \"{}\", should be one of \"ltr\", \"rtl\" and \"inherit\"", dir); |
| 52 | return std::nullopt; |
| 53 | } |
| 54 | |
| 55 | std::optional<YGAlign> mapAlign(std::string_view align) { |
| 56 | switch (Switch::hash(align)) { |