plptools
Loading...
Searching...
No Matches
rfsv Class Referenceabstract

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

#include <rfsv.h>

Inheritance diagram for rfsv:
Collaboration diagram for rfsv:

Public Types

enum  seek_mode { PSI_SEEK_SET = 1 , PSI_SEEK_CUR = 2 , PSI_SEEK_END = 3 }
 The kown modes for seek. More...
 
enum  open_flags { PSI_O_RDONLY = 0000 , PSI_O_WRONLY = 0001 , PSI_O_RDWR = 0002 }
 The known modes for file open. More...
 
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. More...
 
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. More...
 
enum  file_attribs {
  PSI_A_RDONLY = 0x0001 , PSI_A_HIDDEN = 0x0002 , PSI_A_SYSTEM = 0x0004 , PSI_A_DIR = 0x0008 ,
  PSI_A_ARCHIVE = 0x0010 , PSI_A_VOLUME = 0x0020 , PSI_A_NORMAL = 0x0040 , PSI_A_TEMP = 0x0080 ,
  PSI_A_COMPRESSED = 0x0100 , PSI_A_READ = 0x0200 , PSI_A_EXEC = 0x0400 , PSI_A_STREAM = 0x0800 ,
  PSI_A_TEXT = 0x1000
}
 The known file attributes. More...
 

Public Member Functions

virtual ~rfsv ()
 
void reset ()
 
void reconnect ()
 
Enum< errsgetStatus ()
 Retrieves the current connection status. More...
 
virtual Enum< errsfopen (const uint32_t attr, const char *const name, uint32_t &handle)=0
 Opens a file. More...
 
virtual Enum< errsmktemp (uint32_t &handle, std::string &name)=0
 Creates a unique temporary file. More...
 
virtual Enum< errsfcreatefile (const uint32_t attr, const char *const name, uint32_t &handle)=0
 Creates a named file. More...
 
virtual Enum< errsfreplacefile (const uint32_t attr, const char *const name, uint32_t &handle)=0
 Creates an named file, overwriting an existing file. More...
 
virtual Enum< errsfclose (const uint32_t handle)=0
 Close a file on the Psion whih was previously opened/created by using fopen , fcreatefile , freplacefile or mktemp . More...
 
virtual Enum< errsdir (const char *const name, PlpDir &ret)=0
 Reads a directory on the Psion. More...
 
virtual Enum< errsfgetmtime (const char *const name, PsiTime &mtime)=0
 Retrieves the modification time of a file on the Psion. More...
 
virtual Enum< errsfsetmtime (const char *const name, const PsiTime mtime)=0
 Sets the modification time of a file on the Psion. More...
 
virtual Enum< errsfgetattr (const char *const name, uint32_t &attr)=0
 Retrieves attributes of a file on the Psion. More...
 
virtual Enum< errspathtest (const char *const name)=0
 Checks to see if the directory component of a path or file name exists and is valid. More...
 
virtual Enum< errsfgeteattr (const char *const name, PlpDirent &e)=0
 Retrieves attributes, size and modification time of a file on the Psion. More...
 
virtual Enum< errsfsetattr (const char *const name, const uint32_t seta, const uint32_t unseta)=0
 
virtual Enum< errsdircount (const char *const name, uint32_t &count)=0
 Counts number of entries in a directory. More...
 
virtual Enum< errsdevlist (uint32_t &devbits)=0
 Retrieves available drives on the Psion. More...
 
virtual Enum< errsdevinfo (const char drive, PlpDrive &dinfo)=0
 Retrieves details about a drive. More...
 
virtual Enum< errsfread (const uint32_t handle, unsigned char *const buffer, const uint32_t len, uint32_t &count)=0
 Reads from a file on the Psion. More...
 
virtual Enum< errsfwrite (const uint32_t handle, const unsigned char *const buffer, const uint32_t len, uint32_t &count)=0
 Write to a file on the Psion. More...
 
virtual Enum< errscopyFromPsion (const char *from, const char *to, void *, cpCallback_t func)=0
 Copies a file from the Psion to the local machine. More...
 
virtual Enum< rfsv::errscopyFromPsion (const char *from, int fd, cpCallback_t cb)=0
 Copies a file from the Psion to the local machine. More...
 
virtual Enum< errscopyToPsion (const char *const from, const char *const to, void *, cpCallback_t func)=0
 Copies a file from local machine to the Psion. More...
 
virtual Enum< errscopyOnPsion (const char *const from, const char *const to, void *, cpCallback_t func)=0
 Copies a file from the Psion to the Psion. More...
 
virtual Enum< errsfsetsize (const uint32_t handle, const uint32_t size)=0
 Resizes an open file on the Psion. More...
 
virtual Enum< errsfseek (const uint32_t handle, const int32_t offset, const uint32_t mode, uint32_t &resultpos)=0
 Sets the current file position of a file on the Psion. More...
 
virtual Enum< errsmkdir (const char *const name)=0
 Creates a directory on the Psion. More...
 
virtual Enum< errsrmdir (const char *const name)=0
 Removes a directory on the Psion. More...
 
virtual Enum< errsrename (const char *const oldname, const char *const newname)=0
 Renames a file on the Psion. More...
 
virtual Enum< errsremove (const char *const name)=0
 Removes a file on the Psion. More...
 
virtual Enum< errsopendir (const uint32_t attr, const char *const name, rfsvDirhandle &handle)=0
 Open a directory for reading with readdir. More...
 
virtual Enum< errsreaddir (rfsvDirhandle &handle, PlpDirent &entry)=0
 Read directory entries. More...
 
virtual Enum< errsclosedir (rfsvDirhandle &handle)=0
 Close a directory, previously opened with opendir. More...
 
virtual Enum< errssetVolumeName (const char drive, const char *const name)=0
 Set the name of a Psion Volume (Drive). More...
 
std::string attr2String (const uint32_t attr)
 Converts a file attribute rfsv::file_attribs to human readable format, usable for showing them in directory listings. More...
 
virtual uint32_t opMode (const uint32_t mode)=0
 Converts an open-mode (A combination of the PSI_O_ constants.) from generic representation to the machine-specific representation. More...
 
int getSpeed ()
 Retrieve speed of serial link. More...
 
virtual int getProtocolVersion ()=0
 Retrieves the protocol version. More...
 

Static Public Member Functions

static std::string convertSlash (const std::string &name)
 Utility method, converts '/' to '\'. More...
 

Protected Member Functions

const char * getConnectName ()
 Retrieves the PLP protocol name. More...
 

Protected Attributes

TCPSocketskt
 
Enum< errsstatus
 
int32_t serNum
 

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.

Definition at line 75 of file rfsv.h.

Member Enumeration Documentation

◆ errs

enum rfsv::errs

The known error codes.

Enumerator
E_PSI_GEN_NONE 
E_PSI_GEN_FAIL 
E_PSI_GEN_ARG 
E_PSI_GEN_OS 
E_PSI_GEN_NSUP 
E_PSI_GEN_UNDER 
E_PSI_GEN_OVER 
E_PSI_GEN_RANGE 
E_PSI_GEN_DIVIDE 
E_PSI_GEN_INUSE 
E_PSI_GEN_NOMEMORY 
E_PSI_GEN_NOSEGMENTS 
E_PSI_GEN_NOSEM 
E_PSI_GEN_NOPROC 
E_PSI_GEN_OPEN 
E_PSI_GEN_NOTOPEN 
E_PSI_GEN_IMAGE 
E_PSI_GEN_RECEIVER 
E_PSI_GEN_DEVICE 
E_PSI_GEN_FSYS 
E_PSI_GEN_START 
E_PSI_GEN_NOFONT 
E_PSI_GEN_TOOWIDE 
E_PSI_GEN_TOOMANY 
E_PSI_FILE_EXIST 
E_PSI_FILE_NXIST 
E_PSI_FILE_WRITE 
E_PSI_FILE_READ 
E_PSI_FILE_EOF 
E_PSI_FILE_FULL 
E_PSI_FILE_NAME 
E_PSI_FILE_ACCESS 
E_PSI_FILE_LOCKED 
E_PSI_FILE_DEVICE 
E_PSI_FILE_DIR 
E_PSI_FILE_RECORD 
E_PSI_FILE_RDONLY 
E_PSI_FILE_INV 
E_PSI_FILE_PENDING 
E_PSI_FILE_VOLUME 
E_PSI_FILE_CANCEL 
E_PSI_FILE_ALLOC 
E_PSI_FILE_DISC 
E_PSI_FILE_CONNECT 
E_PSI_FILE_RETRAN 
E_PSI_FILE_LINE 
E_PSI_FILE_INACT 
E_PSI_FILE_PARITY 
E_PSI_FILE_FRAME 
E_PSI_FILE_OVERRUN 
E_PSI_MDM_CONFAIL 
E_PSI_MDM_BUSY 
E_PSI_MDM_NOANS 
E_PSI_MDM_BLACKLIST 
E_PSI_FILE_NOTREADY 
E_PSI_FILE_UNKNOWN 
E_PSI_FILE_DIRFULL 
E_PSI_FILE_PROTECT 
E_PSI_FILE_CORRUPT 
E_PSI_FILE_ABORT 
E_PSI_FILE_ERASE 
E_PSI_FILE_INVALID 
E_PSI_GEN_POWER 
E_PSI_FILE_TOOBIG 
E_PSI_GEN_DESCR 
E_PSI_GEN_LIB 
E_PSI_FILE_NDISC 
E_PSI_FILE_DRIVER 
E_PSI_FILE_COMPLETION 
E_PSI_GEN_BUSY 
E_PSI_GEN_TERMINATED 
E_PSI_GEN_DIED 
E_PSI_FILE_HANDLE 
E_PSI_NOT_SIBO 
E_PSI_INTERNAL 

Definition at line 109 of file rfsv.h.

◆ file_attribs

The known file attributes.

Enumerator
PSI_A_RDONLY 

Attributes, valid on both EPOC and SIBO.

PSI_A_HIDDEN 
PSI_A_SYSTEM 
PSI_A_DIR 
PSI_A_ARCHIVE 
PSI_A_VOLUME 
PSI_A_NORMAL 

Attributes, valid on EPOC only.

PSI_A_TEMP 
PSI_A_COMPRESSED 
PSI_A_READ 

Attributes, valid on SIBO only.

PSI_A_EXEC 
PSI_A_STREAM 
PSI_A_TEXT 

Definition at line 193 of file rfsv.h.

◆ open_flags

The known modes for file open.

Enumerator
PSI_O_RDONLY 
PSI_O_WRONLY 
PSI_O_RDWR 

Definition at line 89 of file rfsv.h.

◆ open_mode

The known modes for file creation.

Enumerator
PSI_O_CREAT 
PSI_O_EXCL 
PSI_O_TRUNC 
PSI_O_APPEND 
PSI_O_SHARE 

Definition at line 98 of file rfsv.h.

◆ seek_mode

The kown modes for seek.

Enumerator
PSI_SEEK_SET 
PSI_SEEK_CUR 
PSI_SEEK_END 

Definition at line 80 of file rfsv.h.

Constructor & Destructor Documentation

◆ ~rfsv()

rfsv::~rfsv ( )
virtual

Definition at line 113 of file rfsv.cc.

Member Function Documentation

◆ attr2String()

string rfsv::attr2String ( const uint32_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
attrthe generic file attribute.
Returns
Pointer to static textual representation of file attributes.

Definition at line 149 of file rfsv.cc.

◆ closedir()

virtual Enum< errs > rfsv::closedir ( rfsvDirhandle handle)
pure virtual

Close a directory, previously opened with opendir.

Parameters
handleA handle, obtained by calling opendir .
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ convertSlash()

string rfsv::convertSlash ( const std::string &  name)
static

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

Definition at line 140 of file rfsv.cc.

◆ copyFromPsion() [1/2]

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

Copies a file from the Psion to the local machine.

Parameters
fromName of the file on the Psion to be copied.
toName of the destination file on the local machine.
funcPointer to a function which gets called on every read. This function can be used to show some progress etc. May be set to NULL, where no callback is performed. If the callback function returns 0, the operation is aborted and E_PSI_FILE_CANCEL is returned.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ copyFromPsion() [2/2]

virtual Enum< rfsv::errs > rfsv::copyFromPsion ( const char *  from,
int  fd,
cpCallback_t  cb 
)
pure virtual

Copies a file from the Psion to the local machine.

Implemented in rfsv16, and rfsv32.

◆ copyOnPsion()

virtual Enum< errs > rfsv::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
fromName of the file to be copied.
toName of the destination file.
funcPointer to a function which gets called on every read. This function can be used to show some progress etc. May be set to NULL, where no callback is performed. If the callback function returns 0, the operation is aborted and E_PSI_FILE_CANCEL is returned.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ copyToPsion()

virtual Enum< errs > rfsv::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
fromName of the file on the local machine to be copied.
toName of the destination file on the Psion.
funcPointer to a function which gets called on every read. This function can be used to show some progress etc. May be set to NULL, where no callback is performed. If the callback function returns 0, the operation is aborted and E_PSI_FILE_CANCEL is returned.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ devinfo()

virtual Enum< errs > rfsv::devinfo ( const char  drive,
PlpDrive dinfo 
)
pure virtual

Retrieves details about a drive.

Parameters
driveThe drive character of the drive to get details from (e.g: 'C', 'D' etc.). (0 represents A:, 1 is B: and so on ...)
dinfoA PlpDrive object which is filled with the drive's information upon return.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ devlist()

virtual Enum< errs > rfsv::devlist ( uint32_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 ).

Implemented in rfsv16, and rfsv32.

◆ dir()

virtual Enum< errs > rfsv::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
nameThe name of the directory
retAn STL deque of PlpDirent entries.
Returns
A Psion error code (One of enum rfsv::errs ).

Implemented in rfsv16, and rfsv32.

◆ dircount()

virtual Enum< errs > rfsv::dircount ( const char *const  name,
uint32_t &  count 
)
pure virtual

Counts number of entries in a directory.

Parameters
nameThe directory whose entries are to be counted.
countThe number of entries is returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fclose()

virtual Enum< errs > rfsv::fclose ( const uint32_t  handle)
pure virtual

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

Parameters
handleA valid file handle.

Implemented in rfsv16, and rfsv32.

◆ fcreatefile()

virtual Enum< errs > rfsv::fcreatefile ( const uint32_t  attr,
const char *const  name,
uint32_t &  handle 
)
pure virtual

Creates a named file.

Parameters
attrThe open mode. Use opMode to convert a combination of open_flags and open_mode to the machine-specific representation.
nameThe name of the file to create.
handleThe handle for usage with fread , fwrite , fseek or fclose is returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fgetattr()

virtual Enum< errs > rfsv::fgetattr ( const char *const  name,
uint32_t &  attr 
)
pure virtual

Retrieves attributes of a file on the Psion.

Parameters
nameName of the file whose attributes ar to be retrieved.
attrThe file's attributes are returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fgeteattr()

virtual Enum< errs > rfsv::fgeteattr ( const char *const  name,
PlpDirent e 
)
pure virtual

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

Parameters
nameThe name of the file.
ePlpDirent object, filled with the information on return.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fgetmtime()

virtual Enum< errs > rfsv::fgetmtime ( const char *const  name,
PsiTime mtime 
)
pure virtual

Retrieves the modification time of a file on the Psion.

Parameters
nameName of the file.
mtimeModification time is returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fopen()

virtual Enum< errs > rfsv::fopen ( const uint32_t  attr,
const char *const  name,
uint32_t &  handle 
)
pure virtual

Opens a file.

Parameters
attrThe open mode. Use opMode to convert a combination of open_flags and open_mode to the machine-specific representation.
nameThe name of the file to open.
handleThe handle for usage with fread , fwrite , fseek or fclose is returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fread()

virtual Enum< errs > rfsv::fread ( const uint32_t  handle,
unsigned char *const  buffer,
const uint32_t  len,
uint32_t &  count 
)
pure virtual

Reads from a file on the Psion.

Parameters
handleHandle of the file to read from.
bufferThe area where to store the data read.
lenThe number of bytes to read.
countThe number of bytes actually read is returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ freplacefile()

virtual Enum< errs > rfsv::freplacefile ( const uint32_t  attr,
const char *const  name,
uint32_t &  handle 
)
pure virtual

Creates an named file, overwriting an existing file.

Parameters
attrThe open mode. Use opMode to convert a combination of open_flags and open_mode to the machine-specific representation.
nameThe name of the file to create.
handleThe handle for usage with fread , fwrite , fseek or fclose is returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fseek()

virtual Enum< errs > rfsv::fseek ( const uint32_t  handle,
const int32_t  offset,
const uint32_t  mode,
uint32_t &  resultpos 
)
pure virtual

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

Parameters
handleThe file handle.
offsetPosition to be seeked to.
modeThe mode for seeking.
resultposThe final file position after seeking is returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fsetattr()

virtual Enum< errs > rfsv::fsetattr ( const char *const  name,
const uint32_t  seta,
const uint32_t  unseta 
)
pure virtual
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fsetmtime()

virtual Enum< errs > rfsv::fsetmtime ( const char *const  name,
const PsiTime  mtime 
)
pure virtual

Sets the modification time of a file on the Psion.

Parameters
nameName of the file whose modification time should be set.
mtimeThe desired modification time.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fsetsize()

virtual Enum< errs > rfsv::fsetsize ( const uint32_t  handle,
const uint32_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
handleHandle of the file to be resized.
sizeNew size for that file.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ fwrite()

virtual Enum< errs > rfsv::fwrite ( const uint32_t  handle,
const unsigned char *const  buffer,
const uint32_t  len,
uint32_t &  count 
)
pure virtual

Write to a file on the Psion.

Parameters
handleHandle of the file to read from.
bufferThe area to be written.
lenThe number of bytes to write.
countThe number of bytes actually written is returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ getConnectName()

const char * rfsv::getConnectName ( void  )
protected

Retrieves the PLP protocol name.

Mainly internal use.

Returns
The connection name always "SYS$RFSV"

Definition at line 109 of file rfsv.cc.

◆ getProtocolVersion()

virtual int rfsv::getProtocolVersion ( )
pure virtual

Retrieves the protocol version.

Returns
Either 3 or 5 representing Series 3 (SIBO) or Series 5 (EPOC)

Implemented in rfsv16, and rfsv32.

◆ getSpeed()

int rfsv::getSpeed ( )

Retrieve speed of serial link.

Returns
The speed of the serial link in baud or -1 on error.

Definition at line 172 of file rfsv.cc.

◆ getStatus()

Enum< rfsv::errs > rfsv::getStatus ( void  )

Retrieves the current connection status.

Returns
The status of the connection.

Definition at line 136 of file rfsv.cc.

◆ mkdir()

virtual Enum< errs > rfsv::mkdir ( const char *const  name)
pure virtual

Creates a directory on the Psion.

Parameters
nameName of the directory to be created.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ mktemp()

virtual Enum< errs > rfsv::mktemp ( uint32_t &  handle,
std::string &  name 
)
pure virtual

Creates a unique temporary file.

The file is opened for reading and writing.

Parameters
handleThe handle for usage with fread , fwrite , fseek or fclose is returned here.
nameThe name of the temporary file is returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ opendir()

virtual Enum< errs > rfsv::opendir ( const uint32_t  attr,
const char *const  name,
rfsvDirhandle handle 
)
pure virtual

Open a directory for reading with readdir.

Parameters
attrA combination of PSI_A_.. flags, representing the desired types of entries to be returned when calling readdir .
nameThe name of the directory
handleA handle to be used with readdir and closedir .
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ opMode()

virtual uint32_t rfsv::opMode ( const uint32_t  mode)
pure virtual

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

Parameters
modeThe generic open mode.
Returns
The machine specific representation for use with fopen , fcreatefile and freplacefile.

Implemented in rfsv16, and rfsv32.

◆ pathtest()

virtual Enum< errs > rfsv::pathtest ( const char *const  name)
pure virtual

Checks to see if the directory component of a path or file name exists and is valid.

Returns E_PSI_GEN_NONE if is valid.

Only paths up to the last trailing backslash are tested; trailing filenames are ignored. For example,

  • "C:\\" tests the validity of "C:\" - "C:\System" tests the validity of "C:\" - "C:\System\" tests the validity of "C:\System\" - "D:\Documents\hello.txt" tests the validity of "D:\Documents\"

This can be safely used to test for the existence of directories and drives on EPOC16 and EPOC32; check for E_PSI_FILE_NXIST, E_PSI_FILE_DIR, E_PSI_FILE_DEVICE, and E_PSI_FILE_NOTREADY to determine non-existence.

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

Implemented in rfsv16, and rfsv32.

◆ readdir()

virtual Enum< errs > rfsv::readdir ( rfsvDirhandle handle,
PlpDirent entry 
)
pure virtual

Read directory entries.

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

Parameters
handleA handle, obtained by calling opendir .
entryThe entry information is returned here.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ reconnect()

void rfsv::reconnect ( void  )

Definition at line 117 of file rfsv.cc.

◆ remove()

virtual Enum< errs > rfsv::remove ( const char *const  name)
pure virtual

Removes a file on the Psion.

Parameters
nameName of the file to be removed.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ rename()

virtual Enum< errs > rfsv::rename ( const char *const  oldname,
const char *const  newname 
)
pure virtual

Renames a file on the Psion.

Parameters
oldnameName of the file to be renamed.
newnameNew Name for that file.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ reset()

void rfsv::reset ( void  )

Definition at line 124 of file rfsv.cc.

◆ rmdir()

virtual Enum< errs > rfsv::rmdir ( const char *const  name)
pure virtual

Removes a directory on the Psion.

Parameters
nameName of the directory to be removed.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

◆ setVolumeName()

virtual Enum< errs > rfsv::setVolumeName ( const char  drive,
const char *const  name 
)
pure virtual

Set the name of a Psion Volume (Drive).

Parameters
driveThe drive character of the Volume, whose name should be set.
nameThe new name for that drive.
Returns
A Psion error code (One of enum errs ).

Implemented in rfsv16, and rfsv32.

Member Data Documentation

◆ serNum

int32_t rfsv::serNum
protected

Definition at line 647 of file rfsv.h.

◆ skt

TCPSocket* rfsv::skt
protected

Definition at line 645 of file rfsv.h.

◆ status

Enum<errs> rfsv::status
protected

Definition at line 646 of file rfsv.h.


The documentation for this class was generated from the following files: