wavelength 1.0.0
Loading...
Searching...
No Matches
FileStream.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/File.h"
4#include "utl/BinStream.h"
5
12class FileStream : public BinStream {
13public:
15 enum FileType {
16 kRead = 0,
17 kWrite = 1,
18 };
19
29 FileStream(const char *file, FileType type, bool littleEndian, int flags);
30
36 virtual ~FileStream();
37
45 virtual void Read(void *data, int bytes);
46
54 virtual void Write(const void *data, int bytes);
55
61 virtual void Flush();
62
70 virtual void Seek(int offset, SeekType type);
71
76 virtual int Tell();
77
82 virtual bool Eof();
83
88 virtual bool Fail();
89
90private:
91 File *mFile;
92 bool mFail;
93};
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
SeekType
Origins of Seek().
Definition binstream.h:25
BinStream that reads or writes a file.
Definition filestream.h:14
virtual void Read(void *data, int bytes)
Read bytes.
virtual ~FileStream()
Close the file.
virtual void Seek(int offset, SeekType type)
Move the position.
FileType
How the file is opened.
Definition FileStream.h:15
@ kWrite
Definition FileStream.h:17
@ kRead
Definition FileStream.h:16
virtual int Tell()
virtual bool Fail()
virtual bool Eof()
virtual void Write(const void *data, int bytes)
Write bytes.
FileStream(const char *file, FileType type, bool littleEndian, int flags)
Open a file.
virtual void Flush()
Write out the file's buffered data.
Open file of the host or the disc.
Definition file.h:29