| 70 | } |
| 71 | |
| 72 | bool SectionStream::gotoSection(uint8_t index) |
| 73 | { |
| 74 | if(index >= sectionCount) { |
| 75 | debug_e("gotoSection: %u out of range", index); |
| 76 | return false; |
| 77 | } |
| 78 | |
| 79 | auto& sect = sections[index]; |
| 80 | |
| 81 | if(stream->seekFrom(sect.start, SeekOrigin::Start) != int(sect.start)) { |
| 82 | return false; |
| 83 | } |
| 84 | |
| 85 | readOffset = sect.start; |
| 86 | sectionOffset = 0; |
| 87 | sect.recordIndex = -1; |
| 88 | currentSectionIndex = int(index) - 1; |
| 89 | finished = false; |
| 90 | sections[index].recordCount = 0; |
| 91 | |
| 92 | nextSection(); |
| 93 | |
| 94 | return true; |
| 95 | } |
| 96 | |
| 97 | void SectionStream::nextSection() |
| 98 | { |