Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

P::IODevice Class Reference
[Core library]

I/O device base class. More...

#include <piodevice.h>

Inheritance diagram for P::IODevice:

P::File P::NamedPipe P::Pipe P::ProcessIO P::Socket P::FileStream P::DatagramSocket P::StreamSocket P::StreamSocketServer P::FTPClient P::FTPData P::HTTPClient List of all members.

Public Types

enum  accessMode_t { Read, Write, ReadWrite }
 Device access mode. More...

enum  shareMode_t { AllowNone, AllowRead, AllowWrite, AllowReadWrite }
 Device sharing mode. More...

enum  seekMode_t { seekSet, seekCurrent, seekEnd }
 Operation modes for seek(). More...


Public Member Functions

 IODevice () throw ()
 Default constructor.

 IODevice (io_handle_t handle) throw (IOError)
 Native handle constructor.

 IODevice (const IODevice &dev) throw (IOError)
 Copy constructor.

virtual ~IODevice () throw ()
 Destructor.

virtual void close () throw (IOError)
 Close i/o device.

virtual size_t write (const char *buffer, size_t count) throw (IOError)
 Write to device.

virtual size_t read (char *buffer, size_t count) throw (IOError)
 Read from device.

virtual size_t peek (char *buffer, size_t count) throw (IOError)
 Peek incoming data on device.

virtual void commit () throw (IOError)
 Sync device with disk.

virtual off_t seek (off_t offset, seekMode_t mode) throw (IOError)
virtual bool isSeekable () const throw ()
 Test if device is seekable.

bool isValid () const throw ()
 Test if device is valid.

IODeviceoperator= (const IODevice &dev) throw (IOError)
io_handle_t handle () const throw ()
 Returns the native handle.


Static Public Member Functions

void copy (IODevice &src, IODevice &dst, bool commit=false)

Protected Member Functions

void setHandle (io_handle_t handle) throw ()

Detailed Description

I/O device base class.

Author:
Christian Prochnow <cproch@seculogix.de>

Definition at line 46 of file piodevice.h.


Member Enumeration Documentation

enum P::IODevice::accessMode_t
 

Device access mode.

Specifies how you want to access the device.

Enumeration values:
Read  Open file for reading
Write  Open file for writing
ReadWrite  Open file for reading and writing

Definition at line 52 of file piodevice.h.

enum P::IODevice::seekMode_t
 

Operation modes for seek().

Enumeration values:
seekSet  Absolute positioning
seekCurrent  Relative from current position
seekEnd  Relative from the end

Definition at line 71 of file piodevice.h.

enum P::IODevice::shareMode_t
 

Device sharing mode.

The device sharing mode is used to enable other processes to share the device while your process has it open.

Enumeration values:
AllowNone  Do'nt allow sharing
AllowRead  Allow open for reading
AllowWrite  Allow open for writing
AllowReadWrite  Allow open for read & write

Definition at line 63 of file piodevice.h.


Constructor & Destructor Documentation

P::IODevice::IODevice  )  throw () [inline]
 

Default constructor.

Definition at line 78 of file piodevice.h.

P::IODevice::IODevice io_handle_t  handle  )  throw (IOError)
 

Native handle constructor.

The native I/O handle will be duplicated.

P::IODevice::IODevice const IODevice dev  )  throw (IOError)
 

Copy constructor.

virtual P::IODevice::~IODevice  )  throw () [virtual]
 

Destructor.


Member Function Documentation

virtual void P::IODevice::close  )  throw (IOError) [virtual]
 

Close i/o device.

Reimplemented in P::FileStream, P::FTPClient, P::NamedPipe, P::ProcessIO, P::Socket, and P::StreamSocket.

virtual void P::IODevice::commit  )  throw (IOError) [virtual]
 

Sync device with disk.

Reimplemented in P::FileStream.

void P::IODevice::copy IODevice src,
IODevice dst,
bool  commit = false
[static]
 

io_handle_t P::IODevice::handle  )  const throw () [inline]
 

Returns the native handle.

Definition at line 132 of file piodevice.h.

References P::io_handle_t.

virtual bool P::IODevice::isSeekable  )  const throw () [virtual]
 

Test if device is seekable.

Reimplemented in P::NamedPipe, P::Pipe, and P::Socket.

bool P::IODevice::isValid  )  const throw () [inline]
 

Test if device is valid.

Definition at line 126 of file piodevice.h.

References P::INVALID_HANDLE_VALUE.

IODevice& P::IODevice::operator= const IODevice dev  )  throw (IOError)
 

virtual size_t P::IODevice::peek char *  buffer,
size_t  count
throw (IOError) [inline, virtual]
 

Peek incoming data on device.

Retrieves data from the receive queue without removing it.

Parameters:
buffer pointer to buffer receiving the data
count size of the buffer
Returns:
number of received bytes

Reimplemented in P::File, P::NamedPipe, P::Socket, and P::DatagramSocket.

Definition at line 110 of file piodevice.h.

References P_SOURCEINFO.

virtual size_t P::IODevice::read char *  buffer,
size_t  count
throw (IOError) [virtual]
 

Read from device.

Reimplemented in P::FTPData, P::ProcessIO, P::Socket, and P::DatagramSocket.

virtual off_t P::IODevice::seek off_t  offset,
seekMode_t  mode
throw (IOError) [virtual]
 

void P::IODevice::setHandle io_handle_t  handle  )  throw () [inline, protected]
 

Definition at line 138 of file piodevice.h.

virtual size_t P::IODevice::write const char *  buffer,
size_t  count
throw (IOError) [virtual]
 

Write to device.

Reimplemented in P::FTPData, P::ProcessIO, P::Socket, and P::DatagramSocket.


The documentation for this class was generated from the following file:
Generated on Fri Mar 12 21:08:34 2004 for P::Classes by doxygen 1.3.3