MCPcopy Create free account
hub / github.com/axmolengine/axmol / textHandler

Method textHandler

core/platform/FileUtils.cpp:310–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308 }
309
310 void textHandler(void* ctx, const char* ch, size_t len) override
311 {
312 if (_state == SAX_NONE)
313 {
314 return;
315 }
316
317 SAXState curState = _stateStack.empty() ? SAX_DICT : _stateStack.top();
318 const std::string text = std::string((char*)ch, len);
319
320 switch (_state)
321 {
322 case SAX_KEY:
323 _curKey = text;
324 break;
325 case SAX_INT:
326 case SAX_REAL:
327 case SAX_STRING:
328 {
329 if (curState == SAX_DICT)
330 {
331 AXASSERT(!_curKey.empty(), "key not found : <integer/real>");
332 }
333
334 _curValue.append(text);
335 }
336 break;
337 default:
338 break;
339 }
340 }
341};
342
343ValueMap FileUtils::getValueMapFromFile(std::string_view filename) const

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.45
topMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected