mirror of
https://github.com/NoelFB/blah.git
synced 2025-06-29 19:25:26 +08:00
Lots of documentation & commenting
This commit is contained in:
@ -8,7 +8,7 @@ namespace Blah
|
||||
{
|
||||
public:
|
||||
FileStream();
|
||||
FileStream(const char* path, FileMode mode = FileMode::ReadWrite);
|
||||
FileStream(const FilePath& path, FileMode mode = FileMode::ReadWrite);
|
||||
FileStream(FileStream&& fs) noexcept;
|
||||
FileStream& operator=(FileStream&& fs) noexcept;
|
||||
~FileStream();
|
||||
@ -16,9 +16,9 @@ namespace Blah
|
||||
virtual i64 length() const override;
|
||||
virtual i64 position() const override;
|
||||
virtual i64 seek(i64 seekTo) override;
|
||||
virtual bool is_open() const override { return m_handle != nullptr; }
|
||||
virtual bool is_readable() const override { return m_handle != nullptr && (m_mode == FileMode::ReadWrite || m_mode == FileMode::Read); }
|
||||
virtual bool is_writable() const override { return m_handle != nullptr && (m_mode == FileMode::ReadWrite || m_mode == FileMode::Write); }
|
||||
virtual bool is_open() const override;
|
||||
virtual bool is_readable() const override;
|
||||
virtual bool is_writable() const override;
|
||||
virtual void close() override;
|
||||
|
||||
protected:
|
||||
@ -26,7 +26,7 @@ namespace Blah
|
||||
virtual i64 write_from(const void* ptr, i64 length) override;
|
||||
|
||||
private:
|
||||
FileMode m_mode;
|
||||
void* m_handle;
|
||||
FileMode m_mode;
|
||||
void* m_handle;
|
||||
};
|
||||
}
|
@ -36,7 +36,7 @@ namespace Blah
|
||||
// closes the stream
|
||||
virtual void close() = 0;
|
||||
|
||||
// pipes the contents of this tream to another stream
|
||||
// pipes the contents of this stream to another stream
|
||||
i64 pipe(Stream& to, i64 length);
|
||||
|
||||
// reads the amount of bytes into the given buffer, and returns the amount read
|
||||
|
Reference in New Issue
Block a user