Spinning Topp Logo BlackTopp Studios
inc
datastream.h
Go to the documentation of this file.
1 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 #ifndef _resourcedatastream_h
41 #define _resourcedatastream_h
42 
43 #include "datatypes.h"
44 #include "countedptr.h"
45 
46 #include <iostream>
47 
48 /// @file
49 /// @brief Declaration of DataStream
50 /// @todo Investigate how required these stream implementations are
51 
52 namespace Mezzanine
53 {
54  namespace Resource
55  {
56  /// @brief Convenience define for the stream position datatype.
57  typedef std::streampos StreamPos;
58  /// @brief Convenience define for the stream offset datatype.
59  typedef std::streamoff StreamOff;
60  /// @brief Convenience define for the stream size datatype.
61  typedef std::streamsize StreamSize;
62 
63  /// @brief This enum describes the flags that control certain behaviors of a stream.
64  /// @details It is important to note that not all of these flags are used by all streams.
66  {
67  SF_None = 0, ///< Error/no special initialization.
68  SF_Read = std::ios_base::in, ///< Permit read operations on the stream.
69  SF_Write = std::ios_base::out, ///< Permit write operations on the stream.
70  SF_Append = std::ios_base::app, ///< All write operations on the stream are done at the end of the stream.
71  SF_AtEnd = std::ios_base::ate, ///< Moves the starting position of the stream to the end upon initialization.
72  SF_Binary = std::ios_base::binary, ///< Tell the stream that the file in question is Binary.
73  SF_Truncate = std::ios_base::trunc ///< Clear the contents of the file when opening. Note that this will also create the file if it's not found.
74  };
75 
76  /// @brief An enum describing which position should be considered the origin for changing the current position in a stream.
78  {
79  SO_Beginning = std::ios_base::beg, ///< The beginning of the stream.
80  SO_Current = std::ios_base::cur, ///< The current position for read/write operations in the stream.
81  SO_End = std::ios_base::end ///< The end of the stream.
82  };
83 
84  ///////////////////////////////////////////////////////////////////////////////
85  /// @brief Base class interface for resource streams.
86  /// @details
87  ///////////////////////////////////////
89  {
90  public:
91  /// @brief Class constructor.
93  /// @brief Class destructor.
94  virtual ~iStreamBase() { }
95 
96  /// @brief Gets the size of the stream.
97  /// @return Returns the size of this stream in bytes.
98  virtual StreamSize GetSize() const = 0;
99  /// @brief Gets whether or not the current position is at the end of the stream.
100  /// @return Returns true if the current position has reached the end of the stream, false otherwise.
101  virtual Boole EoF() const = 0;
102  /// @brief Gets whether or not a critical error was detected in a previous operation in the stream.
103  /// @return Returns true if a critical error has occurred and the stream integrity may be invalid, false otherwise.
104  virtual Boole Bad() const = 0;
105  /// @brief Gets whether or not an otherwise silent and recoverable error was detected in a previous operation in the stream.
106  /// @return Returns true if a non-critical operation failed (such as seek), false otherwise.
107  virtual Boole Fail() const = 0;
108  /// @brief Gets whether or not this stream is intact and ready for operations.
109  /// @return Returns true if no failures have been detected, false otherwise.
110  virtual Boole IsValid() const = 0;
111  /// @brief Clears any stored error state on the stream.
112  /// @remarks This is useful for non-critical errors such as ones that cause "EoF()" or "Fail()" to return true but not
113  /// "Bad()". Using this to clear critical errors is not advised.
114  virtual void ClearErrors() = 0;
115  };//iStreamBase
116 
117  ///////////////////////////////////////////////////////////////////////////////
118  /// @brief Interface class for input (read) streams.
119  /// @details
120  ///////////////////////////////////////
121  class iInStream : virtual public iStreamBase
122  {
123  public:
124  /// @brief Class constructor.
125  iInStream() { }
126  /// @brief Class destructor.
127  virtual ~iInStream() { }
128 
129  /// @brief Reads from the stream and copies that data to a buffer.
130  /// @param Buffer The buffer to be populated with the read data.
131  /// @param Size The number of bytes to read from the stream.
132  /// @return Returns the number of bytes successfully read.
133  virtual size_t Read(void* Buffer, StreamSize Size) = 0;
134 
135  /// @brief Sets the position of the read cursor explicitly.
136  /// @param Position The position to be set.
137  virtual void SetReadPosition(StreamPos Position) = 0;
138  /// @brief Sets the position of the read cursor.
139  /// @param Offset The number of bytes to move the read cursor back(if negative) or forward(if positive).
140  /// @param Origin The starting point to be considered for the offset.
141  virtual void SetReadPosition(StreamOff Offset, SeekOrigin Origin) = 0;
142  /// @brief Gets the current read position in this stream.
143  /// @return Returns a StreamPos representing the current read position.
144  virtual StreamPos GetReadPosition() = 0;
145  };//iInStream
146 
147  ///////////////////////////////////////////////////////////////////////////////
148  /// @brief Interface class for output (write) streams.
149  /// @details
150  ///////////////////////////////////////
151  class iOutStream : virtual public iStreamBase
152  {
153  public:
154  /// @brief Class constructor.
156  /// @brief Class destructor.
157  virtual ~iOutStream() { }
158 
159  /// @brief Writes data to the stream.
160  /// @param Buffer The memory buffer to write to this stream.
161  /// @param Size The size of the buffer being passed in.
162  /// @return Returns the number of bytes successfully written.
163  virtual size_t Write(const void* Buffer, StreamSize Size) = 0;
164 
165  /// @brief Sets the position of the write cursor explicitly.
166  /// @param Position The position to be set.
167  virtual void SetWritePosition(StreamPos Position) = 0;
168  /// @brief Sets the position of the write cursor.
169  /// @param Offset The number of bytes to move the write cursor back(if negative) or forward(if positive).
170  /// @param Origin The starting point to be considered for the offset.
171  virtual void SetWritePosition(StreamOff Offset, SeekOrigin Origin) = 0;
172  /// @brief Gets the current write position in this stream.
173  /// @return Returns a StreamPos representing the current write position.
174  virtual StreamPos GetWritePosition() = 0;
175  };//iOutStream
176 
177  ///////////////////////////////////////////////////////////////////////////////
178  /// @brief Base class for input (read) streams with minimal implementation.
179  /// @details
180  ///////////////////////////////////////
181  class IStream : public iInStream, public std::istream
182  {
183  public:
184  /// @brief Class constructor.
185  /// @param Buf A pointer to the buffer that will be streamed.
186  IStream(std::streambuf* Buf);
187  /// @brief Class destructor.
188  virtual ~IStream();
189 
190  ///////////////////////////////////////////////////////////////////////////////
191  // Stream Base Operations
192 
193  /// @copydoc iStreamBase::EoF() const
194  virtual Boole EoF() const;
195  /// @copydoc iStreamBase::Bad() const
196  virtual Boole Bad() const;
197  /// @copydoc iStreamBase::Fail() const
198  virtual Boole Fail() const;
199  /// @copydoc iStreamBase::IsValid() const
200  virtual Boole IsValid() const;
201  /// @copydoc iStreamBase::ClearErrors()
202  virtual void ClearErrors();
203 
204  ///////////////////////////////////////////////////////////////////////////////
205  // Input methods
206 
207  /// @copydoc iInStream::Read(void*, StreamSize)
208  virtual size_t Read(void* Buffer, StreamSize Size);
209 
210  /// @copydoc iInStream::SetReadPosition(StreamPos)
211  virtual void SetReadPosition(StreamPos Position);
212  /// @copydoc iInStream::SetReadPosition(StreamOff, SeekOrigin)
213  virtual void SetReadPosition(StreamOff Offset, SeekOrigin Origin);
214  /// @copydoc iInStream::GetReadPosition()
215  virtual StreamPos GetReadPosition();
216  };//IStream
217 
218  ///////////////////////////////////////////////////////////////////////////////
219  /// @brief Base class for output (write) streams with minimal implementation.
220  /// @details
221  ///////////////////////////////////////
222  class OStream : public iOutStream, public std::ostream
223  {
224  public:
225  /// @brief Class constructor.
226  /// @param Buf A pointer to the buffer that will be streamed.
227  OStream(std::streambuf* Buf);
228  /// @brief Class destructor.
229  virtual ~OStream();
230 
231  ///////////////////////////////////////////////////////////////////////////////
232  // Stream Base Operations
233 
234  /// @copydoc iStreamBase::EoF() const
235  virtual Boole EoF() const;
236  /// @copydoc iStreamBase::Bad() const
237  virtual Boole Bad() const;
238  /// @copydoc iStreamBase::Fail() const
239  virtual Boole Fail() const;
240  /// @copydoc iStreamBase::IsValid() const
241  virtual Boole IsValid() const;
242  /// @copydoc iStreamBase::ClearErrors()
243  virtual void ClearErrors();
244 
245  ///////////////////////////////////////////////////////////////////////////////
246  // Output methods
247 
248  /// @copydoc iOutStream::Write(const void*, StreamSize)
249  virtual size_t Write(const void* Buffer, StreamSize Size);
250 
251  /// @copydoc iOutStream::SetWritePosition(StreamPos)
252  virtual void SetWritePosition(StreamPos Position);
253  /// @copydoc iOutStream::SetWritePosition(StreamOff, SeekOrigin)
254  virtual void SetWritePosition(StreamOff Offset, SeekOrigin Origin);
255  /// @copydoc iOutStream::GetWritePosition()
256  virtual StreamPos GetWritePosition();
257  };//OStream
258 
259  ///////////////////////////////////////////////////////////////////////////////
260  /// @brief Base class for streams that support both read and write operations.
261  /// @details
262  ///////////////////////////////////////
263  class IOStream : public iInStream, public iOutStream, public std::iostream
264  {
265  public:
266  /// @brief Class constructor.
267  /// @param Buf A pointer to the buffer that will be streamed.
268  IOStream(std::streambuf* Buf);
269  /// @brief Class destructor.
270  virtual ~IOStream();
271 
272  ///////////////////////////////////////////////////////////////////////////////
273  // Stream Base Operations
274 
275  /// @copydoc iStreamBase::EoF() const
276  virtual Boole EoF() const;
277  /// @copydoc iStreamBase::Bad() const
278  virtual Boole Bad() const;
279  /// @copydoc iStreamBase::Fail() const
280  virtual Boole Fail() const;
281  /// @copydoc iStreamBase::IsValid() const
282  virtual Boole IsValid() const;
283  /// @copydoc iStreamBase::ClearErrors()
284  virtual void ClearErrors();
285 
286  ///////////////////////////////////////////////////////////////////////////////
287  // Input methods
288 
289  /// @copydoc iInStream::Read(void*, StreamSize)
290  virtual size_t Read(void* Buffer, StreamSize Size);
291 
292  /// @copydoc iInStream::SetReadPosition(StreamPos)
293  virtual void SetReadPosition(StreamPos Position);
294  /// @copydoc iInStream::SetReadPosition(StreamOff, SeekOrigin)
295  virtual void SetReadPosition(StreamOff Offset, SeekOrigin Origin);
296  /// @copydoc iInStream::GetReadPosition()
297  virtual StreamPos GetReadPosition();
298 
299  ///////////////////////////////////////////////////////////////////////////////
300  // Output methods
301 
302  /// @copydoc iOutStream::Write(const void*, StreamSize)
303  virtual size_t Write(const void* Buffer, StreamSize Size);
304 
305  /// @copydoc iOutStream::SetWritePosition(StreamPos)
306  virtual void SetWritePosition(StreamPos Position);
307  /// @copydoc iOutStream::SetWritePosition(StreamOff, SeekOrigin)
308  virtual void SetWritePosition(StreamOff Offset, SeekOrigin Origin);
309  /// @copydoc iOutStream::GetWritePosition()
310  virtual StreamPos GetWritePosition();
311 
312  ///////////////////////////////////////////////////////////////////////////////
313  // Input/Output methods
314 
315  /// @brief Advances the position in the stream.
316  /// @param Count The number of bytes to skip/advance in the stream from the current position.
317  virtual void Advance(const StreamOff Count);
318  /// @brief Sets the position of the read and write cursors explicitly.
319  /// @param Position The position to be set.
320  virtual void SetStreamPosition(StreamPos Position);
321  /// @brief Sets the position of the read and write cursors.
322  /// @param Offset The number of bytes to move the cursors back(if negative) or forward(if positive).
323  /// @param Origin The starting point to be considered for the offset.
324  virtual void SetStreamPosition(StreamOff Offset, SeekOrigin Origin);
325  /// @brief Gets the current position in this stream.
326  /// @param Read Whether or not to get the Read position. If false this will get the write position instead.
327  /// @return Returns a StreamPos representing the current position specified from the beginning of the stream.
328  virtual StreamPos GetStreamPosition(const Boole Read = true);
329 
330  ///////////////////////////////////////////////////////////////////////////////
331  // Formatting Methods
332 
333  /// @brief Gets the contents of the stream as a string.
334  /// @return Returns a string with the contents of the stream.
335  virtual String GetAsString();
336  /// @brief Reads a single line from a string.
337  /// @param Buffer Pointer to the buffer to copy to.
338  /// @param MaxCount The maximum number of bytes to read. Usually you want this to be your buffer size.
339  /// @param Delim The character that marks the end of a line.
340  /// @return Returns the number of bytes actually read, not including the Delimiter.
341  virtual size_t ReadLine(Char8* Buffer, size_t MaxCount, const String& Delim = "\n");
342  /// @brief Gets the contents of the current line in the stream.
343  /// @param Trim Whether or not to trim whitespaces on both sides of the string.
344  /// @return Returns a string containing characters from the current position in the stream to the end of the line.
345  virtual String GetLine(Boole Trim = true);
346  /// @brief Moves the current position to the start of the next line.
347  /// @param Delim The character that marks the end of a line.
348  /// @return Returns the number of bytes skipped.
349  virtual size_t SkipLine(const String& Delim = "\n");
350  };//IOStream
351 
352  ///////////////////////////////////////////////////////////////////////////////
353  // Compatibility Types
354 
355  /// @brief Convenience type for compatibility.
357 
358  ///////////////////////////////////////////////////////////////////////////////
359  // Convenience Standard Types
360 
361  /// @brief Convenience type for a standard input stream.
362  typedef std::istream StdInputStream;
363  /// @brief Convenience type for a standard output stream.
364  typedef std::ostream StdOutputStream;
365  /// @brief Convenience type for a standard input/output stream.
366  typedef std::iostream StdStream;
367 
368  ///////////////////////////////////////////////////////////////////////////////
369  // Convenience Pointer Types
370 
371  /// @brief Convenience type for a standard input stream in a CountedPtr.
373  /// @brief Convenience type for a standard output stream in a CountedPtr.
375  /// @brief Convenience type for a standard input/output stream in a CountedPtr.
377 
378  /// @brief Convenience type for a standard input stream in a CountedPtr.
380  /// @brief Convenience type for a standard output stream in a CountedPtr.
382  /// @brief This is a convenience type for a data stream in a counted pointer.
384  }//Resource
385 }//Mezzanine
386 
387 #endif
virtual size_t Read(void *Buffer, StreamSize Size)
Reads from the stream and copies that data to a buffer.
Definition: datastream.cpp:88
virtual StreamPos GetReadPosition()
Gets the current read position in this stream.
Definition: datastream.cpp:100
virtual Boole Fail() const
Gets whether or not an otherwise silent and recoverable error was detected in a previous operation in...
Definition: datastream.cpp:76
virtual size_t ReadLine(Char8 *Buffer, size_t MaxCount, const String &Delim="\n")
Reads a single line from a string.
Definition: datastream.cpp:256
OStream(std::streambuf *Buf)
Class constructor.
Definition: datastream.cpp:106
virtual Boole IsValid() const
Gets whether or not this stream is intact and ready for operations.
Definition: datastream.cpp:125
Clear the contents of the file when opening. Note that this will also create the file if it's not fou...
Definition: datastream.h:73
bool Boole
Generally acts a single bit, true or false.
Definition: datatypes.h:173
virtual String GetLine(Boole Trim=true)
Gets the contents of the current line in the stream.
Definition: datastream.cpp:295
Tell the stream that the file in question is Binary.
Definition: datastream.h:72
Base class interface for resource streams.
Definition: datastream.h:88
virtual ~IOStream()
Class destructor.
Definition: datastream.cpp:156
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.
Definition: datastream.h:379
virtual size_t Write(const void *Buffer, StreamSize Size)
Writes data to the stream.
Definition: datastream.cpp:198
virtual Boole Bad() const
Gets whether or not a critical error was detected in a previous operation in the stream.
Definition: datastream.cpp:73
virtual ~iOutStream()
Class destructor.
Definition: datastream.h:157
virtual void SetReadPosition(StreamPos Position)
Sets the position of the read cursor explicitly.
Definition: datastream.cpp:94
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.
Definition: countedptr.h:70
virtual void SetWritePosition(StreamPos Position)
Sets the position of the write cursor explicitly.
Definition: datastream.cpp:204
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.
Definition: datastream.cpp:140
CountedPtr< StdStream > StdStreamPtr
Convenience type for a standard input/output stream in a CountedPtr.
Definition: datastream.h:376
The current position for read/write operations in the stream.
Definition: datastream.h:80
virtual Boole Fail() const
Gets whether or not an otherwise silent and recoverable error was detected in a previous operation in...
Definition: datastream.cpp:168
All write operations on the stream are done at the end of the stream.
Definition: datastream.h:70
virtual Boole EoF() const
Gets whether or not the current position is at the end of the stream.
Definition: datastream.cpp:162
Base class for streams that support both read and write operations.
Definition: datastream.h:263
virtual StreamPos GetReadPosition()
Gets the current read position in this stream.
Definition: datastream.cpp:192
virtual StreamPos GetWritePosition()
Gets the current write position in this stream.
Definition: datastream.cpp:146
char Char8
A datatype to represent one character.
Definition: datatypes.h:169
std::istream StdInputStream
Convenience type for a standard input stream.
Definition: datastream.h:362
Interface class for output (write) streams.
Definition: datastream.h:151
virtual StreamPos GetWritePosition()=0
Gets the current write position in this stream.
virtual ~iStreamBase()
Class destructor.
Definition: datastream.h:94
iStreamBase()
Class constructor.
Definition: datastream.h:92
IOStream DataStream
Convenience type for compatibility.
Definition: datastream.h:356
virtual size_t Read(void *Buffer, StreamSize Size)
Reads from the stream and copies that data to a buffer.
Definition: datastream.cpp:180
Permit write operations on the stream.
Definition: datastream.h:69
virtual Boole Fail() const
Gets whether or not an otherwise silent and recoverable error was detected in a previous operation in...
Definition: datastream.cpp:122
virtual void ClearErrors()
Clears any stored error state on the stream.
Definition: datastream.cpp:128
virtual void SetReadPosition(StreamPos Position)
Sets the position of the read cursor explicitly.
Definition: datastream.cpp:186
virtual ~iInStream()
Class destructor.
Definition: datastream.h:127
iOutStream()
Class constructor.
Definition: datastream.h:155
Moves the starting position of the stream to the end upon initialization.
Definition: datastream.h:71
virtual Boole Bad() const
Gets whether or not a critical error was detected in a previous operation in the stream.
Definition: datastream.cpp:119
virtual ~OStream()
Class destructor.
Definition: datastream.cpp:110
The beginning of the stream.
Definition: datastream.h:79
Base class for output (write) streams with minimal implementation.
Definition: datastream.h:222
The end of the stream.
Definition: datastream.h:81
virtual Boole EoF() const
Gets whether or not the current position is at the end of the stream.
Definition: datastream.cpp:70
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.
Definition: datastream.cpp:328
SeekOrigin
An enum describing which position should be considered the origin for changing the current position i...
Definition: datastream.h:77
IStream(std::streambuf *Buf)
Class constructor.
Definition: datastream.cpp:60
virtual void ClearErrors()
Clears any stored error state on the stream.
Definition: datastream.cpp:174
virtual StreamSize GetSize() const =0
Gets the size of the stream.
virtual void Advance(const StreamOff Count)
Advances the position in the stream.
Definition: datastream.cpp:216
virtual void ClearErrors()
Clears any stored error state on the stream.
Definition: datastream.cpp:82
CountedPtr< StdInputStream > StdInputStreamPtr
Convenience type for a standard input stream in a CountedPtr.
Definition: datastream.h:372
virtual StreamPos GetWritePosition()
Gets the current write position in this stream.
Definition: datastream.cpp:210
virtual Boole EoF() const
Gets whether or not the current position is at the end of the stream.
Definition: datastream.cpp:116
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.
Definition: datastream.cpp:165
StreamFlags
This enum describes the flags that control certain behaviors of a stream.
Definition: datastream.h:65
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
IOStream(std::streambuf *Buf)
Class constructor.
Definition: datastream.cpp:152
virtual void SetReadPosition(StreamPos Position)=0
Sets the position of the read cursor explicitly.
Interface class for input (read) streams.
Definition: datastream.h:121
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.
Definition: datastream.cpp:240
std::streamsize StreamSize
Convenience define for the stream size datatype.
Definition: datastream.h:61
CountedPtr< StdOutputStream > StdOutputStreamPtr
Convenience type for a standard output stream in a CountedPtr.
Definition: datastream.h:374
virtual Boole IsValid() const
Gets whether or not this stream is intact and ready for operations.
Definition: datastream.cpp:171
std::streampos StreamPos
Convenience define for the stream position datatype.
Definition: datastream.h:57
std::streamoff StreamOff
Convenience define for the stream offset datatype.
Definition: datastream.h:59
CountedPtr< OStream > OStreamPtr
Convenience type for a standard output stream in a CountedPtr.
Definition: datastream.h:381
virtual size_t Write(const void *Buffer, StreamSize Size)
Writes data to the stream.
Definition: datastream.cpp:134
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.
Definition: datastream.h:383
virtual ~IStream()
Class destructor.
Definition: datastream.cpp:64
std::ostream StdOutputStream
Convenience type for a standard output stream.
Definition: datastream.h:364
virtual void SetStreamPosition(StreamPos Position)
Sets the position of the read and write cursors explicitly.
Definition: datastream.cpp:219
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.
Definition: datastream.h:67
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159
virtual Boole IsValid() const
Gets whether or not this stream is intact and ready for operations.
Definition: datastream.cpp:79
virtual StreamPos GetStreamPosition(const Boole Read=true)
Gets the current position in this stream.
Definition: datastream.cpp:231
std::iostream StdStream
Convenience type for a standard input/output stream.
Definition: datastream.h:366
iInStream()
Class constructor.
Definition: datastream.h:125
Base class for input (read) streams with minimal implementation.
Definition: datastream.h:181
Permit read operations on the stream.
Definition: datastream.h:68