#include <Stream.h>
Public Types | |
enum | Endianness { STREAM_BIG_ENDIAN, STREAM_LITTLE_ENDIAN } |
Public Member Functions | |
IoStream () | |
virtual | ~IoStream () |
template<typename T > | |
void | read (T *t) |
void | read (std::string *s) |
Reads characters until a null terminator. More... | |
void | read (fs::path *p) |
template<typename T > | |
void | readEndian (T *t, uint8_t endian) |
template<typename T > | |
void | readBig (T *t) |
template<typename T > | |
void | readLittle (T *t) |
void | readFixedString (char *t, size_t maxSize, bool nullTerminate) |
void | readFixedString (std::string *t, size_t size) |
std::string | readLine () |
void | readData (void *dest, size_t size) |
virtual size_t | readDataAvailable (void *dest, size_t maxSize)=0 |
virtual off_t | size () const =0 |
virtual bool | isEof () const =0 |
const fs::path & | getFileName () const |
Returns the file name of the path from which a Stream originated when relevant. Empty string when undefined. More... | |
void | setFileName (const fs::path &aFileName) |
Sets the file name of the path from which a Stream originated when relevant. Empty string when undefined. More... | |
bool | getDeleteOnDestroy () const |
Returns whether the Stream has been requested to destroy its source upon its own destruction. For example, IStreamFile will delete its source file. Ignored in some types of streams. Defaults to false . More... | |
void | setDeleteOnDestroy (bool enable=true) |
Sets whether the Stream has been requested to destroy its source upon its own destruction. For example, IStreamFile will delete its source file. Ignored in some types of streams. Defaults to false . More... | |
virtual off_t | tell () const =0 |
Returns the current position of the stream measured in bytes **/. More... | |
virtual void | seekAbsolute (off_t absoluteOffset)=0 |
Sets the current position of the stream to byte absoluteOffset. A negative offset is relative to the end of the file. More... | |
virtual void | seekRelative (off_t relativeOffset)=0 |
Moves the current position of the stream by relativeOffset bytes. More... | |
void | write (const std::string &s) |
Writes null-terminated string, including terminator. More... | |
template<typename T > | |
void | write (T t) |
void | write (const Buffer &buffer) |
template<typename T > | |
void | writeEndian (T t, uint8_t endian) |
template<typename T > | |
void | writeBig (T t) |
template<typename T > | |
void | writeLittle (T t) |
void | writeData (const void *src, size_t size) |
Static Public Member Functions | |
static uint8_t | getNativeEndianness () |
Returns the platform's endianness as a StreamBase::Endianness. More... | |
Protected Member Functions | |
virtual void | IORead (void *t, size_t size)=0 |
virtual void | IOWrite (const void *t, size_t size)=0 |
Protected Attributes | |
fs::path | mFileName |
bool | mDeleteOnDestroy |
Static Protected Attributes | |
static const int | MINIMUM_BUFFER_SIZE = 8 |
|
inherited |
cinder::IoStream::IoStream | ( | ) |
|
virtual |
|
inherited |
|
inherited |
Reads characters until a null terminator.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
pure virtualinherited |
Implemented in cinder::IStreamMem, cinder::IoStreamFile, cinder::IStreamFile, and cinder::IStreamUrl.
|
pure virtualinherited |
Implemented in cinder::IStreamMem, cinder::IoStreamFile, cinder::IStreamFile, and cinder::IStreamUrl.
|
pure virtualinherited |
Implemented in cinder::IStreamMem, cinder::IoStreamFile, cinder::IStreamFile, and cinder::IStreamUrl.
Implemented in cinder::IStreamMem, cinder::IoStreamFile, cinder::IStreamFile, and cinder::IStreamUrl.
|
staticinherited |
Returns the platform's endianness as a StreamBase::Endianness.
|
inherited |
Returns the file name of the path from which a Stream originated when relevant. Empty string when undefined.
|
inherited |
Sets the file name of the path from which a Stream originated when relevant. Empty string when undefined.
|
inherited |
Returns whether the Stream has been requested to destroy its source upon its own destruction. For example, IStreamFile will delete its source file. Ignored in some types of streams. Defaults to false
.
|
inherited |
Sets whether the Stream has been requested to destroy its source upon its own destruction. For example, IStreamFile will delete its source file. Ignored in some types of streams. Defaults to false
.
|
pure virtualinherited |
Returns the current position of the stream measured in bytes **/.
Implemented in cinder::OStreamMem, cinder::IStreamMem, cinder::IoStreamFile, cinder::OStreamFile, cinder::IStreamFile, and cinder::IStreamUrl.
|
pure virtualinherited |
Sets the current position of the stream to byte absoluteOffset. A negative offset is relative to the end of the file.
Implemented in cinder::OStreamMem, cinder::IStreamMem, cinder::IoStreamFile, cinder::OStreamFile, cinder::IStreamFile, and cinder::IStreamUrl.
|
pure virtualinherited |
Moves the current position of the stream by relativeOffset bytes.
Implemented in cinder::OStreamMem, cinder::IStreamMem, cinder::IoStreamFile, cinder::OStreamFile, cinder::IStreamFile, and cinder::IStreamUrl.
|
inherited |
Writes null-terminated string, including terminator.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedpure virtualinherited |
Implemented in cinder::OStreamMem, cinder::IoStreamFile, and cinder::OStreamFile.
|
staticprotectedinherited |
|
protectedinherited |
|
protectedinherited |