MCPcopy Create free account
hub / github.com/MyGUI/mygui / parseTag

Method parseTag

UnitTests/UnitTest_HyperTextBox/HyperTextBox.cpp:225–483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223 }
224
225 void HyperTextBox::parseTag(std::string_view _value)
226 {
227 const std::string_view imageStartTagName = "<img";
228 const std::string_view imageEndTagName = ">";
229
230 const std::string_view paragraphStartTagName = "<p";
231 const std::string_view paragraphEndTagName = ">";
232
233 const std::string_view colourStartTagName = "<color";
234 const std::string_view colourEndTagName = ">";
235
236 const std::string_view urlStartTagName = "<url";
237 const std::string_view urlEndTagName = ">";
238
239 if (_value == "<h1>")
240 {
241 mHeader1 = true;
242 }
243 else if (_value == "</h1>")
244 {
245 mHeader1 = false;
246 }
247 else if (_value == "<h2>")
248 {
249 mHeader2 = true;
250 }
251 else if (_value == "</h2>")
252 {
253 mHeader2 = false;
254 }
255 else if (_value == "<h3>")
256 {
257 mHeader3 = true;
258 }
259 else if (_value == "</h3>")
260 {
261 mHeader3 = false;
262 }
263 else if (_value == "<b>")
264 {
265 mBold = true;
266 }
267 else if (_value == "</b>")
268 {
269 mBold = false;
270 }
271 else if (_value == "<i>")
272 {
273 mItalic = true;
274 }
275 else if (_value == "</i>")
276 {
277 mItalic = false;
278 }
279 else if (_value == "<s>")
280 {
281 mStrike = true;
282 }

Callers

nothing calls this directly

Calls 11

startWithFunction · 0.85
splitFunction · 0.85
substrMethod · 0.80
setContentAlignMethod · 0.80
setContentFloatMethod · 0.80
setSnapFloatMethod · 0.80
parseFunction · 0.50
IntCoordFunction · 0.50
sizeMethod · 0.45
clearMethod · 0.45
setSpacerMethod · 0.45

Tested by

no test coverage detected