![]() |
advgetopt 2.0.49
Parse complex command line arguments and configuration files in C++.
|
#include <validator_keywords.h>
Public Types | |
typedef std::shared_ptr< validator > | pointer_t |
typedef std::vector< pointer_t > | vector_t |
Public Member Functions | |
validator_keywords (string_list_t const &data) | |
virtual std::string | name () const override |
Return the name of this validator. | |
virtual bool | validate (std::string const &value) const override |
Check the value against a list of keywords. | |
Static Public Member Functions | |
static pointer_t | create (std::string const &name, string_list_t const &data) |
static pointer_t | create (std::string const &name_and_params) |
Set the validator for this option. | |
static void | register_validator (validator_factory const &factory) |
Private Attributes | |
string_set_t | f_keywords = string_set_t() |
Definition at line 46 of file validator_keywords.h.
|
inherited |
Definition at line 64 of file validator.h.
|
inherited |
Definition at line 65 of file validator.h.
advgetopt::validator_keywords::validator_keywords | ( | string_list_t const & | data | ) |
Definition at line 85 of file validator_keywords.cpp.
References f_keywords, and advgetopt::option_flags_merge().
|
staticinherited |
Definition at line 589 of file validator.cpp.
References advgetopt::validator::name(), and advgetopt::option_flags_merge().
Referenced by advgetopt::validator::create(), and advgetopt::option_info::set_validator().
|
staticinherited |
This function parses the specified name and optional parameters and create a corresponding validator for this option.
The name_and_params
string can be defined as:
The list of parameters is optional. There may be an empty, just one, or any number of parameters. How the parameters are parsed is left to the validator to decide.
If the input string is empty, the current validator, if one is installed, gets removed.
[in] | name_and_params | The validator name and parameters. |
Definition at line 626 of file validator.cpp.
References advgetopt::validator::create(), and advgetopt::option_flags_merge().
|
overridevirtual |
This function returns "keywords".
Implements advgetopt::validator.
Definition at line 108 of file validator_keywords.cpp.
|
staticinherited |
Definition at line 571 of file validator.cpp.
References advgetopt::option_flags_merge().
This function is used to match the value of an argument against a list of keywords. It returns true when it does match.
[in] | value | The value to be validated. |
Implements advgetopt::validator.
Definition at line 123 of file validator_keywords.cpp.
References f_keywords.
|
private |
Definition at line 58 of file validator_keywords.h.
Referenced by validator_keywords(), and validate().
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.