Qt Cryptographic Architecture
Public Types | Signals | Public Member Functions | Friends | List of all members
QCA::QPipeDevice Class Reference

#include <QtCrypto>

Collaboration diagram for QCA::QPipeDevice:
Collaboration graph
[legend]

Public Types

enum  Type { Read, Write }
 

Signals

void notify ()
 

Public Member Functions

int bytesAvailable () const
 
void close ()
 
void enable ()
 
Q_PIPE_ID id () const
 
int idAsInt () const
 
bool isValid () const
 
 QPipeDevice (QObject *parent=0)
 
int read (char *data, int maxsize)
 
void release ()
 
bool setInheritable (bool enabled)
 
void take (Q_PIPE_ID id, Type t)
 
Type type () const
 
int write (const char *data, int size)
 
int writeResult (int *written) const
 

Friends

class Private
 

Detailed Description

Unbuffered direct pipe.

This class is not usually required except for very low level operations. You should use QPipe and QPipeEnd for most applications.

Member Enumeration Documentation

The type of device.

Enumerator
Read 

The pipe end can be read from.

Write 

The pipe end can be written to.

Constructor & Destructor Documentation

QCA::QPipeDevice::QPipeDevice ( QObject parent = 0)

Standard constructor.

Parameters
parentthe parent object to this object

Member Function Documentation

Type QCA::QPipeDevice::type ( ) const

The Type of the pipe device (that is, read or write)

bool QCA::QPipeDevice::isValid ( ) const

Test whether this object corresponds to a valid pipe.

Q_PIPE_ID QCA::QPipeDevice::id ( ) const

The low level identification for this pipe.

On Windows, this is a HANDLE. On Unix, this is a file descriptor (i.e. integer).

Code using this method should be carefully tested for portability.

See also
idAsInt
int QCA::QPipeDevice::idAsInt ( ) const

The low level identification for this pipe, returned as an integer.

Code using this method should be carefully tested for portability.

See also
id().
void QCA::QPipeDevice::take ( Q_PIPE_ID  id,
Type  t 
)

Take over an existing pipe id, closing the old pipe if any.

Parameters
idthe identification of the pipe end to take over.
tthe type of pipe end (read or write).
void QCA::QPipeDevice::enable ( )

Enable the pipe for reading or writing (depending on Type)

void QCA::QPipeDevice::close ( )

Close the pipe end.

void QCA::QPipeDevice::release ( )

Release the pipe end, but do not close it.

bool QCA::QPipeDevice::setInheritable ( bool  enabled)

Set the pipe end to be inheritable.

Note
On Windows, this operation changes the pipe end id value.
Parameters
enabledwhether the pipe is inheritable (true) or not (false)
int QCA::QPipeDevice::bytesAvailable ( ) const

Obtain the number of bytes available to be read.

int QCA::QPipeDevice::read ( char *  data,
int  maxsize 
)

Read from the pipe end.

Parameters
datawhere to put the data that has been read
maxsizethe maximum number of bytes to be read.
Returns
the actual number of bytes read, 0 on end-of-file, or -1 on error.
int QCA::QPipeDevice::write ( const char *  data,
int  size 
)

Write to the pipe end.

Parameters
datathe source of the data to be written
sizethe number of bytes in the data to be written
Note
the data source must remain valid
Returns
the number of bytes written, or -1 on error.
int QCA::QPipeDevice::writeResult ( int *  written) const

The result of a write operation.

Parameters
writtenif not null, this will be set to the number of bytes written in the last operation.
Returns
0 on success (all data written), or -1 on error
void QCA::QPipeDevice::notify ( )
signal

Emitted when the pipe end can be read from or written to (depending on its Type).


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