40 #ifndef _resourcedatastream_h
41 #define _resourcedatastream_h
57 #ifdef USENEWDATASTREAM
80 SF_Read = std::ios_base::in,
81 SF_Write = std::ios_base::out,
82 SF_Append = std::ios_base::app,
83 SF_AtEnd = std::ios_base::ate,
84 SF_Binary = std::ios_base::binary,
85 SF_Truncate = std::ios_base::trunc,
92 SO_Beginning = std::ios_base::beg,
93 SO_Current = std::ios_base::cur,
94 SO_End = std::ios_base::end
100 virtual ~StreamBase() { }
111 class IStream :
virtual public StreamBase
117 virtual ~IStream() { }
127 virtual void SetReadPosition(
StreamPos Position) = 0;
131 virtual void SetReadPosition(
StreamOff Offset, SeekOrigin Origin) = 0;
141 class OStream :
virtual public StreamBase
147 virtual ~OStream() { }
157 virtual void SetWritePosition(
StreamPos Position) = 0;
161 virtual void SetWritePosition(
StreamOff Offset, SeekOrigin Origin) = 0;
164 virtual StreamPos GetWritePosition() = 0;
171 class IOStream :
public IStream,
public OStream
177 virtual ~IOStream() { }
181 virtual void Advance(
const StreamOff Count);
184 virtual void SetStreamPosition(
StreamPos Position);
188 virtual void SetStreamPosition(
StreamOff Offset, SeekOrigin Origin);
192 virtual StreamPos GetStreamPosition(
bool Read =
true);
197 typedef IOStream DataStream;
198 #else //USENEWDATASTREAM
235 SO_Beginning = std::ios_base::beg,
236 SO_Current = std::ios_base::cur,
237 SO_End = std::ios_base::end
259 virtual bool IsReadable()
const;
262 virtual bool IsWriteable()
const;
271 virtual size_t Read(
void* Buffer,
const size_t& Count) = 0;
276 virtual size_t Write(
const void* Buffer,
const size_t& Count) = 0;
280 virtual void Advance(
const StreamOff Count) = 0;
283 virtual void SetStreamPosition(
StreamPos Position) = 0;
291 virtual StreamPos GetStreamPosition(
bool Read =
true) = 0;
294 virtual bool EoF()
const = 0;
296 virtual void Close() = 0;
303 virtual String GetAsString();
309 virtual size_t ReadLine(
Char8* Buffer,
size_t MaxCount,
const String& Delim =
"\n");
313 virtual String GetLine(
bool Trim =
true);
317 virtual size_t SkipLine(
const String& Delim =
"\n");
319 #endif //USENEWDATASTREAM