TTKMusicPlayer
4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
|
The class of the command line parser. More...
#include <ttkcommandline.h>
Public Member Functions | |
TTKCommandLineParser ()=default | |
void | setDescription (const QString &description) noexcept |
bool | addOption (const TTKCommandLineOption &option) |
bool | addOptions (const QList< TTKCommandLineOption > &options) |
void | process () |
void | process (const QStringList &arguments) |
bool | isSet (const TTKCommandLineOption &option) const |
QString | value (const TTKCommandLineOption &option) const |
bool | isEmpty () const noexcept |
void | showHelp () const |
Private Attributes | |
QString | m_description |
QHash< QString, QString > | m_commands |
QList< TTKCommandLineOption > | m_options |
The class of the command line parser.
Definition at line 88 of file ttkcommandline.h.
|
default |
Object constructor.
bool TTKCommandLineParser::addOption | ( | const TTKCommandLineOption & | option | ) |
Add command line option.
Definition at line 10 of file ttkcommandline.cpp.
References TTKCommandLineOption::first(), m_options, qAsConst, and TTK_ERROR_STREAM.
Referenced by addOptions(), MusicConsoleModule::initialize(), and MusicProcessServer::run().
bool TTKCommandLineParser::addOptions | ( | const QList< TTKCommandLineOption > & | options | ) |
Add command line options.
Definition at line 31 of file ttkcommandline.cpp.
References addOption(), and qAsConst.
|
inlinenoexcept |
Current input command is empty.
Definition at line 132 of file ttkcommandline.h.
Referenced by MusicConsoleModule::initialize().
bool TTKCommandLineParser::isSet | ( | const TTKCommandLineOption & | option | ) | const |
Check current option is set.
Definition at line 64 of file ttkcommandline.cpp.
References TTKCommandLineOption::first(), m_commands, and TTKCommandLineOption::second().
Referenced by MusicConsoleModule::initialize(), and MusicProcessServer::run().
void TTKCommandLineParser::process | ( | ) |
Process command line by input.
Definition at line 41 of file ttkcommandline.cpp.
Referenced by MusicConsoleModule::initialize(), and MusicProcessServer::run().
void TTKCommandLineParser::process | ( | const QStringList & | arguments | ) |
Process command line by input.
Definition at line 46 of file ttkcommandline.cpp.
References m_commands, and qAsConst.
|
noexcept |
Set application description.
Definition at line 5 of file ttkcommandline.cpp.
References description.
Referenced by MusicConsoleModule::initialize().
void TTKCommandLineParser::showHelp | ( | ) | const |
Show help text.
Definition at line 77 of file ttkcommandline.cpp.
References m_description, m_options, qAsConst, TTK_LINEFEED, and TTK_LOG_STREAM.
Referenced by MusicConsoleModule::initialize(), and MusicProcessServer::run().
QString TTKCommandLineParser::value | ( | const TTKCommandLineOption & | option | ) | const |
Get command line option value.
Definition at line 70 of file ttkcommandline.cpp.
References TTKCommandLineOption::first(), m_commands, and TTKCommandLineOption::second().
Referenced by MusicConsoleModule::initialize(), and MusicProcessServer::run().
|
private |
Definition at line 141 of file ttkcommandline.h.
|
private |
Definition at line 140 of file ttkcommandline.h.
Referenced by showHelp().
|
private |
Definition at line 142 of file ttkcommandline.h.
Referenced by addOption(), and showHelp().