MCPcopy Create free account
hub / github.com/SmingHub/Sming / getValue

Method getValue

Sming/Core/Data/Stream/SectionTemplate.cpp:492–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492String SectionTemplate::getValue(const char* name)
493{
494 if(*name == '$') {
495 ++name;
496 int i = fieldStrings.indexOf(name);
497 auto field = Field(i + 1);
498
499 switch(field) {
500 case Field::section:
501 return String(sectionIndex());
502
503 case Field::record:
504 return String(recordIndex());
505
506 case Field::unknown:
507 break;
508 }
509 }
510
511 String s;
512 if(getValueCallback) {
513 s = getValueCallback(name);
514 if(s) {
515 return s;
516 }
517 }
518
519 return TemplateStream::getValue(name);
520}
521
522bool SectionTemplate::gotoSection(uint8_t index)
523{

Callers 1

toStringMethod · 0.45

Calls 4

FieldEnum · 0.70
StringClass · 0.50
getValueFunction · 0.50
indexOfMethod · 0.45

Tested by

no test coverage detected