MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / seek

Method seek

framework/fs/physfs_archiver_cue.cpp:629–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

627 }
628
629 int seek(int64_t offset)
630 {
631 if (offset > length)
632 {
633 return 0;
634 }
635 // FIXME: This assumes the offset is more or less *sane*
636 uint32_t blockOffset = offset / blockSize();
637 uint32_t posInBlock = offset % blockSize();
638
639 lbaCurrent = lbaStart + blockOffset;
640 posInLba = posInBlock;
641 uint64_t binOffset = lbaToByteOffset(lbaCurrent) + posInLba;
642 fileStream.seekg(binOffset, std::ios::beg);
643 return fileStream.good();
644 }
645
646 PHYSFS_sint64 tell()
647 {

Callers 3

cueIoSeekMethod · 0.80
readDirMethod · 0.80
CueArchiverMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected