#include <Stream.h>
Inherits cinder::IStream.
Public Types | |
enum | Endianness { STREAM_BIG_ENDIAN, STREAM_LITTLE_ENDIAN } |
Public Member Functions | |
~IStreamMem () | |
size_t | readDataAvailable (void *dest, size_t maxSize) |
void | seekAbsolute (off_t absoluteOffset) |
Sets the current position of the stream to byte absoluteOffset. A negative offset is relative to the end of the file. | |
void | seekRelative (off_t relativeOffset) |
Moves the current position of the stream by relativeOffset bytes. | |
off_t | tell () const |
Returns the current offset into the stream in bytes. | |
off_t | size () const |
Returns the total length of stream in bytes. | |
bool | isEof () const |
Returns whether the stream is currently pointed at the end of the file. | |
const void * | getData () |
Returns a pointer to the data which the stream wraps. | |
template<typename T > | |
void | read (T *t) |
void | read (std::string *s) |
Reads characters until a null terminator. | |
void | read (ci::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) |
const std::string & | getFileName () const |
Returns the file name of the path from which a Stream originated when relevant. Empty string when undefined. | |
void | setFileName (const std::string &aFileName) |
Sets the file name of the path from which a Stream originated when relevant. Empty string when undefined. | |
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 . | |
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 . | |
Static Public Member Functions | |
static IStreamMemRef | createRef (const void *data, size_t size) |
Creates a new IStreamMemRef from the memory pointed to by data which is of size size bytes. | |
static uint8_t | getNativeEndianness () |
Public Attributes | |
return | STREAM_BIG_ENDIAN |
Protected Member Functions | |
IStreamMem (const void *aData, size_t aDataSize) | |
virtual void | IORead (void *t, size_t size) |
Protected Attributes | |
const uint8_t * | mData |
size_t | mDataSize |
size_t | mOffset |
std::string | mFileName |
bool | mDeleteOnDestroy |
Static Protected Attributes | |
static const int | MINIMUM_BUFFER_SIZE = 8 |
enum cinder::StreamBase::Endianness [inherited] |
cinder::IStreamMem::~IStreamMem | ( | ) |
cinder::IStreamMem::IStreamMem | ( | const void * | aData, |
size_t | aDataSize | ||
) | [protected] |
IStreamMemRef cinder::IStreamMem::createRef | ( | const void * | data, |
size_t | size | ||
) | [static] |
Creates a new IStreamMemRef from the memory pointed to by data which is of size size bytes.
size_t cinder::IStreamMem::readDataAvailable | ( | void * | dest, |
size_t | maxSize | ||
) | [virtual] |
Implements cinder::IStream.
void cinder::IStreamMem::seekAbsolute | ( | off_t | absoluteOffset ) | [virtual] |
Sets the current position of the stream to byte absoluteOffset. A negative offset is relative to the end of the file.
Implements cinder::StreamBase.
void cinder::IStreamMem::seekRelative | ( | off_t | relativeOffset ) | [virtual] |
Moves the current position of the stream by relativeOffset bytes.
Implements cinder::StreamBase.
off_t cinder::IStreamMem::tell | ( | ) | const [virtual] |
Returns the current offset into the stream in bytes.
Implements cinder::StreamBase.
off_t cinder::IStreamMem::size | ( | ) | const [virtual] |
Returns the total length of stream in bytes.
Implements cinder::IStream.
bool cinder::IStreamMem::isEof | ( | ) | const [virtual] |
Returns whether the stream is currently pointed at the end of the file.
Implements cinder::IStream.
const void* cinder::IStreamMem::getData | ( | ) |
Returns a pointer to the data which the stream wraps.
void cinder::IStreamMem::IORead | ( | void * | t, |
size_t | size | ||
) | [protected, virtual] |
Implements cinder::IStream.
void cinder::IStream::read | ( | T * | t ) | [inherited] |
void cinder::IStream::read | ( | std::string * | s ) | [inherited] |
Reads characters until a null terminator.
void cinder::IStream::read | ( | ci::fs::path * | p ) | [inherited] |
void cinder::IStream::readEndian | ( | T * | t, |
uint8_t | endian | ||
) | [inherited] |
void cinder::IStream::readBig | ( | T * | t ) | [inherited] |
void cinder::IStream::readLittle | ( | T * | t ) | [inherited] |
void cinder::IStream::readFixedString | ( | char * | t, |
size_t | maxSize, | ||
bool | nullTerminate | ||
) | [inherited] |
void cinder::IStream::readFixedString | ( | std::string * | t, |
size_t | size | ||
) | [inherited] |
std::string cinder::IStream::readLine | ( | ) | [inherited] |
void cinder::IStream::readData | ( | void * | dest, |
size_t | size | ||
) | [inherited] |
static uint8_t cinder::StreamBase::getNativeEndianness | ( | ) | [static, inherited] |
Returns the platform's endianness as a StreamBase::Endianness
const std::string& cinder::StreamBase::getFileName | ( | ) | const [inherited] |
Returns the file name of the path from which a Stream originated when relevant. Empty string when undefined.
void cinder::StreamBase::setFileName | ( | const std::string & | aFileName ) | [inherited] |
Sets the file name of the path from which a Stream originated when relevant. Empty string when undefined.
bool cinder::StreamBase::getDeleteOnDestroy | ( | ) | const [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
.
void cinder::StreamBase::setDeleteOnDestroy | ( | bool | enable = true ) |
[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
.
const uint8_t* cinder::IStreamMem::mData [protected] |
size_t cinder::IStreamMem::mDataSize [protected] |
size_t cinder::IStreamMem::mOffset [protected] |
const int cinder::IStream::MINIMUM_BUFFER_SIZE = 8 [static, protected, inherited] |
return cinder::StreamBase::STREAM_BIG_ENDIAN [inherited] |
std::string cinder::StreamBase::mFileName [protected, inherited] |
bool cinder::StreamBase::mDeleteOnDestroy [protected, inherited] |