13 #ifndef mitkCommandLineParser_h
14 #define mitkCommandLineParser_h
123 std::map<std::string, us::Any>
parseArguments(
int argc,
char **argv,
bool *ok =
nullptr);
204 const std::string &shortarg,
206 const std::string &argLabel,
207 const std::string &argHelp = std::string(),
209 bool optional =
true,
210 bool ignoreRest =
false,
211 bool deprecated =
false,
228 const std::string &shortarg,
229 const std::string &argLabel,
230 const std::string &argHelp);
254 const std::string &expression,
255 const std::string &exactMatchFailedMessage);
#define MITKCOMMANDLINE_EXPORT
Command line argument parser for MITK applications, based on the CTK command line parser.
bool argumentParsed(const std::string &argument) const
Check if a given argument has been parsed successfully.
void addArgument(const std::string &longarg, const std::string &shortarg, Type type, const std::string &argLabel, const std::string &argHelp=std::string(), const us::Any &defaultValue=us::Any(), bool optional=true, bool ignoreRest=false, bool deprecated=false, mitkCommandLineParser::Channel channel=mitkCommandLineParser::Channel::None)
Add a command line argument.
std::string helpText() const
std::vector< std::map< std::string, us::Any > > getArgumentList()
void setDescription(std::string description)
~mitkCommandLineParser()
Destructor.
void setArgumentPrefix(const std::string &longPrefix, const std::string &shortPrefix)
Channel
I/O channel classification for arguments.
const StringContainerType & unparsedArguments() const
Get all unparsed arguments.
void setContributor(std::string contributor)
std::string errorString() const
Get a detailed error description if a call to parseArguments() failed.
bool setExactMatchRegularExpression(const std::string &argument, const std::string &expression, const std::string &exactMatchFailedMessage)
void setCategory(std::string category)
mitkCommandLineParser()
Construct a parser with default settings.
Type
Supported argument value types.
std::string::size_type fieldWidth() const
void changeParameterGroup(std::string name, std::string tooltip)
std::string ParameterGroupName
void setTitle(std::string title)
bool argumentAdded(const std::string &argument) const
Check if a given argument has been registered.
void addDeprecatedArgument(const std::string &longarg, const std::string &shortarg, const std::string &argLabel, const std::string &argHelp)
void beginGroup(const std::string &description)
std::vector< std::string > StringContainerType
Container type for string lists, used for argument values and unparsed arguments.
std::map< std::string, us::Any > parseArguments(int argc, char **argv, bool *ok=nullptr)
Convenient overload to parse arguments from argc/argv.
void setStrictModeEnabled(bool strictMode)
std::string ParameterGroupDescription
std::map< std::string, us::Any > parseArguments(const StringContainerType &arguments, bool *ok=nullptr)
Parse a given list of command line arguments.
An Any class represents a general type and is capable of storing any type, supporting type-safe extra...
std::vector< std::string > StringList
A list of strings, used throughout the DICOM module to hold file paths and similar data.