100 virtual void Write(
const void* ptr,
Size numBytes);
106 virtual void Flush();
108 virtual bool Eof()
const;
112 virtual void Unmap();
The common base class of Nebula.
Definition refcounted.h:38
Offers an abstract interface for read/write access to a sequence of bytes.
Definition stream.h:28
SeekOrigin
seek origins
Definition stream.h:54
@ Current
Definition stream.h:56
@ End
Definition stream.h:57
@ Begin
Definition stream.h:55
virtual Position GetPosition() const
get the current position of the read/write cursor
Definition stream.cc:126
int64_t Offset
Definition stream.h:33
void SetMediaType(const MediaType &t)
set optional media type of stream content
Definition stream.cc:182
virtual void * MemoryMap()
memory map stream to memory
Definition stream.cc:334
virtual void * Map()
map stream to memory
Definition stream.cc:308
const MediaType & GetMediaType() const
get optional media type
Definition stream.cc:191
virtual void Flush()
flush unsaved data
Definition stream.cc:279
virtual bool CanSeek() const
return true if the stream supports seeking
Definition stream.cc:83
bool isMapped
Definition stream.h:125
AccessPattern accessPattern
Definition stream.h:123
AccessMode GetAccessMode() const
get the access mode of the stream
Definition stream.cc:149
int64_t Position
typedefs
Definition stream.h:32
void SetAccessMode(AccessMode m)
set the access mode of the stream (default is ReadAccess)
Definition stream.cc:138
virtual void SetSize(Size s)
set a new size for the stream
Definition stream.cc:106
bool IsOpen() const
return true if currently open
Definition stream.cc:225
virtual void Unmap()
unmap stream
Definition stream.cc:322
bool isOpen
Definition stream.h:124
Stream()
constructor
Definition stream.cc:18
virtual void MemoryUnmap()
unmap memory stream
Definition stream.cc:347
void SetAccessPattern(AccessPattern p)
set the prefered access pattern (default is Sequential)
Definition stream.cc:162
AccessPattern GetAccessPattern() const
get the prefered access pattern
Definition stream.cc:173
virtual bool CanWrite() const
return true if the stream supports writing
Definition stream.cc:73
int64_t Size
Definition stream.h:34
virtual void Seek(Offset offset, SeekOrigin origin)
seek in stream
Definition stream.cc:267
virtual bool Open()
open the stream
Definition stream.cc:202
bool IsMapped() const
return true if stream is currently mapped to memory
Definition stream.cc:360
MediaType mediaType
Definition stream.h:126
virtual bool CanRead() const
return true if the stream supports reading
Definition stream.cc:63
AccessMode accessMode
Definition stream.h:122
URI uri
Definition stream.h:121
virtual Size Read(void *ptr, Size numBytes)
directly read from the stream
Definition stream.cc:253
void SetURI(const URI &u)
set stream location as URI
Definition stream.cc:42
AccessMode
access modes
Definition stream.h:38
@ WriteAccess
Definition stream.h:40
@ ReadAccess
Definition stream.h:39
@ ReadWriteAccess
Definition stream.h:42
@ AppendAccess
Definition stream.h:41
virtual bool CanBeMapped() const
return true if the stream provides direct memory access
Definition stream.cc:94
virtual bool Eof() const
return true if end-of-stream reached
Definition stream.cc:290
const URI & GetURI() const
get stream URI
Definition stream.cc:53
virtual Size GetSize() const
get the size of the stream in bytes
Definition stream.cc:116
virtual void Close()
close the stream
Definition stream.cc:214
AccessPattern
access prefered pattern
Definition stream.h:47
@ Sequential
Definition stream.h:49
@ Random
Definition stream.h:48
virtual ~Stream()
destructor
Definition stream.cc:30
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition uri.h:67
Instances of wrapped stream classes.
Definition orientation.cc:10
@ Write
Definition filewatcher.h:47