class rfsv

Access remote file services of a Psion. More...

Contains pure virtuals
Definition#include <rfsv.h>
Inherited byrfsv16, rfsv32
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods

Protected Methods

Protected Members


Detailed Description

Access remote file services of a Psion.

rfsv provides an API for accessing file services of a Psion connected via ncpd. This class defines the interface and a small amount of common constants and methods. The majority of implementation is provided by rfsv32 and rfsv16 , which implement the variations of the protocol for EPOC and SIBO respectively. Usually, the class rfsvfactory is used to instantiate the correct variant depending on the remote machine, currently connected.

enum seek_mode {PSI_SEEK_SET = 1, PSI_SEEK_CUR = 2, PSI_SEEK_END = 3 }

The kown modes for seek.

enum open_flags {PSI_O_RDONLY = 0000, PSI_O_WRONLY = 0001, PSI_O_RDWR = 0002, }

The known modes for file open.

enum open_mode {PSI_O_CREAT = 00100, PSI_O_EXCL = 00200, PSI_O_TRUNC = 01000, PSI_O_APPEND = 02000, PSI_O_SHARE = 04000, }

The known modes for file creation.

enum errs {E_PSI_GEN_NONE = 0, E_PSI_GEN_FAIL = -1, E_PSI_GEN_ARG = -2, E_PSI_GEN_OS = -3, E_PSI_GEN_NSUP = -4, E_PSI_GEN_UNDER = -5, E_PSI_GEN_OVER = -6, E_PSI_GEN_RANGE = -7, E_PSI_GEN_DIVIDE = -8, E_PSI_GEN_INUSE = -9, E_PSI_GEN_NOMEMORY = - 10, E_PSI_GEN_NOSEGMENTS = -11, E_PSI_GEN_NOSEM = -12, E_PSI_GEN_NOPROC = -13, E_PSI_GEN_OPEN = -14, E_PSI_GEN_NOTOPEN = -15, E_PSI_GEN_IMAGE = -16, E_PSI_GEN_RECEIVER = -17, E_PSI_GEN_DEVICE = -18, E_PSI_GEN_FSYS = -19, E_PSI_GEN_START = -20, E_PSI_GEN_NOFONT = -21, E_PSI_GEN_TOOWIDE = -22, E_PSI_GEN_TOOMANY = -23, E_PSI_FILE_EXIST = -32, E_PSI_FILE_NXIST = -33, E_PSI_FILE_WRITE = -34, E_PSI_FILE_READ = -35, E_PSI_FILE_EOF = -36, E_PSI_FILE_FULL = -37, E_PSI_FILE_NAME = -38, E_PSI_FILE_ACCESS = -39, E_PSI_FILE_LOCKED = -40, E_PSI_FILE_DEVICE = -41, E_PSI_FILE_DIR = -42, E_PSI_FILE_RECORD = -43, E_PSI_FILE_RDONLY = -44, E_PSI_FILE_INV = -45, E_PSI_FILE_PENDING = -46, E_PSI_FILE_VOLUME = -47, E_PSI_FILE_CANCEL = -48, E_PSI_FILE_ALLOC = -49, E_PSI_FILE_DISC = -50, E_PSI_FILE_CONNECT = -51, E_PSI_FILE_RETRAN = -52, E_PSI_FILE_LINE = -53, E_PSI_FILE_INACT = -54, E_PSI_FILE_PARITY = -55, E_PSI_FILE_FRAME = -56, E_PSI_FILE_OVERRUN = -57, E_PSI_MDM_CONFAIL = -58, E_PSI_MDM_BUSY = -59, E_PSI_MDM_NOANS = -60, E_PSI_MDM_BLACKLIST = -61, E_PSI_FILE_NOTREADY = -62, E_PSI_FILE_UNKNOWN = -63, E_PSI_FILE_DIRFULL = -64, E_PSI_FILE_PROTECT = -65, E_PSI_FILE_CORRUPT = -66, E_PSI_FILE_ABORT = -67, E_PSI_FILE_ERASE = -68, E_PSI_FILE_INVALID = -69, E_PSI_GEN_POWER = -100, E_PSI_FILE_TOOBIG = -101, E_PSI_GEN_DESCR = -102, E_PSI_GEN_LIB = -103, E_PSI_FILE_NDISC = -104, E_PSI_FILE_DRIVER = -105, E_PSI_FILE_COMPLETION = -106, E_PSI_GEN_BUSY = -107, E_PSI_GEN_TERMINATED = -108, E_PSI_GEN_DIED = -109, E_PSI_FILE_HANDLE = -110, E_PSI_NOT_SIBO = -200, E_PSI_INTERNAL = -201 }

The known error codes.

enum file_attribs {/** Attributes, valid on both <em>EPOC</em> and <em>SIBO</em>. */ PSI_A_RDONLY = 0x0001, PSI_A_HIDDEN = 0x0002, PSI_A_SYSTEM = 0x0004, PSI_A_DIR = 0x0008, PSI_A_ARCHIVE = 0x0010, PSI_A_VOLUME = 0x0020, /** Attributes, valid on EPOC <em>only</em>. */ PSI_A_NORMAL = 0x0040, PSI_A_TEMP = 0x0080, PSI_A_COMPRESSED = 0x0100, /** Attributes, valid on SIBO <em>only</em>. */ PSI_A_READ = 0x0200, PSI_A_EXEC = 0x0400, PSI_A_STREAM = 0x0800, PSI_A_TEXT = 0x1000, }

The known file attributes

rfsv ()

[virtual]

void  reset ()

void  reconnect ()

Enum<errs>  getStatus ()

Retrieves the current connection status.

Returns: The status of the connection.

Enum<errs>  fopen (const u_int32_t attr, const char * const name, u_int32_t &handle)

[pure virtual]

Opens a file.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  mktemp (u_int32_t &handle, string &name)

[pure virtual]

Creates a unique temporary file. The file is opened for reading and writing.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  fcreatefile (const u_int32_t attr, const char * const name, u_int32_t &handle)

[pure virtual]

Creates a named file.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  freplacefile (const u_int32_t attr, const char * const name, u_int32_t &handle)

[pure virtual]

Creates an named file, overwriting an existing file.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  fclose (const u_int32_t handle)

[pure virtual]

Close a file on the Psion whih was previously opened/created by using fopen , fcreatefile , freplacefile or mktemp .

Parameters:

Enum<errs>  dir (const char * const name, PlpDir &ret)

[pure virtual]

Reads a directory on the Psion. The returned STL deque of PlpDirent contains all requested directory entries.

Parameters:

Returns: A Psion error code (One of enum rfsv::errs ).

Enum<errs>  fgetmtime (const char * const name, PsiTime &mtime)

[pure virtual]

Retrieves the modification time of a file on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  fsetmtime (const char * const name, const PsiTime mtime)

[pure virtual]

Sets the modification time of a file on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  fgetattr (const char * const name, u_int32_t &attr)

[pure virtual]

Retrieves attributes of a file on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  fgeteattr (const char * const name, PlpDirent &e)

[pure virtual]

Retrieves attributes, size and modification time of a file on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  fsetattr (const char * const name, const u_int32_t seta, const u_int32_t unseta)

[pure virtual]

Returns: A Psion error code (One of enum errs ).

Enum<errs>  dircount (const char * const name, u_int32_t &count)

[pure virtual]

Counts number of entries in a directory.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  devlist (u_int32_t &devbits)

[pure virtual]

Retrieves available drives on the Psion. devbits On return, for every exiting drive, a bit is set in this variable. The lowest bit represents drive A:.

Returns: A Psion error code (One of enum errs ).

Enum<errs>  devinfo (const char drive, PlpDrive &dinfo)

[pure virtual]

Retrieves details about a drive.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  fread (const u_int32_t handle, unsigned char * const buffer, const u_int32_t len, u_int32_t &count)

[pure virtual]

Reads from a file on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  fwrite (const u_int32_t handle, const unsigned char * const buffer, const u_int32_t len, u_int32_t &count)

[pure virtual]

Write to a file on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  copyFromPsion (const char *from, const char *to, void *, cpCallback_t func)

[pure virtual]

Copies a file from the Psion to the local machine.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  copyToPsion (const char * const from, const char * const to, void *, cpCallback_t func)

[pure virtual]

Copies a file from local machine to the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  copyOnPsion (const char * const from, const char * const to, void *, cpCallback_t func)

[pure virtual]

Copies a file from the Psion to the Psion. On the EPOC variants, this runs much faster than reading data from the Psion and then writing it back to the Psion, since data transfer is handled locally on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  fsetsize (const u_int32_t handle, const u_int32_t size)

[pure virtual]

Resizes an open file on the Psion. If the new size is greater than the file's current size, the contents of the added data is undefined. If The new size is smaller, the file is truncated.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  fseek (const u_int32_t handle, const int32_t offset, const u_int32_t mode, u_int32_t &resultpos)

[pure virtual]

Sets the current file position of a file on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  mkdir (const char * const name)

[pure virtual]

Creates a directory on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  rmdir (const char * const name)

[pure virtual]

Removes a directory on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  rename (const char * const oldname, const char * const newname)

[pure virtual]

Renames a file on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  remove (const char * const name)

[pure virtual]

Removes a file on the Psion.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  opendir (const u_int32_t attr, const char * const name, rfsvDirhandle &handle)

[pure virtual]

Open a directory for reading with readdir.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  readdir (rfsvDirhandle &handle, PlpDirent &entry)

[pure virtual]

Read directory entries. This method reads entries of a directory, previously opened with opendir .

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  closedir (rfsvDirhandle &handle)

[pure virtual]

Close a directory, previously opened with opendir.

Parameters:

Returns: A Psion error code (One of enum errs ).

Enum<errs>  setVolumeName (const char drive, const char * const name)

[pure virtual]

Set the name of a Psion Volume (Drive).

Parameters:

Returns: A Psion error code (One of enum errs ).

string  attr2String (const u_int32_t attr)

Converts a file attribute rfsv::file_attribs to human readable format, usable for showing them in directory listings. The first 7 characters are common to all machine types:


 	Char Nr. Value
 	0        'd' if a directory,                     '-' otherwise.
 	1        'r' if file is readable,                '-' otherwise.
 	2        'w' if file is writeable,               '-' otherwise.
 	3        'h' if file is hidden,                  '-' otherwise.
 	4        's' if file is a system file,           '-' otherwise.
 	5        'a' if file is modified (archive flag), '-' otherwise.
 	6        'v' if file is a volume name,           '-' otherwise.

The rest (3 characters) are machine specific:


 	Char Nr. EPOC Value          SIBO Value
 	7        'n' if normal,      'x' if executable, '-' otherwise.
 	8        't' if temporary,   'b' if a stream,   '-' otherwise.
 	8        'c' if compressed,  't' if a textfile, '-' otherwise.

Parameters:

Returns: Pointer to static textual representation of file attributes.

u_int32_t  opMode (const u_int32_t mode)

[pure virtual]

Converts an open-mode (A combination of the PSI_O_ constants.) from generic representation to the machine-specific representation.

Parameters:

Returns: The machine specific representation for use with fopen , fcreatefile and @freplacefile.

string  convertSlash (const string &name)

[static]

Utility method, converts '/' to '\'.

const char * getConnectName ()

[protected]

Retrieves the PLP protocol name. Mainly internal use.

Returns: The connection name always "SYS$RFSV"

ppsocket * skt

[protected]

Enum<errs> status

[protected]

int32_t serNum

[protected]


Generated by: felfert@floh.fe.think on Mon Jul 23 21:42:43 2001, using kdoc 2.0a40.