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

string values from a set of terms More...

#include <val.hh>

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

Public Member Functions

 TermValue (std::string &var)
 make string a TermValue
 
void add_help (std::string const &title="Available values:")
 add a help term
 
void add (std::string const &name, std::string const &help="")
 add a term More...
 
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

string values from a set of terms

Member Function Documentation

◆ add()

void TermValue::add ( std::string const &  name,
std::string const &  help = "" 
)

add a term

Parameters
namethe term
helpdecription of the term