| 490 | } |
| 491 | |
| 492 | String 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 | |
| 522 | bool SectionTemplate::gotoSection(uint8_t index) |
| 523 | { |