pianod2
multisource multiuser scriptable networked music player
Public Member Functions | Private Attributes | Friends | List of all members
PianodParser Class Reference

Command line parser based on Parsnip, but with some help support added for pianod. More...

#include <interpreter.h>

Inheritance diagram for PianodParser:
Inheritance graph
[legend]
Collaboration diagram for PianodParser:
Collaboration graph
[legend]

Public Member Functions

void addOptionParser (const std::string &name, Parsnip::OptionParser::Definitions defs)
 Construct and register an option parser. More...
 
- Public Member Functions inherited from Parsnip::Parser
 Parser ()=default
 
 Parser (const Definitions &defs)
 Construct a parser and initialize it with some statements. More...
 
virtual ~Parser ()=default
 
void addOptionParser (const std::string &name, const OptionParserRef &add)
 Register an options parser for use. More...
 
void addStatements (const Definitions &defs)
 Add statements to the parser. More...
 
Result evaluate (const StringType &command) const
 Evaluate a command. More...
 
bool operator== (const Parser &) const
 Check if a parser is identical to another parser. More...
 
bool operator!= (const Parser &other) const
 

Private Attributes

std::unordered_map< std::string, const Parsnip::OptionParser::Definitionsoption_definitions
 

Friends

class PianodDispatcher
 

Additional Inherited Members

- Public Types inherited from Parsnip::Parser
using CommandId = int
 
using StringType = std::string
 
using Definitions = std::vector< Definition >
 

Detailed Description

Command line parser based on Parsnip, but with some help support added for pianod.

Member Function Documentation

◆ addOptionParser()

void PianodParser::addOptionParser ( const std::string &  name,
Parsnip::OptionParser::Definitions  defs 
)

Construct and register an option parser.

Parser definition is saved for later use in providing help.

Parameters
nameThe parser name, as will be used in statement definitions.
defsThe parser's option format definitions.
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ PianodDispatcher

friend class PianodDispatcher
friend

Member Data Documentation

◆ option_definitions

std::unordered_map<std::string, const Parsnip::OptionParser::Definitions> PianodParser::option_definitions
private

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