#include <QtCrypto>
Public Types | |
enum | SecurityMode { SecurityDisabled, SecurityEnabled } |
Signals | |
void | bytesWritten (int bytes) |
void | inputClosed () |
void | outputClosed () |
void | readyRead () |
Public Member Functions | |
int | bytesAvailable () const |
int | bytesToWrite () const |
void | closeOutput () |
Console * | console () const |
ConsoleReference (QObject *parent=0) | |
QByteArray | read (int bytes=-1) |
SecureArray | readSecure (int bytes=-1) |
SecurityMode | securityMode () const |
bool | start (Console *console, SecurityMode mode=SecurityDisabled) |
void | stop () |
void | write (const QByteArray &a) |
void | writeSecure (const SecureArray &a) |
Friends | |
class | Console |
class | ConsoleReferencePrivate |
The security setting to use for the Console being managed.
QCA::ConsoleReference::ConsoleReference | ( | QObject * | parent = 0 |
) |
Standard constructor.
parent | the parent object for this object |
int QCA::ConsoleReference::bytesAvailable | ( | ) | const |
The number of bytes available to read from the Console being managed.
int QCA::ConsoleReference::bytesToWrite | ( | ) | const |
The number of bytes remaining to be written to the Console being managed.
void QCA::ConsoleReference::bytesWritten | ( | int | bytes | ) | [signal] |
Emitted when bytes are written to the Console.
bytes | the number of bytes that were written |
void QCA::ConsoleReference::closeOutput | ( | ) |
Close the write channel.
You only need to call this if writing is enabled on the Console being managed.
Console* QCA::ConsoleReference::console | ( | ) | const |
void QCA::ConsoleReference::inputClosed | ( | ) | [signal] |
Emitted when the console input is closed.
void QCA::ConsoleReference::outputClosed | ( | ) | [signal] |
Emitted when the console output is closed.
QByteArray QCA::ConsoleReference::read | ( | int | bytes = -1 |
) |
Read data from the Console.
bytes | the number of bytes to read. The default is to read all available bytes |
SecureArray QCA::ConsoleReference::readSecure | ( | int | bytes = -1 |
) |
void QCA::ConsoleReference::readyRead | ( | ) | [signal] |
Emitted when there are bytes available to read from the Console being managed.
SecurityMode QCA::ConsoleReference::securityMode | ( | ) | const |
The security mode setting for the Console object managed by this object.
bool QCA::ConsoleReference::start | ( | Console * | console, | |
SecurityMode | mode = SecurityDisabled | |||
) |
Set the Console object to be managed, and start processing.
You typically want to use Console::ttyInstance() or Console::stdioInstance() to obtain the required Console reference.
console | reference to the Console to be managed | |
mode | the SecurityMode to use for this Console. |
void QCA::ConsoleReference::stop | ( | ) |
Stop processing, and release the Console.
void QCA::ConsoleReference::write | ( | const QByteArray & | a | ) |
Write data to the Console.
a | the array of data to write to the Console |
void QCA::ConsoleReference::writeSecure | ( | const SecureArray & | a | ) |