mirror of
https://github.com/AxioDL/LibCommon.git
synced 2026-03-30 11:47:23 -07:00
baf3acc098
We can make all of the IOUtils helpers obsolete.
35 lines
922 B
C++
35 lines
922 B
C++
#ifndef CFILEINSTREAM_H
|
|
#define CFILEINSTREAM_H
|
|
|
|
#include "IInputStream.h"
|
|
|
|
class CFileInStream : public IInputStream
|
|
{
|
|
private:
|
|
FILE *mpFStream = nullptr;
|
|
TString mName;
|
|
uint32 mFileSize = 0;
|
|
|
|
public:
|
|
CFileInStream();
|
|
explicit CFileInStream(const TString& rkFile);
|
|
explicit CFileInStream(const TString& rkFile, std::endian FileEndianness);
|
|
CFileInStream(const CFileInStream& rkSrc);
|
|
~CFileInStream() override;
|
|
|
|
void Open(const TString& rkFile, std::endian FileEndianness);
|
|
void Close();
|
|
|
|
void ReadBytes(void* pDst, uint32 Count) override;
|
|
bool Seek(int32 Offset, uint32 Origin) override;
|
|
bool Seek64(int64 Offset, uint32 Origin) override;
|
|
uint32 Tell() const override;
|
|
uint64 Tell64() const override;
|
|
bool EoF() const override;
|
|
bool IsValid() const override;
|
|
uint32 Size() const override;
|
|
TString FileName() const;
|
|
};
|
|
|
|
#endif // CFILEINSTREAM_H
|