libvariant
 All Classes Namespaces Files Functions Enumerations Groups
Public Member Functions | Friends | List of all members
libvariant::ArgParseOption Class Reference

ArgParseOption is a part of class ArgParse. More...

#include <Variant/ArgParse.h>

Public Member Functions

ArgParseOption & Title (const std::string &title)
 Set the title of this option. The title is used.
 
ArgParseOption & Action (ArgParseAction action)
 What action to perform when this option is encountered.
 
DEPRECATED ArgParseOption & Action (const std::string &action)
 
ArgParseOption & Type (ArgParseType type)
 Set the type parsing and validation.
 
DEPRECATED ArgParseOption & Type (Variant::Type_t type)
 
DEPRECATED ArgParseOption & Type (const std::string &type)
 
ArgParseOption & Const (Variant val)
 Set the const value for "store_const".
 
ArgParseOption & Default (Variant val)
 Set the default value used when the option is not set.
 
ArgParseOption & Env (const char *env)
 Set the environment variable name to check for a value for this option.
 
ArgParseOption & Minimum (Variant val)
 If the resulting value is a number, require to be at least this minimum.
 
ArgParseOption & Maximum (Variant val)
 If the resulting value is a number, require to be at most this maximum.
 
ArgParseOption & AddChoice (Variant val)
 Add choices.
 
ArgParseOption & SetChoices (const std::vector< Variant > &val)
 Set choices (old ones forgotten) from a vector.
 
const std::vector< Variant > & GetChoices ()
 Return the vector of choices set.
 
ArgParseOption & Required (bool req=true)
 Is this option required?
 
ArgParseOption & Help (const std::string &helptxt)
 Set the help text for this option.
 
ArgParseOption & Pattern (const std::string &pattern)
 If this option is a string, it must match the regex in pattern.
 
ArgParseOption & MaxLength (unsigned l)
 If this option is a string, it must be no longer than maxLength.
 
ArgParseOption & MinLength (unsigned l)
 If this option is a string, it must be no shorter than minLength.
 
ArgParseOption & MinArgs (unsigned l)
 If this option can be specified multiple times, it must be.
 
ArgParseOption & MaxArgs (unsigned l)
 If this option can be specified multiple times, it cannot be.
 
ArgParseOption & NumArgs (unsigned l)
 Specify that this argument must be present l times.
 
ArgParseOption & Group (const std::string &gname)
 Adds this option to group gname. If gname does not exist,.
 
ArgParseOption & Advanced (bool adv=true)
 Sets this argument to be an advanced option.
 

Friends

class ArgParse
 

Detailed Description

ArgParseOption is a part of class ArgParse.


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