cFileHandle Class Reference

#include <filehandle.h>

Inheritance diagram for cFileHandle:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void open (UpnpOpenFileMode mode)=0
virtual int read (char *buf, size_t buflen)=0
virtual int write (char *buf, size_t buflen)=0
virtual int seek (off_t offset, int whence)=0
virtual void close ()=0


Detailed Description

Interface for File Handles

This class is a pure virtual class to act as an interface for file handles used by the webserver.


Member Function Documentation

virtual void cFileHandle::close (  )  [pure virtual]

Closes the open file

This will close open file handles and frees the memory obtained by it.

Implemented in cLiveReceiver, and cRecordingPlayer.

virtual void cFileHandle::open ( UpnpOpenFileMode  mode  )  [pure virtual]

Opens the file

Opens the file at the given mode. These can be:

  • UPNP_READ, to read from the file
  • UPNP_WRITE, to write to the file

Parameters:
mode The file mode, i.e. one of the following
  • UPNP_READ
  • UPNP_WRITE
Parameters:
mode The file mode, i.e. one of the following
  • UPNP_READ
  • UPNP_WRITE

Implemented in cLiveReceiver, and cRecordingPlayer.

virtual int cFileHandle::read ( char *  buf,
size_t  buflen 
) [pure virtual]

Reads from the file

Reads from the file a certain amount of bytes and stores them in a buffer

Returns:
returns
  • <0, in case of an error
  • 0, when reading was successful
Parameters:
buf The char buffer
buflen The size of the buffer
Parameters:
buf The char buffer
buflen The size of the buffer

Implemented in cLiveReceiver, and cRecordingPlayer.

virtual int cFileHandle::seek ( off_t  offset,
int  whence 
) [pure virtual]

Seeks in the file

Seeks in the file where the offset is the relativ position depending on the second parameter. This means, in case of

  • SEEK_SET, the offset is relative to the beginning of the file
  • SEEK_CUR, it is relative to the current position or
  • SEEK_END, relative to the end of the file.

Returns:
returns
  • <0, in case of an error
  • 0, when reading was successful
Parameters:
offset The byte offset in the file
whence one of the following
  • SEEK_SET,
  • SEEK_CUR,
  • SEEK_END
Parameters:
offset The byte offset in the file
whence one of the following
  • SEEK_SET,
  • SEEK_CUR,
  • SEEK_END

Implemented in cLiveReceiver, and cRecordingPlayer.

virtual int cFileHandle::write ( char *  buf,
size_t  buflen 
) [pure virtual]

Writes to the file

Writes to the file a certain amount of bytes which are stored in a buffer

Returns:
returns
  • <0, in case of an error
  • 0, when reading was successful
Parameters:
buf The char buffer
buflen The size of the buffer
Parameters:
buf The char buffer
buflen The size of the buffer

Implemented in cLiveReceiver, and cRecordingPlayer.


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

Generated on Sun Nov 8 15:44:09 2009 for UPnP/DLNA plugin for VDR by  doxygen 1.5.8