HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pxr_CLI::CLI::Transformer Class Reference

Translate named items to other or a value set. More...

#include <CLI11.h>

+ Inheritance diagram for pxr_CLI::CLI::Transformer:

Public Types

using filter_fn_t = std::function< std::string(std::string)>
 

Public Member Functions

template<typename... Args>
 Transformer (std::initializer_list< std::pair< std::string, std::string >> values, Args &&...args)
 This allows in-place construction. More...
 
template<typename T >
 Transformer (T &&mapping)
 direct map of std::string to std::string More...
 
template<typename T , typename F >
 Transformer (T mapping, F filter_function)
 
template<typename T , typename... Args>
 Transformer (T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other)
 You can pass in as many filter functions as you like, they nest. More...
 
- Public Member Functions inherited from pxr_CLI::CLI::Validator
 Validator ()=default
 
 Validator (std::string validator_desc)
 Construct a Validator with just the description string. More...
 
 func_ (std::move(op))
 
 name_ (std::move(validator_name))
 
Validatoroperation (std::function< std::string(std::string &)> op)
 Set the Validator operation function. More...
 
std::string operator() (std::string &str) const
 
std::string operator() (const std::string &str) const
 
Validatordescription (std::string validator_desc)
 Specify the type string. More...
 
CLI11_NODISCARD Validator description (std::string validator_desc) const
 Specify the type string. More...
 
CLI11_NODISCARD std::string get_description () const
 Generate type description information for the Validator. More...
 
Validatorname (std::string validator_name)
 Specify the type string. More...
 
CLI11_NODISCARD Validator name (std::string validator_name) const
 Specify the type string. More...
 
CLI11_NODISCARD const std::stringget_name () const
 Get the name of the Validator. More...
 
Validatoractive (bool active_val=true)
 Specify whether the Validator is active or not. More...
 
CLI11_NODISCARD Validator active (bool active_val=true) const
 Specify whether the Validator is active or not. More...
 
Validatornon_modifying (bool no_modify=true)
 Specify whether the Validator can be modifying or not. More...
 
Validatorapplication_index (int app_index)
 Specify the application index of a validator. More...
 
CLI11_NODISCARD Validator application_index (int app_index) const
 Specify the application index of a validator. More...
 
CLI11_NODISCARD int get_application_index () const
 Get the current value of the application index. More...
 
CLI11_NODISCARD bool get_active () const
 Get a boolean if the validator is active. More...
 
CLI11_NODISCARD bool get_modifying () const
 Get a boolean if the validator is allowed to modify the input returns true if it can modify the input. More...
 
Validator operator& (const Validator &other) const
 
Validator operator| (const Validator &other) const
 
Validator operator! () const
 Create a validator that fails when a given validator succeeds. More...
 

Additional Inherited Members

- Protected Member Functions inherited from pxr_CLI::CLI::Validator
 Validator (std::string validator_desc, std::function< std::string(std::string &)> func)
 
 func_ (std::move(func))
 
- Protected Attributes inherited from pxr_CLI::CLI::Validator
std::function< std::string()> desc_function_ {[]() { return std::string{}; }}
 This is the description function, if empty the description_ will be used. More...
 
std::function< std::string(std::string &)> func_ {[](std::string &) { return std::string{}; }}
 
std::string name_ {}
 The name for search purposes of the Validator. More...
 
int application_index_ = -1
 A Validator will only apply to an indexed value (-1 is all elements) More...
 
bool active_ {true}
 Enable for Validator to allow it to be disabled if need be. More...
 
bool non_modifying_ {false}
 specify that a validator should not modify the input More...
 

Detailed Description

Translate named items to other or a value set.

Definition at line 3322 of file CLI11.h.

Member Typedef Documentation

Definition at line 3324 of file CLI11.h.

Constructor & Destructor Documentation

template<typename... Args>
pxr_CLI::CLI::Transformer::Transformer ( std::initializer_list< std::pair< std::string, std::string >>  values,
Args &&...  args 
)
inline

This allows in-place construction.

Definition at line 3328 of file CLI11.h.

template<typename T >
pxr_CLI::CLI::Transformer::Transformer ( T &&  mapping)
inlineexplicit

direct map of std::string to std::string

Definition at line 3332 of file CLI11.h.

template<typename T , typename F >
pxr_CLI::CLI::Transformer::Transformer ( mapping,
filter_function 
)
inlineexplicit

This checks to see if an item is in a set: pointer or copy version. You can pass in a function that will filter both sides of the comparison before computing the comparison.

Definition at line 3336 of file CLI11.h.

template<typename T , typename... Args>
pxr_CLI::CLI::Transformer::Transformer ( T &&  mapping,
filter_fn_t  filter_fn_1,
filter_fn_t  filter_fn_2,
Args &&...  other 
)
inline

You can pass in as many filter functions as you like, they nest.

Definition at line 3372 of file CLI11.h.


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