Base Module: Descriptions Class Reference
Author: Steinberg

Base Module VST 3.7 SDK for developing VST plug-in

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
Descriptions Class Reference

List of command-line option descriptions. More...

`#include <fcommandline.h>`

## Public Member Functions
Descriptions & | addOptions (const std::string &caption="", std::initializer_list< Description > &&options={})
| Sets the command-line tool caption and starts adding Descriptions.
bool | parse (int ac, char *av[], VariablesMap &result, FilesVector *files=nullptr) const
| Parse the command-line.
void | print (std::ostream &os) const
| Print a brief description for the command-line tool into the stream `os`.
Descriptions & | operator() (const std::string &name, const std::string &help)
| Add a new switch.
template<typename Type >
Descriptions & | operator() (const std::string &name, const Type &inType, std::string help)
| Add a new option of type `inType`.
template<>
Descriptions & | operator() (const std::string &name, const std::string &inType, std::string help)
| Add a new option with a string as parameter.

## Detailed Description

List of command-line option descriptions.

Use addOptions (const std::string&) to add Descriptions.

## Member Function Documentation

Descriptions & addOptions | ( | const std::string & | caption = `""`,
|  | std::initializer_list< Description > && | options = `{}`
| ) |  |

Sets the command-line tool caption and starts adding Descriptions.

    <b>Usage example:</b>

CommandLine::Descriptions desc;
desc.addOptions ("myTool") // Set caption to "myTool"
("help", "produce help message") // add switch -help
("opt1", string(), "option 1") // add string option -opt1
("opt2", string(), "option 2") // add string option -opt2
;

Note
  The operator() is used for every additional option.

Or with initializer list :

CommandLine::Descriptions desc;
desc.addOptions ("myTool", // Set caption to "myTool"
{{"help", "produce help message", Description::kBool}, // add switch -help
{"opt1", "option 1", Description::kString}, // add string option -opt1
{"opt2", "option 2", Description::kString}} // add string option -opt2
);

Parameters

  [in] | caption | the caption of the command-line tool.
  [in] | options | initializer list with options

Returns
  a reverense to *this.

bool parse | ( | int | ac,
|  | char * | av[],
|  | VariablesMap & | result,
|  | FilesVector * | files = `nullptr`
| ) |  | const

Parse the command-line.

Parameters

  [in] | ac | count of command-line parameters
  [in] | av | command-line as array of strings
  [out] | result | the parsing result
  [out] | files | optional list of elements on the command line that are not handled by options parsing

void print | ( | std::ostream & | os | ) | const

Print a brief description for the command-line tool into the stream `os`.

The description includes the help strings for all options.

Descriptions & operator() | ( | const std::string & | name,
|  | const std::string & | help
| ) |  |

Add a new switch.

Only

Returning a reference to *this, enables chaining of calls to operator()(const std::string&, const std::string&).

Parameters

  [in] | name | of the added option.
  [in] | help | a help description for this option.

Returns
  a reference to *this.

Descriptions& operator() | ( | const std::string & | name,
|  | const Type & | inType,
|  | std::string | help
| ) |  |

Add a new option of type `inType`.

Currently only std::string is supported.

Descriptions& operator() | ( | const std::string & | name,
|  | const std::string & | inType,
|  | std::string | help
| ) |  |

Add a new option with a string as parameter.

Empty

Copyright ©2024 Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.