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