plptools
Loading...
Searching...
No Matches
rfsv32 Class Reference

This is the implementation of the rfsv protocol for Psion series 5 (EPOC) variant. More...

#include <rfsv32.h>

Inheritance diagram for rfsv32:
Collaboration diagram for rfsv32:

Public Member Functions

Enum< rfsv::errsdir (const char *const, PlpDir &)
 Reads a directory on the Psion. More...
 
Enum< rfsv::errsdircount (const char *const, uint32_t &)
 Counts number of entries in a directory. More...
 
Enum< rfsv::errscopyFromPsion (const char *const, const char *const, void *, cpCallback_t)
 Copies a file from the Psion to the local machine. More...
 
Enum< rfsv::errscopyFromPsion (const char *from, int fd, cpCallback_t cb)
 Copies a file from the Psion to the local machine. More...
 
Enum< rfsv::errscopyToPsion (const char *const, const char *const, void *, cpCallback_t)
 Copies a file from local machine to the Psion. More...
 
Enum< rfsv::errscopyOnPsion (const char *const, const char *const, void *, cpCallback_t)
 Copies a file from the Psion to the Psion. More...
 
Enum< rfsv::errspathtest (const char *const)
 Checks to see if the directory component of a path or file name exists and is valid. More...
 
Enum< rfsv::errsmkdir (const char *const)
 Creates a directory on the Psion. More...
 
Enum< rfsv::errsrmdir (const char *const)
 Removes a directory on the Psion. More...
 
Enum< rfsv::errsremove (const char *const)
 Removes a file on the Psion. More...
 
Enum< rfsv::errsrename (const char *const, const char *const)
 Renames a file on the Psion. More...
 
Enum< rfsv::errsmktemp (uint32_t &, std::string &)
 Creates a unique temporary file. More...
 
Enum< rfsv::errsfgeteattr (const char *const, PlpDirent &)
 Retrieves attributes, size and modification time of a file on the Psion. More...
 
Enum< rfsv::errsfgetattr (const char *const, uint32_t &)
 Retrieves attributes of a file on the Psion. More...
 
Enum< rfsv::errsfsetattr (const char *const, const uint32_t, const uint32_t)
 
Enum< rfsv::errsfgetmtime (const char *const, PsiTime &)
 Retrieves the modification time of a file on the Psion. More...
 
Enum< rfsv::errsfsetmtime (const char *const, PsiTime const)
 Sets the modification time of a file on the Psion. More...
 
Enum< rfsv::errsfopen (const uint32_t, const char *const, uint32_t &)
 Opens a file. More...
 
Enum< rfsv::errsfcreatefile (const uint32_t, const char *const, uint32_t &)
 Creates a named file. More...
 
Enum< rfsv::errsfreplacefile (const uint32_t, const char *const, uint32_t &)
 Creates an named file, overwriting an existing file. More...
 
Enum< rfsv::errsfseek (const uint32_t, const int32_t, const uint32_t, uint32_t &)
 Sets the current file position of a file on the Psion. More...
 
Enum< rfsv::errsfread (const uint32_t, unsigned char *const, const uint32_t, uint32_t &)
 Reads from a file on the Psion. More...
 
Enum< rfsv::errsfwrite (const uint32_t, const unsigned char *const, const uint32_t, uint32_t &)
 Write to a file on the Psion. More...
 
Enum< rfsv::errsfsetsize (uint32_t, uint32_t)
 Resizes an open file on the Psion. More...
 
Enum< rfsv::errsfclose (const uint32_t)
 Close a file on the Psion whih was previously opened/created by using fopen , fcreatefile , freplacefile or mktemp . More...
 
Enum< rfsv::errsdevlist (uint32_t &)
 Retrieves available drives on the Psion. More...
 
Enum< rfsv::errsdevinfo (const char, PlpDrive &)
 Retrieves details about a drive. More...
 
Enum< rfsv::errsopendir (const uint32_t, const char *const, rfsvDirhandle &)
 Open a directory for reading with readdir. More...
 
Enum< rfsv::errsreaddir (rfsvDirhandle &, PlpDirent &)
 Read directory entries. More...
 
Enum< rfsv::errsclosedir (rfsvDirhandle &)
 Close a directory, previously opened with opendir. More...
 
Enum< rfsv::errssetVolumeName (const char, const char *const)
 Set the name of a Psion Volume (Drive). More...
 
uint32_t opMode (const uint32_t)
 Converts an open-mode (A combination of the PSI_O_ constants.) from generic representation to the machine-specific representation. More...
 
int getProtocolVersion ()
 Retrieves the protocol version. More...
 
- Public Member Functions inherited from rfsv
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...
 

Private Types

enum  file_attrib {
  EPOC_ATTR_RONLY = 0x0001 , EPOC_ATTR_HIDDEN = 0x0002 , EPOC_ATTR_SYSTEM = 0x0004 , EPOC_ATTR_DIRECTORY = 0x0010 ,
  EPOC_ATTR_ARCHIVE = 0x0020 , EPOC_ATTR_VOLUME = 0x0040 , EPOC_ATTR_NORMAL = 0x0080 , EPOC_ATTR_TEMPORARY = 0x0100 ,
  EPOC_ATTR_COMPRESSED = 0x0800 , EPOC_ATTR_MASK = 0x09f7 , EPOC_ATTR_GETUID = 0x10000000
}
 
enum  open_mode {
  EPOC_OMODE_SHARE_EXCLUSIVE = 0x0000 , EPOC_OMODE_SHARE_READERS = 0x0001 , EPOC_OMODE_SHARE_ANY = 0x0002 , EPOC_OMODE_BINARY = 0x0000 ,
  EPOC_OMODE_TEXT = 0x0020 , EPOC_OMODE_READ_WRITE = 0x0200
}
 
enum  epoc_errs {
  E_EPOC_NONE = 0 , E_EPOC_NOT_FOUND = -1 , E_EPOC_GENERAL = -2 , E_EPOC_CANCEL = -3 ,
  E_EPOC_NO_MEMORY = -4 , E_EPOC_NOT_SUPPORTED = -5 , E_EPOC_ARGUMENT = -6 , E_EPOC_TOTAL_LOSS_OF_PRECISION = -7 ,
  E_EPOC_BAD_HANDLE = -8 , E_EPOC_OVERFLOW = -9 , E_EPOC_UNDERFLOW = -10 , E_EPOC_ALREADY_EXISTS = -11 ,
  E_EPOC_PATH_NOT_FOUND = -12 , E_EPOC_DIED = -13 , E_EPOC_IN_USE = -14 , E_EPOC_SERVER_TERMINATED = -15 ,
  E_EPOC_SERVER_BUSY = -16 , E_EPOC_COMPLETION = -17 , E_EPOC_NOT_READY = -18 , E_EPOC_UNKNOWN = -19 ,
  E_EPOC_CORRUPT = -20 , E_EPOC_ACCESS_DENIED = -21 , E_EPOC_LOCKED = -22 , E_EPOC_WRITE = -23 ,
  E_EPOC_DISMOUNTED = -24 , E_EPOC_EoF = -25 , E_EPOC_DISK_FULL = -26 , E_EPOC_BAD_DRIVER = -27 ,
  E_EPOC_BAD_NAME = -28 , E_EPOC_COMMS_LINE_FAIL = -29 , E_EPOC_COMMS_FRAME = -30 , E_EPOC_COMMS_OVERRUN = -31 ,
  E_EPOC_COMMS_PARITY = -32 , E_EPOC_TIMEOUT = -33 , E_EPOC_COULD_NOT_CONNECT = -34 , E_EPOC_COULD_NOT_DISCONNECT = -35 ,
  E_EPOC_DISCONNECTED = -36 , E_EPOC_BAD_LIBRARY_ENTRY_POINT = -37 , E_EPOC_BAD_DESCRIPTOR = -38 , E_EPOC_ABORT = -39 ,
  E_EPOC_TOO_BIG = -40 , E_EPOC_DIVIDE_BY_ZERO = -41 , E_EPOC_BAD_POWER = -42 , E_EPOC_DIR_FULL = -43
}
 
enum  commands {
  CLOSE_HANDLE = 0x01 , OPEN_DIR = 0x10 , READ_DIR = 0x12 , GET_DRIVE_LIST = 0x13 ,
  DRIVE_INFO = 0x14 , SET_VOLUME_LABEL = 0x15 , OPEN_FILE = 0x16 , TEMP_FILE = 0x17 ,
  READ_FILE = 0x18 , WRITE_FILE = 0x19 , SEEK_FILE = 0x1a , DELETE = 0x1b ,
  REMOTE_ENTRY = 0x1c , FLUSH = 0x1d , SET_SIZE = 0x1e , RENAME = 0x1f ,
  MK_DIR_ALL = 0x20 , RM_DIR = 0x21 , SET_ATT = 0x22 , ATT = 0x23 ,
  SET_MODIFIED = 0x24 , MODIFIED = 0x25 , SET_SESSION_PATH = 0x26 , SESSION_PATH = 0x27 ,
  READ_WRITE_FILE = 0x28 , CREATE_FILE = 0x29 , REPLACE_FILE = 0x2a , PATH_TEST = 0x2b ,
  LOCK = 0x2d , UNLOCK = 0x2e , OPEN_DIR_UID = 0x2f , DRIVE_NAME = 0x30 ,
  SET_DRIVE_NAME = 0x31 , REPLACE = 0x32
}
 

Private Member Functions

 rfsv32 (TCPSocket *)
 Private constructor. More...
 
Enum< rfsv::errserr2psierr (int32_t)
 
Enum< rfsv::errsfopendir (const uint32_t, const char *, uint32_t &)
 
uint32_t attr2std (const uint32_t)
 
uint32_t std2attr (const uint32_t)
 
bool sendCommand (enum commands, bufferStore &)
 
Enum< rfsv::errsgetResponse (bufferStore &)
 

Friends

class rfsvfactory
 rfsvfactory may call our constructor. More...
 

Additional Inherited Members

- Public Types inherited from rfsv
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...
 
- Static Public Member Functions inherited from rfsv
static std::string convertSlash (const std::string &name)
 Utility method, converts '/' to '\'. More...
 
- Protected Member Functions inherited from rfsv
const char * getConnectName ()
 Retrieves the PLP protocol name. More...
 
- Protected Attributes inherited from rfsv
TCPSocketskt
 
Enum< errsstatus
 
int32_t serNum
 

Detailed Description

This is the implementation of the rfsv protocol for Psion series 5 (EPOC) variant.

You normally never create objects of this class directly. Thus the constructor is private. Use rfsvfactory for creating an instance of rfsv . For a complete documentation, see rfsv .

Definition at line 37 of file rfsv32.h.

Member Enumeration Documentation

◆ commands

enum rfsv32::commands
private
Enumerator
CLOSE_HANDLE 
OPEN_DIR 
READ_DIR 
GET_DRIVE_LIST 
DRIVE_INFO 
SET_VOLUME_LABEL 
OPEN_FILE 
TEMP_FILE 
READ_FILE 
WRITE_FILE 
SEEK_FILE 
DELETE 
REMOTE_ENTRY 
FLUSH 
SET_SIZE 
RENAME 
MK_DIR_ALL 
RM_DIR 
SET_ATT 
ATT 
SET_MODIFIED 
MODIFIED 
SET_SESSION_PATH 
SESSION_PATH 
READ_WRITE_FILE 
CREATE_FILE 
REPLACE_FILE 
PATH_TEST 
LOCK 
UNLOCK 
OPEN_DIR_UID 
DRIVE_NAME 
SET_DRIVE_NAME 
REPLACE 

Definition at line 152 of file rfsv32.h.

◆ epoc_errs

enum rfsv32::epoc_errs
private
Enumerator
E_EPOC_NONE 
E_EPOC_NOT_FOUND 
E_EPOC_GENERAL 
E_EPOC_CANCEL 
E_EPOC_NO_MEMORY 
E_EPOC_NOT_SUPPORTED 
E_EPOC_ARGUMENT 
E_EPOC_TOTAL_LOSS_OF_PRECISION 
E_EPOC_BAD_HANDLE 
E_EPOC_OVERFLOW 
E_EPOC_UNDERFLOW 
E_EPOC_ALREADY_EXISTS 
E_EPOC_PATH_NOT_FOUND 
E_EPOC_DIED 
E_EPOC_IN_USE 
E_EPOC_SERVER_TERMINATED 
E_EPOC_SERVER_BUSY 
E_EPOC_COMPLETION 
E_EPOC_NOT_READY 
E_EPOC_UNKNOWN 
E_EPOC_CORRUPT 
E_EPOC_ACCESS_DENIED 
E_EPOC_LOCKED 
E_EPOC_WRITE 
E_EPOC_DISMOUNTED 
E_EPOC_EoF 
E_EPOC_DISK_FULL 
E_EPOC_BAD_DRIVER 
E_EPOC_BAD_NAME 
E_EPOC_COMMS_LINE_FAIL 
E_EPOC_COMMS_FRAME 
E_EPOC_COMMS_OVERRUN 
E_EPOC_COMMS_PARITY 
E_EPOC_TIMEOUT 
E_EPOC_COULD_NOT_CONNECT 
E_EPOC_COULD_NOT_DISCONNECT 
E_EPOC_DISCONNECTED 
E_EPOC_BAD_LIBRARY_ENTRY_POINT 
E_EPOC_BAD_DESCRIPTOR 
E_EPOC_ABORT 
E_EPOC_TOO_BIG 
E_EPOC_DIVIDE_BY_ZERO 
E_EPOC_BAD_POWER 
E_EPOC_DIR_FULL 

Definition at line 105 of file rfsv32.h.

◆ file_attrib

enum rfsv32::file_attrib
private
Enumerator
EPOC_ATTR_RONLY 
EPOC_ATTR_HIDDEN 
EPOC_ATTR_SYSTEM 
EPOC_ATTR_DIRECTORY 
EPOC_ATTR_ARCHIVE 
EPOC_ATTR_VOLUME 
EPOC_ATTR_NORMAL 
EPOC_ATTR_TEMPORARY 
EPOC_ATTR_COMPRESSED 
EPOC_ATTR_MASK 
EPOC_ATTR_GETUID 

Definition at line 82 of file rfsv32.h.

◆ open_mode

enum rfsv32::open_mode
private
Enumerator
EPOC_OMODE_SHARE_EXCLUSIVE 
EPOC_OMODE_SHARE_READERS 
EPOC_OMODE_SHARE_ANY 
EPOC_OMODE_BINARY 
EPOC_OMODE_TEXT 
EPOC_OMODE_READ_WRITE 

Definition at line 96 of file rfsv32.h.

Constructor & Destructor Documentation

◆ rfsv32()

rfsv32::rfsv32 ( TCPSocket _skt)
private

Private constructor.

Shall be called by rfsvfactory only.

Definition at line 39 of file rfsv32.cc.

Member Function Documentation

◆ attr2std()

uint32_t rfsv32::attr2std ( const uint32_t  attr)
private

Definition at line 883 of file rfsv32.cc.

◆ closedir()

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

Close a directory, previously opened with opendir.

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

Implements rfsv.

Definition at line 146 of file rfsv32.cc.

◆ copyFromPsion() [1/2]

Enum< rfsv::errs > rfsv32::copyFromPsion ( const char * const  from,
const char * const  to,
void *  ,
cpCallback_t  func 
)
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 ).

Implements rfsv.

Definition at line 477 of file rfsv32.cc.

◆ copyFromPsion() [2/2]

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

Copies a file from the Psion to the local machine.

Implements rfsv.

Definition at line 507 of file rfsv32.cc.

◆ copyOnPsion()

Enum< rfsv::errs > rfsv32::copyOnPsion ( const char * const  from,
const char * const  to,
void *  ,
cpCallback_t  func 
)
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 ).

Implements rfsv.

Definition at line 564 of file rfsv32.cc.

◆ copyToPsion()

Enum< rfsv::errs > rfsv32::copyToPsion ( const char * const  from,
const char * const  to,
void *  ,
cpCallback_t  func 
)
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 ).

Implements rfsv.

Definition at line 532 of file rfsv32.cc.

◆ devinfo()

Enum< rfsv::errs > rfsv32::devinfo ( const char  drive,
PlpDrive dinfo 
)
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 ).

Implements rfsv.

Definition at line 362 of file rfsv32.cc.

◆ devlist()

Enum< rfsv::errs > rfsv32::devlist ( uint32_t &  devbits)
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 ).

Implements rfsv.

Definition at line 342 of file rfsv32.cc.

◆ dir()

Enum< rfsv::errs > rfsv32::dir ( const char * const  name,
PlpDir ret 
)
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 ).

Implements rfsv.

Definition at line 186 of file rfsv32.cc.

◆ dircount()

Enum< rfsv::errs > rfsv32::dircount ( const char * const  name,
uint32_t &  count 
)
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 ).

Implements rfsv.

Definition at line 308 of file rfsv32.cc.

◆ err2psierr()

Enum< rfsv::errs > rfsv32::err2psierr ( int32_t  istatus)
private

Definition at line 868 of file rfsv32.cc.

◆ fclose()

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

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

Parameters
handleA valid file handle.

Implements rfsv.

Definition at line 127 of file rfsv32.cc.

◆ fcreatefile()

Enum< rfsv::errs > rfsv32::fcreatefile ( const uint32_t  attr,
const char * const  name,
uint32_t &  handle 
)
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 ).

Implements rfsv.

Definition at line 79 of file rfsv32.cc.

◆ fgetattr()

Enum< rfsv::errs > rfsv32::fgetattr ( const char * const  name,
uint32_t &  attr 
)
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 ).

Implements rfsv.

Definition at line 247 of file rfsv32.cc.

◆ fgeteattr()

Enum< rfsv::errs > rfsv32::fgeteattr ( const char * const  name,
PlpDirent e 
)
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 ).

Implements rfsv.

Definition at line 263 of file rfsv32.cc.

◆ fgetmtime()

Enum< rfsv::errs > rfsv32::fgetmtime ( const char * const  name,
PsiTime mtime 
)
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 ).

Implements rfsv.

Definition at line 217 of file rfsv32.cc.

◆ fopen()

Enum< rfsv::errs > rfsv32::fopen ( const uint32_t  attr,
const char * const  name,
uint32_t &  handle 
)
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 ).

Implements rfsv.

Definition at line 47 of file rfsv32.cc.

◆ fopendir()

Enum< rfsv::errs > rfsv32::fopendir ( const uint32_t  attr,
const char *  name,
uint32_t &  handle 
)
private

Definition at line 111 of file rfsv32.cc.

◆ fread()

Enum< rfsv::errs > rfsv32::fread ( const uint32_t  handle,
unsigned char * const  buffer,
const uint32_t  len,
uint32_t &  count 
)
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 ).

Implements rfsv.

Definition at line 425 of file rfsv32.cc.

◆ freplacefile()

Enum< rfsv::errs > rfsv32::freplacefile ( const uint32_t  attr,
const char * const  name,
uint32_t &  handle 
)
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 ).

Implements rfsv.

Definition at line 95 of file rfsv32.cc.

◆ fseek()

Enum< rfsv::errs > rfsv32::fseek ( const uint32_t  handle,
const int32_t  offset,
const uint32_t  mode,
uint32_t &  resultpos 
)
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 ).

Implements rfsv.

Definition at line 644 of file rfsv32.cc.

◆ fsetattr()

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

Implements rfsv.

Definition at line 294 of file rfsv32.cc.

◆ fsetmtime()

Enum< rfsv::errs > rfsv32::fsetmtime ( const char * const  name,
PsiTime const  mtime 
)
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 ).

Implements rfsv.

Definition at line 233 of file rfsv32.cc.

◆ fsetsize()

Enum< rfsv::errs > rfsv32::fsetsize ( uint32_t  handle,
uint32_t  size 
)
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 ).

Implements rfsv.

Definition at line 628 of file rfsv32.cc.

◆ fwrite()

Enum< rfsv::errs > rfsv32::fwrite ( const uint32_t  handle,
const unsigned char * const  buffer,
const uint32_t  len,
uint32_t &  count 
)
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 ).

Implements rfsv.

Definition at line 451 of file rfsv32.cc.

◆ getProtocolVersion()

int rfsv32::getProtocolVersion ( )
inlinevirtual

Retrieves the protocol version.

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

Implements rfsv.

Definition at line 78 of file rfsv32.h.

◆ getResponse()

Enum< rfsv::errs > rfsv32::getResponse ( bufferStore data)
private

Definition at line 412 of file rfsv32.cc.

◆ mkdir()

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

Creates a directory on the Psion.

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

Implements rfsv.

Definition at line 754 of file rfsv32.cc.

◆ mktemp()

Enum< rfsv::errs > rfsv32::mktemp ( uint32_t &  handle,
std::string &  name 
)
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 ).

Implements rfsv.

Definition at line 65 of file rfsv32.cc.

◆ opendir()

Enum< rfsv::errs > rfsv32::opendir ( const uint32_t  attr,
const char * const  name,
rfsvDirhandle handle 
)
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 ).

Implements rfsv.

Definition at line 137 of file rfsv32.cc.

◆ opMode()

uint32_t rfsv32::opMode ( const uint32_t  mode)
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.

Implements rfsv.

Definition at line 204 of file rfsv32.cc.

◆ pathtest()

Enum< rfsv::errs > rfsv32::pathtest ( const char * const  name)
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 ).

Implements rfsv.

Definition at line 615 of file rfsv32.cc.

◆ readdir()

Enum< rfsv::errs > rfsv32::readdir ( rfsvDirhandle handle,
PlpDirent entry 
)
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 ).

Implements rfsv.

Definition at line 151 of file rfsv32.cc.

◆ remove()

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

Removes a file on the Psion.

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

Implements rfsv.

Definition at line 797 of file rfsv32.cc.

◆ rename()

Enum< rfsv::errs > rfsv32::rename ( const char * const  oldname,
const char * const  newname 
)
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 ).

Implements rfsv.

Definition at line 782 of file rfsv32.cc.

◆ rmdir()

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

Removes a directory on the Psion.

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

Implements rfsv.

Definition at line 768 of file rfsv32.cc.

◆ sendCommand()

bool rfsv32::sendCommand ( enum commands  cc,
bufferStore data 
)
private

Definition at line 385 of file rfsv32.cc.

◆ setVolumeName()

Enum< rfsv::errs > rfsv32::setVolumeName ( const char  drive,
const char * const  name 
)
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 ).

Implements rfsv.

Definition at line 809 of file rfsv32.cc.

◆ std2attr()

uint32_t rfsv32::std2attr ( const uint32_t  attr)
private

Definition at line 919 of file rfsv32.cc.

Friends And Related Function Documentation

◆ rfsvfactory

friend class rfsvfactory
friend

rfsvfactory may call our constructor.

Definition at line 42 of file rfsv32.h.


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