file seek support, new test cases, AVI use file seek
This commit is contained in:
@@ -32,6 +32,16 @@ public:
|
||||
std::string getName() const {return h.getName();}
|
||||
|
||||
|
||||
/** current position within the file */
|
||||
uint32_t curPos() const {
|
||||
return curAbsPos;
|
||||
}
|
||||
|
||||
/** seek to a new position within the file */
|
||||
void seekTo(uint32_t pos) {
|
||||
_seekTo(pos);
|
||||
}
|
||||
|
||||
/** read x bytes from the file */
|
||||
uint32_t read(uint32_t size, uint8_t* dst) {
|
||||
|
||||
@@ -105,6 +115,12 @@ private:
|
||||
|
||||
}
|
||||
|
||||
void _seekTo(uint32_t pos) {
|
||||
this->curAbsPos = pos;
|
||||
this->iCurCluster = pos / fs.tmp.bytesPerCluster;
|
||||
this->posInCluster = pos - (this->iCurCluster * fs.tmp.bytesPerCluster);
|
||||
}
|
||||
|
||||
int32_t _read(uint32_t readSize, uint8_t* dst) {
|
||||
|
||||
// EOF reached?
|
||||
|
||||
Reference in New Issue
Block a user