|
libRocket
|
#include <Stream.h>
Public Types | |
| enum | StreamMode { MODE_WRITE = 1 << 0, MODE_APPEND = 1 << 1, MODE_READ = 1 << 2, MODE_ASYNC = 1 << 3, MODE_MASK = MODE_WRITE | MODE_APPEND | MODE_READ } |
Public Member Functions | |
| Stream () | |
| virtual | ~Stream () |
| virtual void | Close () |
| Closes the stream. More... | |
| int | GetStreamMode () const |
| Returns the mode the stream was opened in. More... | |
| const URL & | GetSourceURL () const |
| Obtain the source url of this stream (if available) More... | |
| virtual bool | IsEOS () const |
| Are we at the end of the stream. More... | |
| virtual size_t | Length () const =0 |
| Returns the size of this stream (in bytes). More... | |
| virtual size_t | Tell () const =0 |
| Returns the position of the stream pointer (in bytes). More... | |
| virtual bool | Seek (long offset, int origin) const =0 |
| Sets the stream position (in bytes). More... | |
| virtual size_t | Read (void *buffer, size_t bytes) const =0 |
| Read from the stream. More... | |
| virtual size_t | Read (Stream *stream, size_t bytes) const |
| Read from the stream into another stream. More... | |
| virtual size_t | Read (String &buffer, size_t bytes) const |
| Read from the stream and append to the string buffer. More... | |
| virtual size_t | Peek (void *buffer, size_t bytes) const |
| Read from the stream, without increasing the stream offset. More... | |
| virtual size_t | Write (const void *buffer, size_t bytes)=0 |
| Write to the stream at the current position. More... | |
| virtual size_t | Write (const Stream *stream, size_t bytes) |
| Write to this stream from another stream. More... | |
| virtual size_t | Write (const char *string) |
| Write a character array to the stream. More... | |
| virtual size_t | Write (const String &string) |
| Write a string to the stream. More... | |
| virtual size_t | Truncate (size_t bytes)=0 |
| Truncate the stream to the specified length. More... | |
| virtual size_t | PushFront (const void *buffer, size_t bytes) |
| Push onto the front of the stream. More... | |
| virtual size_t | PushBack (const void *buffer, size_t bytes) |
| Push onto the back of the stream. More... | |
| virtual size_t | PopFront (size_t bytes) |
| Pop from the front of the stream. More... | |
| virtual size_t | PopBack (size_t bytes) |
| Pop from the back of the stream. More... | |
| virtual bool | IsReadReady ()=0 |
| virtual bool | IsWriteReady ()=0 |
Public Member Functions inherited from Rocket::Core::ReferenceCountable | |
| ReferenceCountable (int initial_count=1) | |
| virtual | ~ReferenceCountable () |
| Destructor. The reference count must be 0 when this is invoked. More... | |
| virtual int | GetReferenceCount () |
| Returns the number of references outstanding against this object. More... | |
| virtual void | AddReference () |
| Increases the reference count. If this pushes the count above 0, OnReferenceActivate() will be called. More... | |
| virtual void | RemoveReference () |
| Decreases the reference count. If this pushes the count to 0, OnReferenceDeactivate() will be called. More... | |
| ReferenceCountable & | operator= (const ReferenceCountable ©) |
| Catches incorrect copy attempts. More... | |
Protected Member Functions | |
| void | SetStreamDetails (const URL &url, int stream_mode) |
| Sets the mode on the stream; should be called by a stream when it is opened. More... | |
| virtual void | OnReferenceDeactivate () |
| Deletes the stream. More... | |
Protected Member Functions inherited from Rocket::Core::ReferenceCountable | |
| virtual void | OnReferenceActivate () |
| A hook method called when the reference count climbs from 0. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Rocket::Core::ReferenceCountable | |
| static void | DumpLeakReport () |
| If any reference countable objects are still allocated, this function will write a leak report to the log. More... | |
Abstract class for a media-independent byte stream.
| Rocket::Core::Stream::Stream | ( | ) |
|
virtual |
|
virtual |
Closes the stream.
Reimplemented in Rocket::Core::StreamMemory.
| const URL& Rocket::Core::Stream::GetSourceURL | ( | ) | const |
Obtain the source url of this stream (if available)
| int Rocket::Core::Stream::GetStreamMode | ( | ) | const |
Returns the mode the stream was opened in.
|
virtual |
Are we at the end of the stream.
Reimplemented in Rocket::Core::StreamMemory.
|
pure virtual |
Returns true if the stream is ready for reading, false otherwise. This is usually only implemented on streams supporting asynchronous operations.
Implemented in Rocket::Core::StreamMemory.
|
pure virtual |
Returns true if the stream is ready for writing, false otherwise. This is usually only implemented on streams supporting asynchronous operations.
Implemented in Rocket::Core::StreamMemory.
|
pure virtual |
Returns the size of this stream (in bytes).
Implemented in Rocket::Core::StreamMemory.
|
protectedvirtual |
Deletes the stream.
Reimplemented from Rocket::Core::ReferenceCountable.
|
virtual |
Read from the stream, without increasing the stream offset.
Reimplemented in Rocket::Core::StreamMemory.
|
virtual |
Pop from the back of the stream.
|
virtual |
Pop from the front of the stream.
Reimplemented in Rocket::Core::StreamMemory.
|
virtual |
Push onto the back of the stream.
|
virtual |
Push onto the front of the stream.
Reimplemented in Rocket::Core::StreamMemory.
|
pure virtual |
Read from the stream.
Implemented in Rocket::Core::StreamMemory.
|
virtual |
Read from the stream into another stream.
|
virtual |
Read from the stream and append to the string buffer.
|
pure virtual |
Sets the stream position (in bytes).
Implemented in Rocket::Core::StreamMemory.
|
protected |
Sets the mode on the stream; should be called by a stream when it is opened.
|
pure virtual |
Returns the position of the stream pointer (in bytes).
Implemented in Rocket::Core::StreamMemory.
|
pure virtual |
Truncate the stream to the specified length.
Implemented in Rocket::Core::StreamMemory.
|
pure virtual |
Write to the stream at the current position.
Implemented in Rocket::Core::StreamMemory.
|
virtual |
Write to this stream from another stream.
|
virtual |
Write a character array to the stream.
|
virtual |
Write a string to the stream.
1.8.8