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

Method gotoSection

Sming/Core/Data/Stream/SectionStream.cpp:72–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72bool 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
97void SectionStream::nextSection()
98{

Callers 2

onFileFunction · 0.45
executeMethod · 0.45

Calls 1

seekFromMethod · 0.45

Tested by 1

executeMethod · 0.36