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

lfc::win32PAL::files Namespace Reference

win32 files PAL. More...


Typedefs

typedef ::HANDLE Handle
 Win32 file handle type. More...


Enumerations

enum  ErrorCodes {
  errOk, errGeneric, errNotSupported, errAlreadyExists,
  errCantTruncate
}

Functions

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 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 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 = 4
const char * messagesTable [MAX_ERROR_CODE+1]
const Handle NULL_HANDLE = INVALID_HANDLE_VALUE
 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

win32 files PAL.

Todo:
lock, unlock file

need testing


Typedef Documentation

typedef ::HANDLE lfc::win32PAL::files::Handle
 

Win32 file handle type.


Enumeration Type Documentation

enum lfc::win32PAL::files::ErrorCodes
 

Enumeration values:
errOk 
errGeneric 
errNotSupported 
errAlreadyExists 
errCantTruncate 


Function Documentation

int lfc::win32PAL::files::close Handle    handle [inline]
 

close a file.

Parameters:
handle  a handle to the socket to close
Returns:
error code ( 0 == no errors )

int lfc::win32PAL::files::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 lfc::win32PAL::files::setEof Handle    handle [inline]
 

set EOF to current position.

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

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
Returns:
error code (0 means no error)
Bug:
flApplend is not implemented

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::win32PAL::files::MAX_ERROR_CODE = 4
 

const char * lfc::win32PAL::files::messagesTable
 

Initial value:

{
    "win32PAL::files -- No error (ok)",
    "win32PAL::files -- Generic error",
    "win32PAL::files -- Not supported",
    "win32PAL::files -- Already exists",
    "win32PAL::files -- Can't truncate",
}

const Handle lfc::win32PAL::files::NULL_HANDLE = INVALID_HANDLE_VALUE
 

a handle value designating an invalid handle.

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

seek mode.

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

seek mode.

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

seek mode.

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

open mode.

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

open mode.

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

open mode.

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

open mode.

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

open mode.

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

open mode.

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

open mode.

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

share mode.

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

share mode.


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