Cinder  0.9.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
cinder::IStreamCinder Class Referenceabstract

#include <Stream.h>

Inherits cinder::StreamBase.

Inherited by cinder::IoStream, cinder::IStreamFile, cinder::IStreamMem, and cinder::IStreamUrl.

Public Types

enum  Endianness { STREAM_BIG_ENDIAN, STREAM_LITTLE_ENDIAN }
 

Public Member Functions

virtual ~IStreamCinder ()
 
template<typename T >
void read (T *t)
 
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 read (std::string *s)
 
void read (fs::path *p)
 
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
 
void setFileName (const fs::path &aFileName)
 
bool getDeleteOnDestroy () const
 
void setDeleteOnDestroy (bool enable=true)
 
virtual off_t tell () const =0
 
virtual void seekAbsolute (off_t absoluteOffset)=0
 
virtual void seekRelative (off_t relativeOffset)=0
 

Static Public Member Functions

static uint8_t getNativeEndianness ()
 

Protected Member Functions

 IStreamCinder ()
 
virtual void IORead (void *t, size_t size)=0
 

Protected Attributes

fs::path mFileName
 
bool mDeleteOnDestroy
 

Static Protected Attributes

static const int MINIMUM_BUFFER_SIZE = 8
 

Member Enumeration Documentation

Enumerator
STREAM_BIG_ENDIAN 
STREAM_LITTLE_ENDIAN 

Constructor & Destructor Documentation

virtual cinder::IStreamCinder::~IStreamCinder ( )
virtual
cinder::IStreamCinder::IStreamCinder ( )
protected

Member Function Documentation

template<typename T >
void cinder::IStreamCinder::read ( T *  t)
template<typename T >
void cinder::IStreamCinder::readEndian ( T *  t,
uint8_t  endian 
)
template<typename T >
void cinder::IStreamCinder::readBig ( T *  t)
template<typename T >
void cinder::IStreamCinder::readLittle ( T *  t)
void cinder::IStreamCinder::read ( std::string *  s)

Reads characters until a null terminator.

void cinder::IStreamCinder::read ( fs::path *  p)
void cinder::IStreamCinder::readFixedString ( char *  t,
size_t  maxSize,
bool  nullTerminate 
)
void cinder::IStreamCinder::readFixedString ( std::string *  t,
size_t  size 
)
std::string cinder::IStreamCinder::readLine ( )
void cinder::IStreamCinder::readData ( void *  dest,
size_t  size 
)
virtual size_t cinder::IStreamCinder::readDataAvailable ( void *  dest,
size_t  maxSize 
)
pure virtual
virtual off_t cinder::IStreamCinder::size ( ) const
pure virtual
virtual bool cinder::IStreamCinder::isEof ( ) const
pure virtual
virtual void cinder::IStreamCinder::IORead ( void *  t,
size_t  size 
)
protectedpure virtual
static uint8_t cinder::StreamBase::getNativeEndianness ( )
staticinherited

Returns the platform's endianness as a StreamBase::Endianness.

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.

virtual off_t cinder::StreamBase::tell ( ) const
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.

virtual void cinder::StreamBase::seekAbsolute ( off_t  absoluteOffset)
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.

virtual void cinder::StreamBase::seekRelative ( off_t  relativeOffset)
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.

Member Data Documentation

const int cinder::IStreamCinder::MINIMUM_BUFFER_SIZE = 8
staticprotected
fs::path cinder::StreamBase::mFileName
protectedinherited
bool cinder::StreamBase::mDeleteOnDestroy
protectedinherited

The documentation for this class was generated from the following files: