MPD: OptionParser Class Reference

MPD 0.20.15

Public Member Functions | Static Public Member Functions
OptionParser Class Reference

Command line option parser. More...

`#include <OptionParser.hxx>`

## Public Member Functions
| OptionParser (int _argc, char **_argv)
| Constructs OptionParser. More...
bool | HasEntries () const
| Checks if there are command line entries to process. More...
char * | GetOption ()
| Gets the last parsed option. More...
bool | CheckOption (const OptionDef &opt)
| Checks if current option is a specified option. More...
bool | CheckOption (const OptionDef &opt, const OptionDef &alt_opt)
| Checks if current option is a specified option or specified alternative option. More...
bool | ParseNext ()
| Parses current command line entry. More...

## Static Public Member Functions
static bool | IsOption (const char *s)
| Checks if specified string is a command line option. More...

## Detailed Description

Command line option parser.

Definition at line 30 of file OptionParser.hxx.

## Constructor & Destructor Documentation

## ◆ OptionParser()

OptionParser::OptionParser | ( | int | _argc,
|  | char ** | _argv
| ) |  |
| inline

Constructs OptionParser.

Definition at line 41 of file OptionParser.hxx.

## Member Function Documentation

## ◆ CheckOption() [1/2]

bool OptionParser::CheckOption | ( | const OptionDef & | opt | ) |

Checks if current option is a specified option.

## ◆ CheckOption() [2/2]

bool OptionParser::CheckOption | ( | const OptionDef & | opt,
|  | const OptionDef & | alt_opt
| ) |  |
| inline

Checks if current option is a specified option or specified alternative option.

Definition at line 67 of file OptionParser.hxx.

## ◆ GetOption()

char* OptionParser::GetOption | ( |  | ) |
| inline

Gets the last parsed option.

Definition at line 53 of file OptionParser.hxx.

## ◆ HasEntries()

bool OptionParser::HasEntries | ( |  | ) | const
| inline

Checks if there are command line entries to process.

Definition at line 48 of file OptionParser.hxx.

## ◆ IsOption()

static bool OptionParser::IsOption | ( | const char * | s | ) |
| inlinestatic

Checks if specified string is a command line option.

Definition at line 82 of file OptionParser.hxx.

## ◆ ParseNext()

bool OptionParser::ParseNext | ( |  | ) |

Parses current command line entry.

Returns true on success, false otherwise. Regardless of result, advances current position to the next command line entry.

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

- util/OptionParser.hxx