Qt Cryptographic Architecture
|
Go to the documentation of this file.
43 #include <QVariantList>
44 #include <QStringList>
46 #include <QMetaObject>
101 QCA_EXPORT QByteArray methodReturnType(
const QMetaObject *obj,
const QByteArray &method,
const QList<QByteArray> argTypes);
144 QCA_EXPORT
bool invokeMethodWithVariants(
QObject *obj,
const QByteArray &method,
const QVariantList &args, QVariant *ret, Qt::ConnectionType type = Qt::AutoConnection);
322 QVariant
call(
QObject *obj,
const QByteArray &method,
const QVariantList &args = QVariantList(),
bool *ok =
nullptr);
344 friend class Private;
440 friend class Private;
496 friend class Private;
500 class ConsolePrivate;
501 class ConsoleReferencePrivate;
669 friend class ConsolePrivate;
749 QByteArray
read(
int bytes = -1);
829 friend class ConsoleReferencePrivate;
830 ConsoleReferencePrivate *d;
927 friend class Private;
1035 friend class Global;
1044 QStringList m_loggerNames;
A simple logging system.
Definition: qca_support.h:955
QString dirName() const
The name of the directory that is being monitored.
SecurityMode securityMode() const
The security mode setting for the Console object managed by this object.
ChannelMode
The type of I/O to use with the console object.
Definition: qca_support.h:568
TerminalMode
The nature of the console operation.
Definition: qca_support.h:577
void conditionMet()
Call to continue execution in the paused thread.
Type
The type of console object.
Definition: qca_support.h:560
Severity
The severity of the message.
Definition: qca_support.h:965
void bytesWritten(int bytes)
Emitted when bytes are written to the Console.
void changed()
The changed signal is emitted when the directory is changed (e.g.
virtual void atEnd()=0
Reimplement this to perform your deinitialization.
QVariant call(QObject *obj, const QByteArray &method, const QVariantList &args=QVariantList(), bool *ok=nullptr)
Calls a slot of an object in the thread.
DirWatch(const QString &dir=QString(), QObject *parent=nullptr)
Standard constructor.
Manager for a Console.
Definition: qca_support.h:685
void release()
Release the Console.
QCA - the Qt Cryptographic Architecture.
Definition: qca_basic.h:41
SecureArray result() const
Obtain the result of the user input.
Severity level() const
Get the current logging level.
Definition: qca_support.h:982
void unregisterLogDevice(const QString &loggerName)
Remove an AbstractLogDevice subclass from the existing list of loggers.
void setDirName(const QString &dir)
Change the directory being monitored.
void readyRead()
Emitted when there are bytes available to read from the Console being managed.
Preprocessor magic to allow export of library symbols.
void logBinaryMessage(const QByteArray &blob, Severity=Information)
Log a binary blob to all available log devices.
void waitForFinished()
Block waiting for user input.
static bool isStdinRedirected()
Test whether standard input is redirected.
bool waitForCondition(int msecs=-1)
Call to pause execution in this thread.
void getHidden(const QString &promptStr)
Allow the user to enter data without it being echo'd to the terminal.
void write(const QByteArray &a)
Write data to the Console.
void start()
Starts the thread, begins the event loop the thread, and then calls atStart() in the thread.
void getChar()
Obtain one character from the user.
virtual void logTextMessage(const QString &message, Logger::Severity severity)
Log a message.
void finished()
Emitted when the user input activity has been completed.
Console prompt handler.
Definition: qca_support.h:856
void outputClosed()
Emitted when the console output is closed.
@ Read
Read only (equivalent to stdin)
Definition: qca_support.h:569
QStringList currentLogDevices() const
Get a list of the names of all registered log devices.
@ Tty
physical console
Definition: qca_support.h:561
QByteArray read(int bytes=-1)
Read data from the Console.
Support class to monitor a directory for activity.
Definition: qca_support.h:402
QCA_EXPORT Logger * logger()
Return a reference to the QCA Logger, which is used for diagnostics and error recording.
int bytesAvailable() const
The number of bytes available to read from the Console being managed.
ChannelMode channelMode() const
The ChannelMode of this Console object.
Secure array of bytes.
Definition: qca_tools.h:317
void setFileName(const QString &file)
Change the file being monitored.
Convenience class to run a thread and interact with it synchronously.
Definition: qca_support.h:273
void run() override
Starts the event loop and calls atStart and atStop as necessary.
virtual void logBinaryMessage(const QByteArray &blob, Logger::Severity severity)
Log a binary blob.
int bytesToWrite() const
The number of bytes remaining to be written to the Console being managed.
void closeOutput()
Close the write channel.
static Console * stdioInstance()
The current stdio-type console object.
void inputClosed()
Emitted when the console input is closed.
QString fileName() const
The name of the file that is being monitored.
bool start(Console *console, SecurityMode mode=SecurityDisabled)
Set the Console object to be managed, and start processing.
Enable synchronization between two threads.
Definition: qca_support.h:354
~SyncThread() override
Calls stop() and then destructs.
Console * console() const
The Console object managed by this object.
AbstractLogDevice(const QString &name, QObject *parent=nullptr)
Create a new message logger.
TerminalMode terminalMode() const
The TerminalMode of this Console object.
static bool isStdoutRedirected()
Test whether standard output is redirected.
void writeSecure(const SecureArray &a)
Write secure data to the Console.
void changed()
The changed signal is emitted when the file is changed (e.g.
An abstract log device.
Definition: qca_support.h:1057
void stop()
Stops the event loop of the thread, calls atStop() in the thread, and instructs the thread to finish.
SecureArray readSecure(int bytes=-1)
Read secure data from the Console.
@ Default
use default terminal settings
Definition: qca_support.h:578
Support class to monitor a file for activity.
Definition: qca_support.h:460
ConsolePrompt(QObject *parent=nullptr)
Standard constructor.
void stop()
Stop processing, and release the Console.
static Console * ttyInstance()
The current terminal-type console object.
void logTextMessage(const QString &message, Severity=Information)
Log a message to all available log devices.
void registerLogDevice(AbstractLogDevice *logger)
Add an AbstractLogDevice subclass to the existing list of loggers.
QString name() const
The name of this log device.
FileWatch(const QString &file=QString(), QObject *parent=nullptr)
Standard constructor.
SyncThread(QObject *parent=nullptr)
Standard constructor.
QByteArray bytesLeftToWrite()
Obtain remaining data from the Console, awaiting a write operation.
Console(Type type, ChannelMode cmode, TerminalMode tmode, QObject *parent=nullptr)
Standard constructor.
void setLevel(Severity level)
Set the current logging level.
QCA Console system
Definition: qca_support.h:553
ConsoleReference(QObject *parent=nullptr)
Standard constructor.
QChar resultChar() const
Obtain the result of the user input.
SecurityMode
The security setting to use for the Console being managed.
Definition: qca_support.h:692
Type type() const
The Type of this Console object.
QByteArray bytesLeftToRead()
Obtain remaining data from the Console, awaiting a read operation.
Synchronizer(QObject *parent)
Standard constructor.
virtual void atStart()=0
Reimplement this to perform your initialization.