Files
Aerofoil/unpacktool/IFileReader.h
Diomendius 5c74c96771 Add unpacktool to CMake, port to *nix
- Adds missing includes, removes some unused ones.
- Removes unused Windows.h and shellapi.h includes.
- Uses / as path separator. This is portable and should still work fine
  on Windows.
2024-08-06 01:28:44 +12:00

24 lines
503 B
C++

#pragma once
#include <cstddef>
#include <cstdint>
struct IFileReader
{
public:
typedef int64_t FilePos_t;
typedef uint64_t UFilePos_t;
virtual size_t Read(void *buffer, size_t sz) = 0;
virtual size_t FileSize() const = 0;
virtual bool SeekStart(FilePos_t pos) = 0;
virtual bool SeekCurrent(FilePos_t pos) = 0;
virtual bool SeekEnd(FilePos_t pos) = 0;
virtual FilePos_t GetPosition() const = 0;
inline bool ReadExact(void *buffer, size_t sz)
{
return this->Read(buffer, sz) == sz;
}
};