Qmmp
Public Types | Public Member Functions | Protected Member Functions | List of all members
CommandLineHandler Class Referenceabstract

#include <commandlinehandler.h>

Public Types

enum  OptionFlag { HiddenFromHelp = 0x1, NoStart = 0x2 }
 

Public Member Functions

virtual ~CommandLineHandler ()
 
virtual void registerOprions ()=0
 
virtual QString shortName () const =0
 
virtual QString translation () const =0
 
virtual QString executeCommand (int id, const QStringList &args)=0
 
QStringList helpString () const
 
QString helpString (int id) const
 
int identify (const QString &name) const
 
CommandLineHandler::OptionFlags flags (int id) const
 

Protected Member Functions

void registerOption (int id, const QString &name, const QString &helpString, const QStringList &values=QStringList())
 
void registerOption (int id, const QStringList &names, const QString &helpString, const QStringList &values=QStringList())
 
void setOptionFlags (int id, OptionFlags flags)
 

Detailed Description

Abstract base class of the command line plugins.

Author
Vladimir Kuznetsov vovan.nosp@m.ec@g.nosp@m.mail..nosp@m.ru

Member Enumeration Documentation

◆ OptionFlag

enum OptionFlag

These flags describe attributes that change the behavior of command line option processing.

Enumerator
HiddenFromHelp 

Hide this option in the user-visible help output.

NoStart 

Do not start player instance (useful for extra help options).

Constructor & Destructor Documentation

◆ ~CommandLineHandler()

virtual ~CommandLineHandler ( )
inlinevirtual

Object destructor

Member Function Documentation

◆ executeCommand()

virtual QString executeCommand ( int  id,
const QStringList &  args 
)
pure virtual

Executes given command. Subclass should reimplement this function.

Parameters
idCommand identifier to execute
argsCommand arguments
Returns
Command output

◆ flags()

CommandLineHandler::OptionFlags flags ( int  id) const

Returtns flags for specified option identifier

Parameters
idCommand line option identifier.

◆ helpString() [1/2]

QStringList helpString ( ) const

Returns a list of help strings.

◆ helpString() [2/2]

QString helpString ( int  id) const

Returns help string for specified option.

Parameters
idCommand line option identifier.
Returns

◆ identify()

int identify ( const QString &  name) const

Returtns identifier for specified option name or -1 if option is not supported.

Parameters
nameCommand line option name.

◆ registerOprions()

virtual void registerOprions ( )
pure virtual

Registers command line options. Subclass should implement this function

◆ registerOption() [1/2]

void registerOption ( int  id,
const QString &  name,
const QString &  helpString,
const QStringList &  values = QStringList() 
)
protected

Registers command line option. This function should be called inside registerOprions() implementation.

Parameters
idOption identifier.
nameOption name.
helpStringOption description.
valuesValue name list (optional).

◆ registerOption() [2/2]

void registerOption ( int  id,
const QStringList &  names,
const QString &  helpString,
const QStringList &  values = QStringList() 
)
protected

Registers command line option. This function should be called inside registerOprions() implementation.

Parameters
idOption identifier.
namesOption names (i.e. short and long variants).
helpStringOption description.
valuesValue name list (optional).

◆ setOptionFlags()

void setOptionFlags ( int  id,
OptionFlags  flags 
)
protected

Changes command line option flags.

Parameters
idOption identifier.
flagsOption flags.

◆ shortName()

virtual QString shortName ( ) const
pure virtual

Returns command line plugin short name for internal usage. Subclass should reimplement this function.

◆ translation()

virtual QString translation ( ) const
pure virtual

Returns translation file path without locale code and extension. Subclass should reimplement this function.


The documentation for this class was generated from the following file: