arg  1.2
a C++ command-line parser
Public Member Functions | List of all members
arg::SetValue Class Reference

int values represent choices from a set of names in strings More...

#include <val.hh>

Inheritance diagram for arg::SetValue:
Inheritance graph
[legend]
Collaboration diagram for arg::SetValue:
Collaboration graph
[legend]

Public Member Functions

 SetValue (int &var)
 
void add_help (std::string const &title="Available values:")
 add a special help element to the set
 
void add_help (std::string const &title, int value)
 add a help element mapped with an int value to the set
 
void add (std::string const &name, std::string const &help="")
 add an element to the set
 
void add (std::string const &name, int value, std::string const &help="")
 add an element mapped with an int value to the set
 
void set (std::string const &str) override
 convert the str to value and put it in storage
 
std::string to_str () const override
 convert the value to a string
 
std::string get_type () const override
 type name of the value
 

Detailed Description

int values represent choices from a set of names in strings

Constructor & Destructor Documentation

◆ SetValue()

SetValue::SetValue ( int &  var)

make a SetValue from int &