# Cinder

# 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 ()
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 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.
## Static Public Member Functions
static OStreamFileRef | createRef (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
std::string | mFileName

## Member Enumeration Documentation

enum cinder::StreamBase::Endianness`[inherited]`

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::createRef | ( | 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.

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]`

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.

## Member Data Documentation

FILE* cinder::OStreamFile::mFile`[protected]`

bool cinder::OStreamFile::mOwnsFile`[protected]`

return cinder::StreamBase::STREAM_BIG_ENDIAN`[inherited]`

std::string cinder::StreamBase::mFileName`[protected, inherited]`

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

- include/cinder/Stream.h
- src/cinder/Stream.cpp