wavelength 1.0.0
Loading...
Searching...
No Matches
filestreambuffer.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
5#include "os/file.h"
6#include "os/streambuffer.h"
7
15public:
24 FileStreamBuffer(const char *pszPath, int nFlags);
25
33
40 void Poll() override;
41
50 void Rewind() override;
51
59 bool IsClosed() const;
60
62 File *GetFile() const {
63 return mFile.get();
64 }
65
66private:
67 int mDelivered;
68 std::unique_ptr<File> mFile;
69 char *mReadBuffer;
70 int mReserved30; // +0x30, cleared by the constructor and not yet identified.
71 int mReserved34; // +0x34, cleared by the constructor and not yet identified.
72};
FileStreamBuffer(const char *pszPath, int nFlags)
Open a file and start the first read.
File * GetFile() const
Definition filestreambuffer.h:62
void Poll() override
Append the bytes of a finished read, then read as many bytes as the buffer has room for.
void Rewind() override
Seek the file back to its start and clear mInputDone.
bool IsClosed() const
Report whether the file failed to open.
~FileStreamBuffer() override
Close the file and free the read buffer.
Open file of the host or the disc.
Definition file.h:29
StreamBuffer(unsigned int size)
Allocate the buffer.