cinder::OStreamFile Class Reference

#include <Stream.h>

Inherits cinder::OStream.

List of all members.

Public Types

enum  Endianness { STREAM_BIG_ENDIAN, STREAM_LITTLE_ENDIAN }

Public Member Functions

 ~OStreamFile ()
virtual off_t tell () const
 Returns the current position of the stream measured in bytes **/.
virtual 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.
virtual void seekRelative (off_t relativeOffset)
 Moves the current position of the stream by relativeOffset bytes.
FILE * getFILE ()
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)
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)
const fs::path & getFileName () const
 Returns the file name of the path from which a Stream originated when relevant. Empty string when undefined.
void setFileName (const fs::path &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 OStreamFileRef create (FILE *file, bool ownsFile=true)
 Creates a new OStreamFileRef from a C-style file pointer FILE as returned by fopen(). If ownsFile the returned stream will destroy the stream upon its own destruction.
static uint8_t getNativeEndianness ()

Public Attributes

return STREAM_BIG_ENDIAN

Protected Member Functions

 OStreamFile (FILE *aFile, bool aOwnsFile=true)
virtual void IOWrite (const void *t, size_t size)

Protected Attributes

FILE * mFile
bool mOwnsFile
fs::path mFileName
bool mDeleteOnDestroy

Member Enumeration Documentation

Enumerator:
STREAM_BIG_ENDIAN 
STREAM_LITTLE_ENDIAN 

Constructor & Destructor Documentation

cinder::OStreamFile::~OStreamFile (  ) 
cinder::OStreamFile::OStreamFile ( FILE *  aFile,
bool  aOwnsFile = true 
) [protected]

Member Function Documentation

OStreamFileRef cinder::OStreamFile::create ( FILE *  file,
bool  ownsFile = true 
) [static]

Creates a new OStreamFileRef from a C-style file pointer FILE as returned by fopen(). If ownsFile the returned stream will destroy the stream upon its own destruction.

off_t cinder::OStreamFile::tell (  )  const [virtual]

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

Implements cinder::StreamBase.

void cinder::OStreamFile::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::OStreamFile::seekRelative ( off_t  relativeOffset  )  [virtual]

Moves the current position of the stream by relativeOffset bytes.

Implements cinder::StreamBase.

FILE* cinder::OStreamFile::getFILE (  ) 
void cinder::OStreamFile::IOWrite ( const void *  t,
size_t  size 
) [protected, virtual]

Implements cinder::OStream.

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

Writes null-terminated string, including terminator.

void cinder::OStream::write ( const ci::fs::path &  p  )  [inherited]
template<typename T >
void cinder::OStream::write ( t  )  [inherited]
void cinder::OStream::write ( const Buffer buffer  )  [inherited]
template<typename T >
void cinder::OStream::writeEndian ( t,
uint8_t  endian 
) [inherited]
template<typename T >
void cinder::OStream::writeBig ( t  )  [inherited]
template<typename T >
void cinder::OStream::writeLittle ( t  )  [inherited]
void cinder::OStream::writeData ( const void *  src,
size_t  size 
) [inherited]
static uint8_t cinder::StreamBase::getNativeEndianness (  )  [static, inherited]

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.


Member Data Documentation

FILE* cinder::OStreamFile::mFile [protected]
fs::path cinder::StreamBase::mFileName [protected, inherited]
bool cinder::StreamBase::mDeleteOnDestroy [protected, inherited]

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