Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

lfc::posixPAL::files Namespace Reference

posix files PAL. More...


Typedefs

typedef int Handle
 posix file type. More...


Enumerations

enum  ErrorCodes { errOk, errGeneric, errNotSupported, errAlreadyExists }

Functions

int init ()
 init files PAL. More...

int cleanup ()
 cleanup files PAL. More...

int open (Handle &handle, const char *name, int flags, int shareFlags)
 open/create a file. More...

int close (Handle handle)
 close a file. More...

int seek (Handle handle, long offset, int mode, long &pos)
 moves the file pointer of an open file. More...

int setEof (Handle handle)
 set EOF to current position. More...

int write (Handle handle, const void *buff, long count, long &written)
 write data to a file. More...

int read (Handle handle, void *buff, long count, long &read)
 read data from a file. More...

int flush (Handle handle)
 flush file buffers. More...

const char * message (int index)
 return the message coresponding to a return code. More...


Variables

const int MAX_ERROR_CODE = 3
const char * messagesTable [MAX_ERROR_CODE+1]
const Handle NULL_HANDLE = -1
 a handle value designating an invalid handle. More...

const int seekSet = 0x0001
 seek mode. More...

const int seekCurrent = 0x0002
 seek mode. More...

const int seekEnd = 0x0004
 seek mode. More...

const int flAppend = 0x0001
 open mode. More...

const int flRead = 0x0002
 open mode. More...

const int flWrite = 0x0004
 open mode. More...

const int flTruncate = 0x0008
 open mode. More...

const int flOpenExisting = 0x0010
 open mode. More...

const int flCreateNew = 0x0020
 open mode. More...

const int flTemp = 0x0040
 open mode. More...

const int shRead = 0x0001
 share mode. More...

const int shWrite = 0x0002
 share mode. More...


Detailed Description

posix files PAL.

Todo:
needs testing


Typedef Documentation

typedef int lfc::posixPAL::files::Handle
 

posix file type.


Enumeration Type Documentation

enum lfc::posixPAL::files::ErrorCodes
 

Enumeration values:
errOk 
errGeneric 
errNotSupported 
errAlreadyExists 


Function Documentation

int init   [inline]
 

init files PAL.

Returns:
error code (0 means no error)

int cleanup   [inline]
 

cleanup files PAL.

Returns:
error code (0 means no error)

int open Handle   handle,
const char *    name,
int    flags,
int    shareFlags
[inline]
 

open/create a file.

Parameters:
handle  will contain the handle if the operation succed, no modification otherwhise
name  file name
flags  open mode, see File::OpenMode
shareFlags  sharing, see File::ShareMode , 0 for no sharing
Returns:
error code (0 means no error)
Bug:
flTemp not implemented

int close Handle    handle [inline]
 

close a file.

Parameters:
handle  a valid file handle
Returns:
error code (0 means no error)

int seek Handle    handle,
long    offset,
int    mode,
long &    pos
[inline]
 

moves the file pointer of an open file.

Parameters:
handle  a valid file handle
offset  offset to move file pointer (see SeekMode)
mode  indicate relative moving base
pos  return new position
Returns:
error code (0 means no error)

int setEof Handle    handle [inline]
 

set EOF to current position.

Parameters:
handle  a valid file handle
Returns:
error code (0 means no error)

int write Handle    handle,
const void *    buff,
long    count,
long &    writtenCount
[inline]
 

write data to a file.

Parameters:
handle  a valid file handle
buff  pointer to the data to be written
count  number of bytes to write
written  return the actual number of bytes written
Returns:
error code (0 means no error)

int read Handle    handle,
void *    buff,
long    count,
long &    readCount
[inline]
 

read data from a file.

Parameters:
handle  a valid file handle
buff  pointer to the buffer that will receive the data
count  number of bytes to read
written  return the actual number of bytes read
Returns:
error code (0 means no error)

int flush Handle    handle [inline]
 

flush file buffers.

Parameters:
handle  a valid file handle
Returns:
error code (0 means no error)

const char* message int    index [inline]
 

return the message coresponding to a return code.

Parameters:
index  message index (return code from other pal functions)


Variable Documentation

const int lfc::posixPAL::files::MAX_ERROR_CODE = 3
 

const char * lfc::posixPAL::files::messagesTable
 

Initial value:

{
    "posixPAL::files -- No error (ok)",
    "posixPAL::files -- Generic error",
    "posixPAL::files -- Not supported",
    "posixPAL::files -- Already exists",
}

const Handle lfc::posixPAL::files::NULL_HANDLE = -1
 

a handle value designating an invalid handle.

const int lfc::posixPAL::files::seekSet = 0x0001
 

seek mode.

const int lfc::posixPAL::files::seekCurrent = 0x0002
 

seek mode.

const int lfc::posixPAL::files::seekEnd = 0x0004
 

seek mode.

const int lfc::posixPAL::files::flAppend = 0x0001
 

open mode.

const int lfc::posixPAL::files::flRead = 0x0002
 

open mode.

const int lfc::posixPAL::files::flWrite = 0x0004
 

open mode.

const int lfc::posixPAL::files::flTruncate = 0x0008
 

open mode.

const int lfc::posixPAL::files::flOpenExisting = 0x0010
 

open mode.

const int lfc::posixPAL::files::flCreateNew = 0x0020
 

open mode.

const int lfc::posixPAL::files::flTemp = 0x0040
 

open mode.

const int lfc::posixPAL::files::shRead = 0x0001
 

share mode.

const int lfc::posixPAL::files::shWrite = 0x0002
 

share mode.


Generated on Sat Jan 26 00:35:08 2002 for LFC2 PAL by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001