QCA::QPipeDevice Class Reference
QCA user API

`#include <QtCrypto>`

Collaboration diagram for QCA::QPipeDevice:
[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=nullptr)
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

## Type

enum QCA::QPipeDevice::Type

The type of device.

Enumerator
Read | The pipe end can be read from.
Write | The pipe end can be written to.

## Constructor & Destructor Documentation

## QPipeDevice()

QCA::QPipeDevice::QPipeDevice | ( | QObject * | parent = nullptr | ) |

Standard constructor.

Parameters

  parent | the parent object to this object

References QPipeDevice().

Referenced by notify(), and QPipeDevice().

## Member Function Documentation

## type()

Type QCA::QPipeDevice::type | ( |  | ) | const

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

## isValid()

bool QCA::QPipeDevice::isValid | ( |  | ) | const

Test whether this object corresponds to a valid pipe.

## id()

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

## 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().

## take()

void QCA::QPipeDevice::take | ( | Q_PIPE_ID | id,
|  | Type | t )

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

Parameters

  id | the identification of the pipe end to take over.
  t | the type of pipe end (read or write).

## enable()

void QCA::QPipeDevice::enable | ( |  | ) |

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

## close()

void QCA::QPipeDevice::close | ( |  | ) |

Close the pipe end.

## release()

void QCA::QPipeDevice::release | ( |  | ) |

Release the pipe end, but do not close it.

## setInheritable()

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

  enabled | whether the pipe is inheritable (true) or not (false)

## bytesAvailable()

int QCA::QPipeDevice::bytesAvailable | ( |  | ) | const

Obtain the number of bytes available to be read.

## read()

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

Read from the pipe end.

Parameters

  data | where to put the data that has been read
  maxsize | the maximum number of bytes to be read.

Returns
  the actual number of bytes read, 0 on end-of-file, or -1 on error.

## write()

int QCA::QPipeDevice::write | ( | const char * | data,
|  | int | size )

Write to the pipe end.

Parameters

  data | the source of the data to be written
  size | the 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.

## writeResult()

int QCA::QPipeDevice::writeResult | ( | int * | written | ) | const

The result of a write operation.

Parameters

  written | if 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

## notify

void QCA::QPipeDevice::notify | ( |  | ) |

signal

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

References QPipeDevice().

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

- qpipe.h