4#ifndef DOKIT_ABSTRACTCOMMAND_H
5#define DOKIT_ABSTRACTCOMMAND_H
9#include <QBluetoothDeviceInfo>
10#include <QCommandLineParser>
11#include <QLoggingCategory>
36 static quint32 parseNumber(
const QString &value,
const QString &unit,
const quint32 sensibleMinimum = 0);
The AbstractCommand class provides a consistent base for the classes that implement CLI commands.
QString deviceToScanFor
Device (if any) that were passed to processOptions().
AbstractCommand(QObject *const parent=nullptr)
Constructs a new command with parent.
virtual void deviceDiscovered(const QBluetoothDeviceInfo &info)=0
Handles PokitDiscoveryAgent::pokitDeviceDiscovered signal.
PokitDiscoveryAgent * discoveryAgent
Agent for Pokit device discovery.
OutputFormat format
Selected output format.
OutputFormat
Supported output formats.
@ Text
Plain unstructured text.
@ Csv
RFC 4180 compliant CSV text.
@ Json
RFC 8259 compliant JSON text.
static Q_LOGGING_CATEGORY(lc, "dokit.cli.command", QtInfoMsg)
Logging category for UI commands.
virtual bool start()=0
Begins the functionality of this command, and returns true if begun successfully, false otherwise.
virtual void deviceDiscoveryFinished()=0
Handles PokitDiscoveryAgent::deviceDiscoveryFinished signal.
The PokitDiscoveryAgent class discovers nearby Pokit devices.
Global QtPokit library macros.
#define QTPOKIT_FORWARD_DECLARE_CLASS(name)
Macro for forward declaring classes in the QtPokit library's top-most namespace (if one is defined).
#define QTPOKIT_BEFRIEND_TEST(Class)
Macro for befriending a related unit test class, but only when QT_TESTLIB_LIB is defined.