Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::FileStreamPeer Class Reference

FileStreamPeer is a basic file stream interface to wrap native file IO OS calls. More...

#include <vcf/FoundationKit/FileStreamPeer.h>

Inheritance diagram for VCF::FileStreamPeer:

VCF::LinuxFileStream VCF::OSXFileStream VCF::Win32FileStream List of all members.

Public Member Functions

virtual ~FileStreamPeer ()
virtual void seek (const uint64 &offset, const SeekType &offsetFrom)=0
 moves the seek pointer offset number of bytes in the direction specified by the offsetFrom argument.
virtual uint64 getSize ()=0
 returns the size of the file stream in bytes
virtual uint64 read (unsigned char *bytesToRead, uint64 sizeOfBytes)=0
 reads sizeOfBytes bytes from the stream into the buffer bytesToRead
virtual uint64 write (const unsigned char *bytesToWrite, uint64 sizeOfBytes)=0
 writes sizeOfBytes bytes to the file stream from the buffer bytesToWrite.
virtual char * getBuffer ()=0
 returns a pointer to the buffer that represents the file contents

Detailed Description

FileStreamPeer is a basic file stream interface to wrap native file IO OS calls.

Under Win32 this will involve calls to ReadFile() and WriteFile, among others.

Author:
Jim Crafton
Version:
1.0


Constructor & Destructor Documentation

virtual VCF::FileStreamPeer::~FileStreamPeer  )  [inline, virtual]
 


Member Function Documentation

virtual char* VCF::FileStreamPeer::getBuffer  )  [pure virtual]
 

returns a pointer to the buffer that represents the file contents

Implemented in VCF::LinuxFileStream, VCF::OSXFileStream, and VCF::Win32FileStream.

virtual uint64 VCF::FileStreamPeer::getSize  )  [pure virtual]
 

returns the size of the file stream in bytes

Implemented in VCF::LinuxFileStream, VCF::OSXFileStream, and VCF::Win32FileStream.

virtual uint64 VCF::FileStreamPeer::read unsigned char *  bytesToRead,
uint64  sizeOfBytes
[pure virtual]
 

reads sizeOfBytes bytes from the stream into the buffer bytesToRead

Parameters:
char* a buffer of at least sizeOfBytes long. This must be allocated by the caller.
uint32 the number of bytes to read from the file, starting at the current seek position.

Implemented in VCF::LinuxFileStream, VCF::OSXFileStream, and VCF::Win32FileStream.

virtual void VCF::FileStreamPeer::seek const uint64 offset,
const SeekType offsetFrom
[pure virtual]
 

moves the seek pointer offset number of bytes in the direction specified by the offsetFrom argument.

Parameters:
uint32 the number of bytes of offset the seek pointer
SeekType the direction to offset the seek pointer, which may be one of the following values
SEEK_FROM_START - offsets from the beginning of the file
SEEK_FROM_RELATIVE - offsets relative to the current seek position
SEEK_FROM_END - offsets backwards, starting at the end of the file

Implemented in VCF::LinuxFileStream, VCF::OSXFileStream, and VCF::Win32FileStream.

virtual uint64 VCF::FileStreamPeer::write const unsigned char *  bytesToWrite,
uint64  sizeOfBytes
[pure virtual]
 

writes sizeOfBytes bytes to the file stream from the buffer bytesToWrite.

Parameters:
char* a buffer that must be at least sizeOfBytes long, that contains the data that will written out to the file stream
@ uint32 the number of bytes to write

Implemented in VCF::LinuxFileStream, VCF::OSXFileStream, and VCF::Win32FileStream.


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information