|
pianod2
multisource multiuser scriptable networked music player
|
#include <interpreter.h>


Public Types | |
| using | CommandIds = std::map< std::string, CommandId > |
| using | SchemaList = std::vector< std::string > |
| using | RequestPair = std::pair< CommandId, const Parsnip::Data * > |
Public Types inherited from Parsnip::SchemaSet | |
| using | CommandId = int |
| using | CommandSchemas = std::unordered_map< CommandId, SchemaBaseRef > |
| using | OptionSchemas = Schema::OptionSchemas |
| using | Dependencies = Schema::Dependencies |
Public Member Functions | |
| CommandId | getCommandId (const std::string &name) const |
| Retrieve a request's ID by name. More... | |
| void | addRequestNames (const CommandIds &mappings) |
| Register additional name/ID mappings for requests. More... | |
| void | validate (const std::string &command, const Parsnip::Data &request) |
| Verify a request complies with its schema. More... | |
| std::ostream & | dump (const std::string &command, std::ostream &target=std::clog) const |
| std::ostream & | dumpAll (std::ostream &target=std::clog) const |
| SchemaList | allRequestNames () const |
Public Member Functions inherited from Parsnip::SchemaSet | |
| SchemaSet (const class Parser &from) | |
| Construct schemas from a parser. More... | |
| void | validate (const CommandId, const Data &) const |
| Validate data against a command's schema. More... | |
| std::ostream & | dump (const std::string &intro, const CommandId command_id, std::ostream &target=std::clog) const |
| Dump the schema in human-readable format. More... | |
| void | addMember (const CommandId, const char *name, const SchemaBase &schema, bool mandatory=false, const Dependencies &dependencies=Schema::NoDependencies) |
| Modify a schema by adding a new dictionary member. More... | |
| void | addMember (const char *name, const SchemaBase &schema, bool mandatory=false, const Dependencies &dependencies=Schema::NoDependencies) |
| Add member to every schema in the schema set. More... | |
| void | replaceMember (const CommandId, const char *name, const SchemaBase &schema) |
| Modify a schema by replacing dictionary member. More... | |
| void | removeMember (const CommandId, const char *name) |
| Modify a schema by removing a dictionary member. More... | |
Private Attributes | |
| CommandIds | command_ids |
Additional Inherited Members | |
Public Attributes inherited from Parsnip::SchemaSet | |
| OptionSchemas | option_schemas |
| Schemas for each of the option parsers. More... | |
| using PianodSchema::CommandIds = std::map <std::string, CommandId> |
| using PianodSchema::RequestPair = std::pair <CommandId, const Parsnip::Data *> |
| using PianodSchema::SchemaList = std::vector<std::string> |
| void PianodSchema::addRequestNames | ( | const CommandIds & | mappings | ) |
Register additional name/ID mappings for requests.
| mappings | A map from name to ID. |

| PianodSchema::SchemaList PianodSchema::allRequestNames | ( | ) | const |
| std::ostream & PianodSchema::dump | ( | const std::string & | command, |
| std::ostream & | target = std::clog |
||
| ) | const |

| std::ostream & PianodSchema::dumpAll | ( | std::ostream & | target = std::clog | ) | const |
| PianodSchema::CommandId PianodSchema::getCommandId | ( | const std::string & | request_name | ) | const |
Retrieve a request's ID by name.
| request_name | The JSON request's name. |
| NoSchemaDefine | if request_name wasn't found. |

| void PianodSchema::validate | ( | const std::string & | request_name, |
| const Parsnip::Data & | parameters | ||
| ) |
Verify a request complies with its schema.
| request_name | The request name. |
| parameters | The request parameters to be validated. |

|
private |