SPH
Public Member Functions | Public Attributes | List of all members
ArgDesc Struct Reference

Descriptor of a command-line argument. More...

#include <ArgsParser.h>

Public Member Functions

bool matches (const std::string &name)
 Checks if the descriptor matches given argument. More...
 

Public Attributes

std::string shortName
 Short name, prefixed by single dash (e.g. -h) More...
 
std::string longName
 Long name, prefixed by double-dash (e.g. –help) More...
 
ArgEnum type
 Type of the parameter. More...
 
std::string desc
 Parameter description, printed in help. More...
 
Function< void()> callback = nullptr
 Generic callback executed when the parameter is parsed. More...
 

Detailed Description

Descriptor of a command-line argument.

Definition at line 39 of file ArgsParser.h.

Member Function Documentation

◆ matches()

bool ArgDesc::matches ( const std::string &  name)
inline

Checks if the descriptor matches given argument.

Definition at line 56 of file ArgsParser.h.

Member Data Documentation

◆ callback

Function<void()> ArgDesc::callback = nullptr

Generic callback executed when the parameter is parsed.

Definition at line 53 of file ArgsParser.h.

◆ desc

std::string ArgDesc::desc

Parameter description, printed in help.

Definition at line 50 of file ArgsParser.h.

◆ longName

std::string ArgDesc::longName

Long name, prefixed by double-dash (e.g. –help)

Definition at line 44 of file ArgsParser.h.

◆ shortName

std::string ArgDesc::shortName

Short name, prefixed by single dash (e.g. -h)

Definition at line 41 of file ArgsParser.h.

◆ type

ArgEnum ArgDesc::type

Type of the parameter.

Definition at line 47 of file ArgsParser.h.


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