40 #ifndef _resourcedatastream_h
41 #define _resourcedatastream_h
98 virtual StreamSize
GetSize()
const = 0;
133 virtual size_t Read(
void* Buffer, StreamSize Size) = 0;
163 virtual size_t Write(
const void* Buffer, StreamSize Size) = 0;
208 virtual size_t Read(
void* Buffer, StreamSize Size);
249 virtual size_t Write(
const void* Buffer, StreamSize Size);
290 virtual size_t Read(
void* Buffer, StreamSize Size);
303 virtual size_t Write(
const void* Buffer, StreamSize Size);
317 virtual void Advance(
const StreamOff Count);
virtual size_t Read(void *Buffer, StreamSize Size)
Reads from the stream and copies that data to a buffer.
virtual StreamPos GetReadPosition()
Gets the current read position in this stream.
virtual Boole Fail() const
Gets whether or not an otherwise silent and recoverable error was detected in a previous operation in...
virtual size_t ReadLine(Char8 *Buffer, size_t MaxCount, const String &Delim="\n")
Reads a single line from a string.
OStream(std::streambuf *Buf)
Class constructor.
virtual Boole IsValid() const
Gets whether or not this stream is intact and ready for operations.
Clear the contents of the file when opening. Note that this will also create the file if it's not fou...
bool Boole
Generally acts a single bit, true or false.
virtual String GetLine(Boole Trim=true)
Gets the contents of the current line in the stream.
Tell the stream that the file in question is Binary.
Base class interface for resource streams.
virtual ~IOStream()
Class destructor.
virtual void ClearErrors()=0
Clears any stored error state on the stream.
CountedPtr< IStream > IStreamPtr
Convenience type for a standard input stream in a CountedPtr.
virtual size_t Write(const void *Buffer, StreamSize Size)
Writes data to the stream.
virtual Boole Bad() const
Gets whether or not a critical error was detected in a previous operation in the stream.
virtual ~iOutStream()
Class destructor.
virtual void SetReadPosition(StreamPos Position)
Sets the position of the read cursor explicitly.
All the definitions for datatypes as well as some basic conversion functions are defined here...
virtual Boole Fail() const =0
Gets whether or not an otherwise silent and recoverable error was detected in a previous operation in...
virtual Boole EoF() const =0
Gets whether or not the current position is at the end of the stream.
A simple reference counting pointer.
virtual void SetWritePosition(StreamPos Position)
Sets the position of the write cursor explicitly.
virtual size_t Read(void *Buffer, StreamSize Size)=0
Reads from the stream and copies that data to a buffer.
virtual void SetWritePosition(StreamPos Position)
Sets the position of the write cursor explicitly.
CountedPtr< StdStream > StdStreamPtr
Convenience type for a standard input/output stream in a CountedPtr.
The current position for read/write operations in the stream.
virtual Boole Fail() const
Gets whether or not an otherwise silent and recoverable error was detected in a previous operation in...
All write operations on the stream are done at the end of the stream.
virtual Boole EoF() const
Gets whether or not the current position is at the end of the stream.
Base class for streams that support both read and write operations.
virtual StreamPos GetReadPosition()
Gets the current read position in this stream.
virtual StreamPos GetWritePosition()
Gets the current write position in this stream.
char Char8
A datatype to represent one character.
std::istream StdInputStream
Convenience type for a standard input stream.
Interface class for output (write) streams.
virtual StreamPos GetWritePosition()=0
Gets the current write position in this stream.
virtual ~iStreamBase()
Class destructor.
iStreamBase()
Class constructor.
IOStream DataStream
Convenience type for compatibility.
virtual size_t Read(void *Buffer, StreamSize Size)
Reads from the stream and copies that data to a buffer.
Permit write operations on the stream.
virtual Boole Fail() const
Gets whether or not an otherwise silent and recoverable error was detected in a previous operation in...
virtual void ClearErrors()
Clears any stored error state on the stream.
virtual void SetReadPosition(StreamPos Position)
Sets the position of the read cursor explicitly.
virtual ~iInStream()
Class destructor.
iOutStream()
Class constructor.
Moves the starting position of the stream to the end upon initialization.
virtual Boole Bad() const
Gets whether or not a critical error was detected in a previous operation in the stream.
virtual ~OStream()
Class destructor.
The beginning of the stream.
Base class for output (write) streams with minimal implementation.
virtual Boole EoF() const
Gets whether or not the current position is at the end of the stream.
This file describes and implements a reference counted pointer that is NOT threadsafe.
virtual size_t SkipLine(const String &Delim="\n")
Moves the current position to the start of the next line.
SeekOrigin
An enum describing which position should be considered the origin for changing the current position i...
IStream(std::streambuf *Buf)
Class constructor.
virtual void ClearErrors()
Clears any stored error state on the stream.
virtual StreamSize GetSize() const =0
Gets the size of the stream.
virtual void Advance(const StreamOff Count)
Advances the position in the stream.
virtual void ClearErrors()
Clears any stored error state on the stream.
CountedPtr< StdInputStream > StdInputStreamPtr
Convenience type for a standard input stream in a CountedPtr.
virtual StreamPos GetWritePosition()
Gets the current write position in this stream.
virtual Boole EoF() const
Gets whether or not the current position is at the end of the stream.
virtual size_t Write(const void *Buffer, StreamSize Size)=0
Writes data to the stream.
virtual Boole Bad() const
Gets whether or not a critical error was detected in a previous operation in the stream.
StreamFlags
This enum describes the flags that control certain behaviors of a stream.
The bulk of the engine components go in this namspace.
IOStream(std::streambuf *Buf)
Class constructor.
virtual void SetReadPosition(StreamPos Position)=0
Sets the position of the read cursor explicitly.
Interface class for input (read) streams.
virtual StreamPos GetReadPosition()=0
Gets the current read position in this stream.
virtual Boole IsValid() const =0
Gets whether or not this stream is intact and ready for operations.
virtual String GetAsString()
Gets the contents of the stream as a string.
std::streamsize StreamSize
Convenience define for the stream size datatype.
CountedPtr< StdOutputStream > StdOutputStreamPtr
Convenience type for a standard output stream in a CountedPtr.
virtual Boole IsValid() const
Gets whether or not this stream is intact and ready for operations.
std::streampos StreamPos
Convenience define for the stream position datatype.
std::streamoff StreamOff
Convenience define for the stream offset datatype.
CountedPtr< OStream > OStreamPtr
Convenience type for a standard output stream in a CountedPtr.
virtual size_t Write(const void *Buffer, StreamSize Size)
Writes data to the stream.
virtual void SetWritePosition(StreamPos Position)=0
Sets the position of the write cursor explicitly.
CountedPtr< DataStream > DataStreamPtr
This is a convenience type for a data stream in a counted pointer.
virtual ~IStream()
Class destructor.
std::ostream StdOutputStream
Convenience type for a standard output stream.
virtual void SetStreamPosition(StreamPos Position)
Sets the position of the read and write cursors explicitly.
virtual Boole Bad() const =0
Gets whether or not a critical error was detected in a previous operation in the stream.
Error/no special initialization.
std::string String
A datatype used to a series of characters.
virtual Boole IsValid() const
Gets whether or not this stream is intact and ready for operations.
virtual StreamPos GetStreamPosition(const Boole Read=true)
Gets the current position in this stream.
std::iostream StdStream
Convenience type for a standard input/output stream.
iInStream()
Class constructor.
Base class for input (read) streams with minimal implementation.
Permit read operations on the stream.