MCPcopy Create free account
hub / github.com/comaps/comaps / Parse

Method Parse

libs/drape_frontend/gui/skin.cpp:76–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 ResolverParser() : m_element(Element::Empty) {}
75
76 void Parse(std::string_view attr, char const * value)
77 {
78 ASSERT(m_element != Element::Empty, ());
79
80 if (attr == "x")
81 {
82 ASSERT(m_element == Element::Offset, ());
83 m_resolver.SetOffsetX(ParseFloat(value));
84 }
85 else if (attr == "y")
86 {
87 ASSERT(m_element == Element::Offset, ());
88 m_resolver.SetOffsetY(ParseFloat(value));
89 }
90 else if (attr == "vertical" || attr == "horizontal")
91 {
92 if (m_element == Element::Anchor)
93 m_resolver.AddAnchor(ParseValueAnchor(value));
94 else if (m_element == Element::Relative)
95 m_resolver.AddRelative(ParseValueAnchor(value));
96 else
97 ASSERT(false, ());
98 }
99 }
100
101 void Reset() { m_resolver = PositionResolver(); }
102

Callers 1

AddAttrMethod · 0.45

Calls 7

ASSERTFunction · 0.85
ParseFloatFunction · 0.85
ParseValueAnchorFunction · 0.85
SetOffsetXMethod · 0.80
SetOffsetYMethod · 0.80
AddAnchorMethod · 0.80
AddRelativeMethod · 0.80

Tested by

no test coverage detected