#include <Stream.h>
|
| ~IoStreamFile () |
|
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. More...
|
|
void | seekRelative (off_t relativeOffset) |
| Moves the current position of the stream by relativeOffset bytes. More...
|
|
off_t | tell () const |
| Returns the current position of the stream measured in bytes **/. More...
|
|
off_t | size () const |
|
bool | isEof () const |
|
FILE * | getFILE () |
|
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) |
|
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...
|
|
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 IoStreamFileRef | create (FILE *file, bool ownsFile=true, int32_t defaultBufferSize=2048) |
| Creates a new IoStreamFileRef from a C-style file pointer FILE as returned by fopen(). If ownsFile the returned stream will destroy the stream upon its own destruction. More...
|
|
static uint8_t | getNativeEndianness () |
| Returns the platform's endianness as a StreamBase::Endianness. More...
|
|
Enumerator |
---|
STREAM_BIG_ENDIAN |
|
STREAM_LITTLE_ENDIAN |
|
cinder::IoStreamFile::~IoStreamFile |
( |
| ) |
|
cinder::IoStreamFile::IoStreamFile |
( |
FILE * |
aFile, |
|
|
bool |
aOwnsFile = true , |
|
|
int32_t |
aDefaultBufferSize = 2048 |
|
) |
| |
|
protected |
IoStreamFileRef cinder::IoStreamFile::create |
( |
FILE * |
file, |
|
|
bool |
ownsFile = true , |
|
|
int32_t |
defaultBufferSize = 2048 |
|
) |
| |
|
static |
Creates a new IoStreamFileRef from a C-style file pointer FILE as returned by fopen(). If ownsFile the returned stream will destroy the stream upon its own destruction.
size_t cinder::IoStreamFile::readDataAvailable |
( |
void * |
dest, |
|
|
size_t |
maxSize |
|
) |
| |
|
virtual |
void cinder::IoStreamFile::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::IoStreamFile::seekRelative |
( |
off_t |
relativeOffset | ) |
|
|
virtual |
Moves the current position of the stream by relativeOffset bytes.
Implements cinder::StreamBase.
off_t cinder::IoStreamFile::tell |
( |
| ) |
const |
|
virtual |
Returns the current position of the stream measured in bytes **/.
Implements cinder::StreamBase.
off_t cinder::IoStreamFile::size |
( |
| ) |
const |
|
virtual |
bool cinder::IoStreamFile::isEof |
( |
| ) |
const |
|
virtual |
FILE* cinder::IoStreamFile::getFILE |
( |
| ) |
|
void cinder::IoStreamFile::IORead |
( |
void * |
t, |
|
|
size_t |
size |
|
) |
| |
|
protectedvirtual |
size_t cinder::IoStreamFile::readDataImpl |
( |
void * |
dest, |
|
|
size_t |
maxSize |
|
) |
| |
|
protected |
void cinder::IoStreamFile::IOWrite |
( |
const void * |
t, |
|
|
size_t |
size |
|
) |
| |
|
protectedvirtual |
template<typename T >
void cinder::IStreamCinder::read |
( |
T * |
t | ) |
|
|
inherited |
Reads characters until a null terminator.
void cinder::IStreamCinder::read |
( |
fs::path * |
p | ) |
|
|
inherited |
template<typename T >
void cinder::IStreamCinder::readEndian |
( |
T * |
t, |
|
|
uint8_t |
endian |
|
) |
| |
|
inherited |
template<typename T >
void cinder::IStreamCinder::readBig |
( |
T * |
t | ) |
|
|
inherited |
template<typename T >
void cinder::IStreamCinder::readLittle |
( |
T * |
t | ) |
|
|
inherited |
void cinder::IStreamCinder::readFixedString |
( |
char * |
t, |
|
|
size_t |
maxSize, |
|
|
bool |
nullTerminate |
|
) |
| |
|
inherited |
void cinder::IStreamCinder::readFixedString |
( |
std::string * |
t, |
|
|
size_t |
size |
|
) |
| |
|
inherited |
void cinder::IStreamCinder::readData |
( |
void * |
dest, |
|
|
size_t |
size |
|
) |
| |
|
inherited |
static uint8_t cinder::StreamBase::getNativeEndianness |
( |
| ) |
|
|
staticinherited |
const fs::path& 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 fs::path & |
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
.
Writes null-terminated string, including terminator.
template<typename T >
void cinder::OStream::write |
( |
T |
t | ) |
|
|
inherited |
void cinder::OStream::write |
( |
const Buffer & |
buffer | ) |
|
|
inherited |
template<typename T >
void cinder::OStream::writeEndian |
( |
T |
t, |
|
|
uint8_t |
endian |
|
) |
| |
|
inherited |
template<typename T >
void cinder::OStream::writeBig |
( |
T |
t | ) |
|
|
inherited |
template<typename T >
void cinder::OStream::writeLittle |
( |
T |
t | ) |
|
|
inherited |
void cinder::OStream::writeData |
( |
const void * |
src, |
|
|
size_t |
size |
|
) |
| |
|
inherited |
FILE* cinder::IoStreamFile::mFile |
|
protected |
bool cinder::IoStreamFile::mOwnsFile |
|
protected |
int32_t cinder::IoStreamFile::mBufferSize |
|
protected |
int32_t cinder::IoStreamFile::mDefaultBufferSize |
|
protected |
std::shared_ptr<uint8_t> cinder::IoStreamFile::mBuffer |
|
protected |
off_t cinder::IoStreamFile::mBufferOffset |
|
protected |
off_t cinder::IoStreamFile::mBufferFileOffset |
|
protected |
off_t cinder::IoStreamFile::mSize |
|
mutableprotected |
bool cinder::IoStreamFile::mSizeCached |
|
mutableprotected |
const int cinder::IStreamCinder::MINIMUM_BUFFER_SIZE = 8 |
|
staticprotectedinherited |
fs::path cinder::StreamBase::mFileName |
|
protectedinherited |
bool cinder::StreamBase::mDeleteOnDestroy |
|
protectedinherited |
The documentation for this class was generated from the following files: