Scarab  v3.4.1
Project 8 C++ Utility Library
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
OptionBase< CRTP > Class Template Reference

#include <CLI11.hpp>

Inheritance diagram for OptionBase< CRTP >:
Inheritance graph

Public Member Functions

CRTP * group (std::string name)
 Changes the group membership. More...
 
CRTP * required (bool value=true)
 Set the option as required. More...
 
CRTP * mandatory (bool value=true)
 Support Plumbum term. More...
 
CRTP * always_capture_default (bool value=true)
 
const std::string & get_group () const
 Get the group of this option. More...
 
bool get_required () const
 True if this is a required option. More...
 
bool get_ignore_case () const
 The status of ignore case. More...
 
bool get_ignore_underscore () const
 The status of ignore_underscore. More...
 
bool get_configurable () const
 The status of configurable. More...
 
bool get_disable_flag_override () const
 The status of configurable. More...
 
char get_delimiter () const
 Get the current delimeter char. More...
 
bool get_always_capture_default () const
 Return true if this will automatically capture the default value for help printing. More...
 
MultiOptionPolicy get_multi_option_policy () const
 The status of the multi option policy. More...
 
CRTP * take_last ()
 Set the multi option policy to take last. More...
 
CRTP * take_first ()
 Set the multi option policy to take last. More...
 
CRTP * join ()
 Set the multi option policy to take last. More...
 
CRTP * configurable (bool value=true)
 Allow in a configuration file. More...
 
CRTP * delimiter (char value='\0')
 Allow in a configuration file. More...
 

Protected Member Functions

template<typename T >
void copy_to (T *other) const
 Copy the contents to another similar class (one based on OptionBase) More...
 

Protected Attributes

std::string group_ = std::string("Options")
 The group membership. More...
 
bool required_ {false}
 True if this is a required option. More...
 
bool ignore_case_ {false}
 Ignore the case when matching (option, not value) More...
 
bool ignore_underscore_ {false}
 Ignore underscores when matching (option, not value) More...
 
bool configurable_ {true}
 Allow this option to be given in a configuration file. More...
 
bool disable_flag_override_ {false}
 Disable overriding flag values with '=value'. More...
 
char delimiter_ {'\0'}
 Specify a delimiter character for vector arguments. More...
 
bool always_capture_default_ {false}
 Automatically capture default value. More...
 
MultiOptionPolicy multi_option_policy_ {MultiOptionPolicy::Throw}
 Policy for multiple arguments when expected_ == 1 (can be set on bool flags, too) More...
 

Private Attributes

friend App
 

Detailed Description

template<typename CRTP>
class CLI::OptionBase< CRTP >

This is the CRTP base class for Option and OptionDefaults. It was designed this way to share parts of the class; an OptionDefaults can copy to an Option.

Definition at line 2677 of file CLI11.hpp.

Member Function Documentation

◆ always_capture_default()

CRTP* always_capture_default ( bool  value = true)
inline

Definition at line 2739 of file CLI11.hpp.

◆ configurable()

CRTP* configurable ( bool  value = true)
inline

Allow in a configuration file.

Definition at line 2797 of file CLI11.hpp.

◆ copy_to()

void copy_to ( T *  other) const
inlineprotected

Copy the contents to another similar class (one based on OptionBase)

Definition at line 2709 of file CLI11.hpp.

◆ delimiter()

CRTP* delimiter ( char  value = '\0')
inline

Allow in a configuration file.

Definition at line 2803 of file CLI11.hpp.

◆ get_always_capture_default()

bool get_always_capture_default ( ) const
inline

Return true if this will automatically capture the default value for help printing.

Definition at line 2768 of file CLI11.hpp.

◆ get_configurable()

bool get_configurable ( ) const
inline

The status of configurable.

Definition at line 2759 of file CLI11.hpp.

◆ get_delimiter()

char get_delimiter ( ) const
inline

Get the current delimeter char.

Definition at line 2765 of file CLI11.hpp.

◆ get_disable_flag_override()

bool get_disable_flag_override ( ) const
inline

The status of configurable.

Definition at line 2762 of file CLI11.hpp.

◆ get_group()

const std::string& get_group ( ) const
inline

Get the group of this option.

Definition at line 2747 of file CLI11.hpp.

◆ get_ignore_case()

bool get_ignore_case ( ) const
inline

The status of ignore case.

Definition at line 2753 of file CLI11.hpp.

◆ get_ignore_underscore()

bool get_ignore_underscore ( ) const
inline

The status of ignore_underscore.

Definition at line 2756 of file CLI11.hpp.

◆ get_multi_option_policy()

MultiOptionPolicy get_multi_option_policy ( ) const
inline

The status of the multi option policy.

Definition at line 2771 of file CLI11.hpp.

◆ get_required()

bool get_required ( ) const
inline

True if this is a required option.

Definition at line 2750 of file CLI11.hpp.

◆ group()

CRTP* group ( std::string  name)
inline

Changes the group membership.

Definition at line 2725 of file CLI11.hpp.

◆ join()

CRTP* join ( )
inline

Set the multi option policy to take last.

Definition at line 2790 of file CLI11.hpp.

◆ mandatory()

CRTP* mandatory ( bool  value = true)
inline

Support Plumbum term.

Definition at line 2737 of file CLI11.hpp.

◆ required()

CRTP* required ( bool  value = true)
inline

Set the option as required.

Definition at line 2731 of file CLI11.hpp.

◆ take_first()

CRTP* take_first ( )
inline

Set the multi option policy to take last.

Definition at line 2783 of file CLI11.hpp.

◆ take_last()

CRTP* take_last ( )
inline

Set the multi option policy to take last.

Definition at line 2776 of file CLI11.hpp.

Member Data Documentation

◆ always_capture_default_

bool always_capture_default_ {false}
protected

Automatically capture default value.

Definition at line 2703 of file CLI11.hpp.

◆ App

friend App
private

Definition at line 2678 of file CLI11.hpp.

◆ configurable_

bool configurable_ {true}
protected

Allow this option to be given in a configuration file.

Definition at line 2694 of file CLI11.hpp.

◆ delimiter_

char delimiter_ {'\0'}
protected

Specify a delimiter character for vector arguments.

Definition at line 2700 of file CLI11.hpp.

◆ disable_flag_override_

bool disable_flag_override_ {false}
protected

Disable overriding flag values with '=value'.

Definition at line 2697 of file CLI11.hpp.

◆ group_

std::string group_ = std::string("Options")
protected

The group membership.

Definition at line 2682 of file CLI11.hpp.

◆ ignore_case_

bool ignore_case_ {false}
protected

Ignore the case when matching (option, not value)

Definition at line 2688 of file CLI11.hpp.

◆ ignore_underscore_

bool ignore_underscore_ {false}
protected

Ignore underscores when matching (option, not value)

Definition at line 2691 of file CLI11.hpp.

◆ multi_option_policy_

MultiOptionPolicy multi_option_policy_ {MultiOptionPolicy::Throw}
protected

Policy for multiple arguments when expected_ == 1 (can be set on bool flags, too)

Definition at line 2706 of file CLI11.hpp.

◆ required_

bool required_ {false}
protected

True if this is a required option.

Definition at line 2685 of file CLI11.hpp.


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