# TMCfstream Class Reference
[MCCore]

Inheritance diagram for TMCfstream:

List of all members.

## Public Member Functions
| TMCfstream ()
| TMCfstream (const int8 *fullPathName, TranscoderType type, int mode=TMCiostream::in, int32 bufSize=kDefaultBufferSize, boolean *createdNewFile=nil)
| TMCfstream (IMCFile &inFile, int mode, TranscoderType type, int32 bufSize=kDefaultBufferSize, boolean *createdNewFile=nil)
| If you use TMCiostream::current for mode, the mode will be taken from inFile, in which case you'd better have set the correct permission on it...
| ~TMCfstream ()
virtual MCErr | Init (const int8 *fullPathName, TranscoderType type, int mode=TMCiostream::in, int32 bufSize=kDefaultBufferSize, boolean *createdNewFile=nil)
virtual MCErr | Init (IMCFile &file, int32 bufSize, boolean *createdNewFile, TranscoderType type)
virtual int32 | tell ()
virtual void | seek (int32 off, seek_dir dir=beg)
virtual void | putback (int8 c)
| can only be used on (some) input streams
virtual void | read (int8 *s, int32 n)
virtual void | write (const int8 *s, int32 n)
void | append (int32 n)
void | flush ()
void | synch ()
void | SetInfo (int32 creator, int32 type)
int32 | GetFileSize ()
virtual void | readFileRef (int8 *p)
virtual void | writeFileRef (const int8 *p)
virtual void | GetPathRelativeFolder (TMCString &outString)
virtual TMCiostreamContext * | GetContext ()
const IMCFile * | GetFile ()
## Static Public Member Functions
static void | GetFileRef (const int8 *itsFullPathName, int8 *itsFileRef, const int8 *currentPath)
static void | GetFullPathNameFromRef (const int8 *itsFileRef, int8 *itsFullPathName, const int8 *currentPath)
## Protected Member Functions
void | close ()
void | LoadBuffer (int32 pos)
void | LoadPrevBuffer ()
void | LoadNextBuffer ()
void | DumpBuffer ()
## Protected Attributes
TMCCountedPtr< IMCFile > | fFile
int8 * | fBuffer
uint32 | fBufferSize
uint32 | fActualBufSize
uint32 | fBufferPos
uint32 | fBufferOffset
uint32 | fFileSize
boolean | fBufferModified
boolean | fFirstBufferLoaded

## Detailed Description

Reads/writes from/into a local file

## Constructor & Destructor Documentation

TMCfstream::TMCfstream | ( |  | ) |

TMCfstream::TMCfstream | ( | const int8 * | fullPathName,
|  | TranscoderType | type,
|  | int | mode = `TMCiostream::in`,
|  | int32 | bufSize = `kDefaultBufferSize`,
|  | boolean * | createdNewFile = `nil` |
| ) |  |  |

TMCfstream::TMCfstream | ( | IMCFile & | inFile,
|  | int | mode,
|  | TranscoderType | type,
|  | int32 | bufSize = `kDefaultBufferSize`,
|  | boolean * | createdNewFile = `nil` |
| ) |  |  |

If you use TMCiostream::current for mode, the mode will be taken from inFile, in which case you'd better have set the correct permission on it...

TMCfstream::~TMCfstream | ( |  | ) |

## Member Function Documentation

void TMCfstream::append | ( | int32 | n | ) |

void TMCfstream::close | ( |  | ) | `[protected]`

void TMCfstream::DumpBuffer | ( |  | ) | `[protected]`

void TMCfstream::flush | ( |  | ) |

virtual TMCiostreamContext* TMCfstream::GetContext | ( |  | ) | `[virtual]`

Reimplemented from TMCiostream.

const IMCFile* TMCfstream::GetFile | ( |  | ) | `[inline]`

static void TMCfstream::GetFileRef | ( | const int8 * | itsFullPathName,
|  | int8 * | itsFileRef,
|  | const int8 * | currentPath |
| ) |  |  | `[static]`

int32 TMCfstream::GetFileSize | ( |  | ) |

static void TMCfstream::GetFullPathNameFromRef | ( | const int8 * | itsFileRef,
|  | int8 * | itsFullPathName,
|  | const int8 * | currentPath |
| ) |  |  | `[static]`

virtual void TMCfstream::GetPathRelativeFolder | ( | TMCString & | outString | ) | `[virtual]`

Reimplemented from TMCiostream.

virtual MCErr TMCfstream::Init | ( | IMCFile & | file,
|  | int32 | bufSize,
|  | boolean * | createdNewFile,
|  | TranscoderType | type |
| ) |  |  | `[virtual]`

virtual MCErr TMCfstream::Init | ( | const int8 * | fullPathName,
|  | TranscoderType | type,
|  | int | mode = `TMCiostream::in`,
|  | int32 | bufSize = `kDefaultBufferSize`,
|  | boolean * | createdNewFile = `nil` |
| ) |  |  | `[virtual]`

void TMCfstream::LoadBuffer | ( | int32 | pos | ) | `[protected]`

void TMCfstream::LoadNextBuffer | ( |  | ) | `[protected]`

void TMCfstream::LoadPrevBuffer | ( |  | ) | `[protected]`

virtual void TMCfstream::putback | ( | int8 | c | ) | `[virtual]`

can only be used on (some) input streams

Implements TMCiostream.

virtual void TMCfstream::read | ( | int8 * | s,
|  | int32 | n |
| ) |  |  | `[virtual]`

Implements TMCiostream.

virtual void TMCfstream::readFileRef | ( | int8 * | p | ) | `[virtual]`

Reimplemented from TMCiostream.

virtual void TMCfstream::seek | ( | int32 | off,
|  | seek_dir | dir = `beg` |
| ) |  |  | `[virtual]`

Implements TMCiostream.

void TMCfstream::SetInfo | ( | int32 | creator,
|  | int32 | type |
| ) |  |  |

void TMCfstream::synch | ( |  | ) |

virtual int32 TMCfstream::tell | ( |  | ) | `[virtual]`

Implements TMCiostream.

virtual void TMCfstream::write | ( | const int8 * | s,
|  | int32 | n |
| ) |  |  | `[virtual]`

Implements TMCiostream.

virtual void TMCfstream::writeFileRef | ( | const int8 * | p | ) | `[virtual]`

Reimplemented from TMCiostream.

## Member Data Documentation

uint32 TMCfstream::fActualBufSize`[protected]`

int8* TMCfstream::fBuffer`[protected]`

boolean TMCfstream::fBufferModified`[protected]`

uint32 TMCfstream::fBufferOffset`[protected]`

uint32 TMCfstream::fBufferPos`[protected]`

uint32 TMCfstream::fBufferSize`[protected]`

TMCCountedPtr<IMCFile> TMCfstream::fFile`[protected]`

Reimplemented in TMCBinaryFileIO.

uint32 TMCfstream::fFileSize`[protected]`

boolean TMCfstream::fFirstBufferLoaded`[protected]`

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

- MCStream.h