MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / mapDirection

Function mapDirection

Source/Node/AlignNode.cpp:45–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45std::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
55std::optional<YGAlign> mapAlign(std::string_view align) {
56 switch (Switch::hash(align)) {

Callers 1

cssMethod · 0.85

Calls 2

hashFunction · 0.50
WarnFunction · 0.50

Tested by

no test coverage detected