Qt Cryptographic Architecture
|
#include <QtCrypto>
Public Types | |
enum | Error { ErrorEOF , ErrorBroken } |
Signals | |
void | bytesWritten (int bytes) |
void | closed () |
void | error (QCA::QPipeEnd::Error e) |
void | readyRead () |
Public Member Functions | |
int | bytesAvailable () const |
int | bytesToWrite () const |
void | close () |
void | enable () |
void | finalize () |
void | finalizeAndRelease () |
Q_PIPE_ID | id () const |
int | idAsInt () const |
bool | isValid () const |
QPipeEnd (QObject *parent=nullptr) | |
QByteArray | read (int bytes=-1) |
SecureArray | readSecure (int bytes=-1) |
void | release () |
void | reset () |
bool | setInheritable (bool enabled) |
void | setSecurityEnabled (bool secure) |
void | take (Q_PIPE_ID id, QPipeDevice::Type t) |
QByteArray | takeBytesToWrite () |
SecureArray | takeBytesToWriteSecure () |
QPipeDevice::Type | type () const |
void | write (const QByteArray &a) |
void | writeSecure (const SecureArray &a) |
Friends | |
class | Private |
A buffered higher-level pipe end.
This is either the read end or write end of a QPipe.
enum QCA::QPipeEnd::Error |
QCA::QPipeEnd::QPipeEnd | ( | QObject * | parent = nullptr | ) |
Standard constructor.
parent | the parent object for this object |
void QCA::QPipeEnd::reset | ( | ) |
Reset the pipe end to an inactive state.
QPipeDevice::Type QCA::QPipeEnd::type | ( | ) | const |
The type of pipe end (either read or write)
bool QCA::QPipeEnd::isValid | ( | ) | const |
Determine whether the pipe end is valid.
Q_PIPE_ID QCA::QPipeEnd::id | ( | ) | const |
Pipe identification.
int QCA::QPipeEnd::idAsInt | ( | ) | const |
Pipe identification.
void QCA::QPipeEnd::take | ( | Q_PIPE_ID | id, |
QPipeDevice::Type | t | ||
) |
Take over an existing pipe handle.
id | the pipe handle |
t | the type of the pipe (read or write) |
void QCA::QPipeEnd::setSecurityEnabled | ( | bool | secure | ) |
Sets whether the pipe uses secure memory for read/write.
Enabling this may reduce performance, and it should only be used if sensitive data is being transmitted (such as a passphrase).
secure | whether the pipe uses secure memory (true) or not (false). |
void QCA::QPipeEnd::enable | ( | ) |
Enable the endpoint for the pipe.
When an endpoint is created, it is not able to be used until it is enabled.
void QCA::QPipeEnd::close | ( | ) |
Close the end of the pipe.
void QCA::QPipeEnd::release | ( | ) |
Let go of the active pipe handle, but don't close it.
Use this before destructing QPipeEnd, if you don't want the pipe to automatically close.
bool QCA::QPipeEnd::setInheritable | ( | bool | enabled | ) |
Sets whether the pipe should be inheritable to child processes.
Returns true if inheritability was successfully changed, otherwise false.
enabled | whether the pipe is inheritable (true) or not (false). |
void QCA::QPipeEnd::finalize | ( | ) |
Clear the contents of the pipe, and invalidate the pipe.
void QCA::QPipeEnd::finalizeAndRelease | ( | ) |
Clear the contents of the pipe, and release the pipe.
int QCA::QPipeEnd::bytesAvailable | ( | ) | const |
Determine how many bytes are available to be read.
This only makes sense at the read end of the pipe
int QCA::QPipeEnd::bytesToWrite | ( | ) | const |
Returns the number of bytes pending to write.
This only makes sense at the write end of the pipe
QByteArray QCA::QPipeEnd::read | ( | int | bytes = -1 | ) |
Read bytes from the pipe.
You can only call this on the read end of the pipe
If the pipe is using secure memory, you should use readSecure()
bytes | the number of bytes to read (-1 for all content). |
void QCA::QPipeEnd::write | ( | const QByteArray & | a | ) |
Write bytes to the pipe.
You can only call this on the write end of the pipe.
If the pipe is using secure memory, you should use writeSecure().
a | the array to write to the pipe |
SecureArray QCA::QPipeEnd::readSecure | ( | int | bytes = -1 | ) |
Read bytes from the pipe.
You can only call this on the read end of the pipe
If the pipe is using insecure memory, you should use read()
bytes | the number of bytes to read (-1 for all content). |
void QCA::QPipeEnd::writeSecure | ( | const SecureArray & | a | ) |
Write bytes to the pipe.
You can only call this on the write end of the pipe.
If the pipe is using insecure memory, you should use write().
a | the array to write to the pipe |
QByteArray QCA::QPipeEnd::takeBytesToWrite | ( | ) |
Returns any unsent bytes queued for writing.
If the pipe is using secure memory, you should use takeBytesToWriteSecure().
SecureArray QCA::QPipeEnd::takeBytesToWriteSecure | ( | ) |
Returns any unsent bytes queued for writing.
If the pipe is using insecure memory, you should use takeBytesToWrite().
|
signal |
Emitted when there are bytes available to be read from the read end of the pipe.
|
signal |
Emitted when bytes have been written to the write end of the pipe.
bytes | the number of bytes written |
|
signal |
|
signal |
Emitted when the pipe encounters an error trying to read or write, or if the other end of the pipe has been closed.
e | the reason for error |