cinder::OStream Class Reference

#include <Stream.h>

Inherits cinder::StreamBase.

Inherited by cinder::IoStream, cinder::OStreamFile, and cinder::OStreamMem.

List of all members.

Public Types

enum  Endianness { STREAM_BIG_ENDIAN, STREAM_LITTLE_ENDIAN }

Public Member Functions

virtual ~OStream ()
void write (const std::string &s)
 Writes null-terminated string, including terminator.
void write (const ci::fs::path &p)
template<typename T >
void write (T t)
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 write (const Buffer &buffer)
void writeData (const void *src, 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.
virtual off_t tell () const =0
 Returns the current position of the stream measured in bytes **/.
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.
virtual void seekRelative (off_t relativeOffset)=0
 Moves the current position of the stream by relativeOffset bytes.

Static Public Member Functions

static uint8_t getNativeEndianness ()

Public Attributes

return STREAM_BIG_ENDIAN

Protected Member Functions

 OStream ()
virtual void IOWrite (const void *t, size_t size)=0

Protected Attributes

std::string mFileName
bool mDeleteOnDestroy

Member Enumeration Documentation

Enumerator:
STREAM_BIG_ENDIAN 
STREAM_LITTLE_ENDIAN 

Constructor & Destructor Documentation

virtual cinder::OStream::~OStream (  ) [virtual]
cinder::OStream::OStream (  ) [protected]

Member Function Documentation

void cinder::OStream::write ( const std::string &  s )

Writes null-terminated string, including terminator.

void cinder::OStream::write ( const ci::fs::path &  p )
template<typename T >
void cinder::OStream::write ( t )
template<typename T >
void cinder::OStream::writeEndian ( t,
uint8_t  endian 
)
template<typename T >
void cinder::OStream::writeBig ( t )
template<typename T >
void cinder::OStream::writeLittle ( t )
void cinder::OStream::write ( const Buffer buffer )
void cinder::OStream::writeData ( const void *  src,
size_t  size 
)
virtual void cinder::OStream::IOWrite ( const void *  t,
size_t  size 
) [protected, pure virtual]
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.

virtual off_t cinder::StreamBase::tell (  ) const [pure virtual, inherited]

Returns the current position of the stream measured in bytes **/.

Implemented in cinder::IStreamFile, cinder::OStreamFile, cinder::IoStreamFile, cinder::IStreamMem, cinder::OStreamMem, and cinder::IStreamUrl.

virtual void cinder::StreamBase::seekAbsolute ( off_t  absoluteOffset ) [pure virtual, inherited]

Sets the current position of the stream to byte absoluteOffset. A negative offset is relative to the end of the file.

Implemented in cinder::IStreamFile, cinder::OStreamFile, cinder::IoStreamFile, cinder::IStreamMem, cinder::OStreamMem, and cinder::IStreamUrl.

virtual void cinder::StreamBase::seekRelative ( off_t  relativeOffset ) [pure virtual, inherited]

Moves the current position of the stream by relativeOffset bytes.

Implemented in cinder::IStreamFile, cinder::OStreamFile, cinder::IoStreamFile, cinder::IStreamMem, cinder::OStreamMem, and cinder::IStreamUrl.


Member Data Documentation

std::string cinder::StreamBase::mFileName [protected, inherited]
bool cinder::StreamBase::mDeleteOnDestroy [protected, inherited]

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