Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

CachedFile Class Reference

Inheritance diagram for CachedFile:

File Stream List of all members.

Public Member Functions

 CachedFile (CachedFileBuffer *buffer)
virtual int closeFile ()
virtual int createTemporaryFile (const char *)
virtual u_long getFileSize ()
virtual FileHandle getHandle ()
virtual int openFile (string const &file, u_long opt)
virtual int openFile (const char *, u_long)
virtual int operator= (CachedFile)
virtual int readFromFile (char *, u_long, u_long *)
virtual int setFilePointer (u_long)
virtual int setHandle (FileHandle)
virtual int write (const char *buffer, u_long len, u_long *nbw)
virtual int writeToFile (const char *, u_long, u_long *)

Protected Attributes

CachedFileBufferbuffer
u_long fseek

Constructor & Destructor Documentation

CachedFile::CachedFile CachedFileBuffer cfb  ) 
 

Costructor of the class.


Member Function Documentation

int CachedFile::closeFile  )  [virtual]
 

Close an open file handle.

Reimplemented from File.

int CachedFile::createTemporaryFile const char *  filename  )  [virtual]
 

A CachedFile can't be temporary. Create a temporary file.

Parameters:
filename The new temporary file name.

Reimplemented from File.

u_long CachedFile::getFileSize  )  [virtual]
 

Returns the file size in bytes. Returns -1 on errors.

Reimplemented from File.

FileHandle CachedFile::getHandle  )  [virtual]
 

Returns the file handle.

Reimplemented from File.

virtual int CachedFile::openFile string const &  file,
u_long  opt
[virtual]
 

Reimplemented from File.

int CachedFile::openFile const char *  nfilename,
u_long  opt
[virtual]
 

A CachedFile can't be opened directly, use a factory instead. If the function have success the return value is nonzero.

Parameters:
nfilename Filename to open. opt Specify how open the file. openFile returns 0 if the call was successfull, any other value on errors.

Reimplemented from File.

int CachedFile::operator= CachedFile  f  )  [virtual]
 

define the operator =.

Parameters:
f The file to copy.

int CachedFile::readFromFile char *  buffer,
u_long  buffersize,
u_long *  nbr
[virtual]
 

Read data from a file to a buffer. Return 1 on errors. Return 0 on success.

Parameters:
buffer The buffer where write.
buffersize The length of the buffer in bytes.
nbr How many bytes were read to the buffer.

Reimplemented from File.

int CachedFile::setFilePointer u_long  initialByte  )  [virtual]
 

Change the position of the pointer to the file.

Parameters:
initialByte The new file pointer position.

Reimplemented from File.

int CachedFile::setHandle FileHandle  hl  )  [virtual]
 

Set the file handle. Return a non null-value on errors.

Parameters:
hl The new file handle.

Reimplemented from File.

int CachedFile::write const char *  buffer,
u_long  len,
u_long *  nbw
[virtual]
 

Inherithed from Stream.

Reimplemented from File.

int CachedFile::writeToFile const char *  buffer,
u_long  buffersize,
u_long *  nbw
[virtual]
 

Write data to a file is not supported by a CachedFile, return immediately -1. Inherithed by File. buffer is the pointer to the data to write buffersize is the number of byte to write nbw is a pointer to an unsigned long that receive the number of the bytes written correctly.

Parameters:
buffer The buffer where write.
buffersize The length of the buffer in bytes.
nbw How many bytes were written to the file.

Reimplemented from File.


Member Data Documentation

CachedFileBuffer* CachedFile::buffer [protected]
 

u_long CachedFile::fseek [protected]
 


Generated on Thu May 1 12:41:00 2008 for MyServer by  doxygen 1.3.9.1