YGP::RemoteFile Struct Reference

Class representing a file on a remote server with simple management-functions. More...

Inherits YGP::File.

List of all members.

Public Member Functions

 RemoteFile (Socket &socket)
 RemoteFile (const RemoteFile &o)
virtual ~RemoteFile ()
RemoteFileoperator= (const RemoteFile &o)
virtual Fileclone () const
virtual bool isEOF (void *file) const throw (YGP::FileError)
virtual void * open (const char *mode) const throw (YGP::FileError)
virtual void close (void *file) const throw (YGP::FileError)
virtual int read (void *file, char *buffer, unsigned int length) const throw (YGP::FileError)
virtual int write (void *file, const char *buffer, unsigned int length) const throw (YGP::FileError)


Detailed Description

Class representing a file on a remote server with simple management-functions.

This class offers the same functionality as its parent although the file is (or can be) actually stored on a remote computer.

This class is not really (very) useful by itself but designed to be used by a RemoteDirSearch-object.


Constructor & Destructor Documentation

YGP::RemoteFile::RemoteFile ( Socket socket  )  [inline]

Default constructor; creates an empty object (holding no file) with the socket for the communication.

YGP::RemoteFile::RemoteFile ( const RemoteFile o  )  [inline]

Copy constructor; with the socket for the communication.

YGP::RemoteFile::~RemoteFile (  )  [virtual]

Destructor.


Member Function Documentation

File * YGP::RemoteFile::clone (  )  const [virtual]

Duplicates (clones) the object and returns a pointer to the newly created object.

Returns:
File* Pointer to newly created clone

Reimplemented from YGP::File.

void YGP::RemoteFile::close ( void *  file  )  const throw (YGP::FileError) [virtual]

Closes a (previously opened) file.

Parameters:
file Handle of opened file
Exceptions:
YGP::FileError In case of an error a textual description

Reimplemented from YGP::File.

bool YGP::RemoteFile::isEOF ( void *  file  )  const throw (YGP::FileError) [virtual]

Checks if further data is available for reading.

Parameters:
file Handle of openeded file

Reimplemented from YGP::File.

void * YGP::RemoteFile::open ( const char *  mode  )  const throw (YGP::FileError) [virtual]

Opends the file in the specified mode.

The mode parameter can have the same values as the ANSI-C fopen-function.

Parameters:
mode Mode for open the file (analogue to libc's fopen)
Returns:
void* Pointer to a handle for the opened file.
Exceptions:
YGP::FileError In case of an error a textual description

Reimplemented from YGP::File.

RemoteFile& YGP::RemoteFile::operator= ( const RemoteFile o  )  [inline]

Assignment operator; with the socket for the communication.

int YGP::RemoteFile::read ( void *  file,
char *  buffer,
unsigned int  length 
) const throw (YGP::FileError) [virtual]

Reads the (next) specified number of characters from the (previously opened) file (or less, if the end of the file has been reached) into buffer.

and returns the number of actually read bytes. If an error occurres, an exception is thrown

Parameters:
file Handle of openeded file
buffer Buffer for data
length Maximal length of buffer
Returns:
int Number of read bytes
Exceptions:
YGP::FileError In case of an error a textual description

Reimplemented from YGP::File.

int YGP::RemoteFile::write ( void *  file,
const char *  buffer,
unsigned int  length 
) const throw (YGP::FileError) [virtual]

Writes the specified number of characters to the (previously opened) file and returns the number of actually written bytes.

If an error occurres, an exception is thrown.

Parameters:
file Handle of openeded file
buffer Buffer of data
length Length of buffer (= bytes to write)
Returns:
int Number of written bytes
Exceptions:
YGP::FileError In case of an error

Reimplemented from YGP::File.


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

YGP Version 0.9.31 - Generated on Wed Nov 18 11:25:28 2009 by doxygen 1.5.8