OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::OptionList Class Reference

#include <options.hpp>

Inheritance diagram for openvpn::OptionList:
[legend]
Collaboration diagram for openvpn::OptionList:
[legend]

Classes

struct  FilterBase
 
class  KeyValue
 
struct  KeyValueList
 
class  LexComment
 
class  Limits
 

Public Types

typedef RCPtr< OptionListPtr
 
typedef std::vector< unsigned int > IndexList
 
typedef std::unordered_map< std::string, IndexListIndexMap
 
typedef std::pair< std::string, IndexListIndexPair
 
typedef StandardLex Lex
 

Public Member Functions

 OptionList ()
 
template<typename T , typename... Args>
 OptionList (T first, Args... args)
 
void clear ()
 
void parse_from_csv (const std::string &str, Limits *lim)
 
void parse_from_argv (const std::vector< std::string > &argv)
 
void parse_from_peer_info (const std::string &str, Limits *lim)
 
void parse_from_key_value_list (const KeyValueList &list, const std::string &meta_tag, Limits *lim)
 
void parse_from_config (const std::string &str, Limits *lim)
 
void parse_meta_from_config (const std::string &str, const std::string &tag, Limits *lim)
 
void extend (const OptionList &other, FilterBase *filt=nullptr)
 
void extend (OptionList &&other, FilterBase *filt=nullptr)
 
unsigned int extend (const OptionList &other, const std::string &name)
 
void extend_nonexistent (const OptionList &other)
 
const Optionget_ptr (const std::string &name) const
 
const Optionget_unique_ptr (const std::string &name) const
 
const Optionget_consistent (const std::string &name) const
 
const Optionget (const std::string &name) const
 
const IndexListget_index (const std::string &name) const
 
const IndexListget_index_ptr (const std::string &name) const
 
std::string cat (const std::string &name) const
 
bool exists_unique (const std::string &name) const
 
bool exists (const std::string &name) const
 
const std::string & get (const std::string &name, size_t index, const size_t max_len) const
 
std::string get_optional (const std::string &name, size_t index, const size_t max_len) const
 
std::string get_optional_relaxed (const std::string &name, size_t index, const size_t max_len) const
 
std::string get_optional_noexcept (const std::string &name, size_t index, const size_t max_len) const
 
const char * get_c_str (const std::string &name, size_t index, const size_t max_len) const
 
std::string get_default (const std::string &name, size_t index, const size_t max_len, const std::string &default_value) const
 
std::string get_default_relaxed (const std::string &name, size_t index, const size_t max_len, const std::string &default_value) const
 
template<typename T >
get_num (const std::string &name, const size_t idx, const T default_value) const
 
template<typename T >
get_num (const std::string &name, const size_t idx, const T default_value, const T min_value, const T max_value) const
 
template<typename T >
get_num (const std::string &name, const size_t idx, const T min_value, const T max_value) const
 
template<typename T >
get_num (const std::string &name, const size_t idx) const
 
void touch (const std::string &name) const
 
std::string render (const unsigned int flags) const
 
std::string render_csv () const
 
std::string render_map () const
 
size_t n_unused (bool ignore_meta=false) const
 
size_t meta_unused () const
 
void show_unused_options (const char *title=nullptr) const
 
void add_item (const Option &opt)
 
const IndexMapmap () const
 
void update_map ()
 
- Public Member Functions inherited from openvpn::RCCopyable< thread_unsafe_refcount >
virtual ~RCCopyable ()=default
 
 RCCopyable () noexcept=default
 
 RCCopyable (const RCCopyable &) noexcept
 Construct a new RCCopyable object.
 
 RCCopyable (RCCopyable &&) noexcept
 Construct a new RCCopyable object by move.
 
RCCopyableoperator= (const RCCopyable &) noexcept
 Ensures the new ref count is not copied with the rest of the object.
 
RCCopyableoperator= (RCCopyable &&) noexcept
 Ensures the new ref count is not moved with the rest of the object.
 
olong use_count () const noexcept
 Returns the use count as reported by defering to the injected ref count type.
 

Static Public Member Functions

static bool is_comment (const char c)
 
static OptionList parse_from_csv_static (const std::string &str, Limits *lim)
 
static OptionList parse_from_csv_static_nomap (const std::string &str, Limits *lim)
 
static OptionList parse_from_config_static (const std::string &str, Limits *lim)
 
static OptionList::Ptr parse_from_config_static_ptr (const std::string &str, Limits *lim)
 
static OptionList parse_from_argv_static (const std::vector< std::string > &argv)
 
static Option parse_option_from_line (const std::string &line, Limits *lim)
 
static bool ignore_line (const std::string &line)
 
static bool is_open_tag (const std::string &str)
 
static bool is_close_tag (const std::string &str, const std::string &tag)
 
static void untag_open_tag (std::string &str)
 
static bool detect_multiline_breakout_nothrow (const std::string &opt, const std::string &tag)
 
static void detect_multiline_breakout (const std::string &opt, const std::string &tag)
 

Private Member Functions

void from_list (Option opt)
 
template<typename T , typename... Args>
void from_list (T first, Args... args)
 

Static Private Member Functions

static bool is_open_meta_tag (const std::string &str)
 
static bool is_close_meta_tag (const std::string &str, const std::string &prefix, const std::string &tag)
 
static void untag_open_meta_tag (std::string &str)
 
static void extraneous_err (const int line_num, const char *type, const Option &opt)
 
static void not_closed_out_err (const char *type, const Option &opt)
 
static void line_too_long (const int line_num)
 

Private Attributes

IndexMap map_
 

Detailed Description

Definition at line 516 of file options.hpp.

Member Typedef Documentation

◆ IndexList

typedef std::vector<unsigned int> openvpn::OptionList::IndexList

Definition at line 520 of file options.hpp.

◆ IndexMap

typedef std::unordered_map<std::string, IndexList> openvpn::OptionList::IndexMap

Definition at line 521 of file options.hpp.

◆ IndexPair

typedef std::pair<std::string, IndexList> openvpn::OptionList::IndexPair

Definition at line 522 of file options.hpp.

◆ Lex

Definition at line 530 of file options.hpp.

◆ Ptr

Definition at line 519 of file options.hpp.

Constructor & Destructor Documentation

◆ OptionList() [1/2]

openvpn::OptionList::OptionList ( )
inline

Definition at line 832 of file options.hpp.

Here is the caller graph for this function:

◆ OptionList() [2/2]

template<typename T , typename... Args>
openvpn::OptionList::OptionList ( first,
Args...  args 
)
inlineexplicit

Definition at line 837 of file options.hpp.

Member Function Documentation

◆ add_item()

void openvpn::OptionList::add_item ( const Option opt)
inline

Definition at line 1551 of file options.hpp.

Here is the caller graph for this function:

◆ cat()

std::string openvpn::OptionList::cat ( const std::string &  name) const
inline

Definition at line 1286 of file options.hpp.

Here is the caller graph for this function:

◆ clear()

void openvpn::OptionList::clear ( )
inline

Definition at line 883 of file options.hpp.

Here is the caller graph for this function:

◆ detect_multiline_breakout()

static void openvpn::OptionList::detect_multiline_breakout ( const std::string &  opt,
const std::string &  tag 
)
inlinestatic

Definition at line 1642 of file options.hpp.

Here is the caller graph for this function:

◆ detect_multiline_breakout_nothrow()

static bool openvpn::OptionList::detect_multiline_breakout_nothrow ( const std::string &  opt,
const std::string &  tag 
)
inlinestatic

Definition at line 1617 of file options.hpp.

Here is the caller graph for this function:

◆ exists()

bool openvpn::OptionList::exists ( const std::string &  name) const
inline

Definition at line 1325 of file options.hpp.

Here is the caller graph for this function:

◆ exists_unique()

bool openvpn::OptionList::exists_unique ( const std::string &  name) const
inline

Definition at line 1319 of file options.hpp.

◆ extend() [1/3]

unsigned int openvpn::OptionList::extend ( const OptionList other,
const std::string &  name 
)
inline

Definition at line 1152 of file options.hpp.

◆ extend() [2/3]

void openvpn::OptionList::extend ( const OptionList other,
FilterBase filt = nullptr 
)
inline

Definition at line 1123 of file options.hpp.

Here is the caller graph for this function:

◆ extend() [3/3]

void openvpn::OptionList::extend ( OptionList &&  other,
FilterBase filt = nullptr 
)
inline

Definition at line 1139 of file options.hpp.

◆ extend_nonexistent()

void openvpn::OptionList::extend_nonexistent ( const OptionList other)
inline

Definition at line 1171 of file options.hpp.

Here is the caller graph for this function:

◆ extraneous_err()

static void openvpn::OptionList::extraneous_err ( const int  line_num,
const char *  type,
const Option opt 
)
inlinestaticprivate

Definition at line 1671 of file options.hpp.

Here is the caller graph for this function:

◆ from_list() [1/2]

void openvpn::OptionList::from_list ( Option  opt)
inlineprivate

Definition at line 1686 of file options.hpp.

Here is the caller graph for this function:

◆ from_list() [2/2]

template<typename T , typename... Args>
void openvpn::OptionList::from_list ( first,
Args...  args 
)
inlineprivate

Definition at line 1692 of file options.hpp.

◆ get() [1/2]

const Option & openvpn::OptionList::get ( const std::string &  name) const
inline

Definition at line 1254 of file options.hpp.

Here is the caller graph for this function:

◆ get() [2/2]

const std::string & openvpn::OptionList::get ( const std::string &  name,
size_t  index,
const size_t  max_len 
) const
inline

Definition at line 1333 of file options.hpp.

◆ get_c_str()

const char * openvpn::OptionList::get_c_str ( const std::string &  name,
size_t  index,
const size_t  max_len 
) const
inline

Definition at line 1375 of file options.hpp.

◆ get_consistent()

const Option * openvpn::OptionList::get_consistent ( const std::string &  name) const
inline

Definition at line 1228 of file options.hpp.

◆ get_default()

std::string openvpn::OptionList::get_default ( const std::string &  name,
size_t  index,
const size_t  max_len,
const std::string &  default_value 
) const
inline

Definition at line 1387 of file options.hpp.

Here is the caller graph for this function:

◆ get_default_relaxed()

std::string openvpn::OptionList::get_default_relaxed ( const std::string &  name,
size_t  index,
const size_t  max_len,
const std::string &  default_value 
) const
inline

Definition at line 1400 of file options.hpp.

◆ get_index()

const IndexList & openvpn::OptionList::get_index ( const std::string &  name) const
inline

Definition at line 1265 of file options.hpp.

Here is the caller graph for this function:

◆ get_index_ptr()

const IndexList * openvpn::OptionList::get_index_ptr ( const std::string &  name) const
inline

Definition at line 1276 of file options.hpp.

Here is the caller graph for this function:

◆ get_num() [1/4]

template<typename T >
T openvpn::OptionList::get_num ( const std::string &  name,
const size_t  idx 
) const
inline

Definition at line 1449 of file options.hpp.

◆ get_num() [2/4]

template<typename T >
T openvpn::OptionList::get_num ( const std::string &  name,
const size_t  idx,
const T  default_value 
) const
inline

Definition at line 1416 of file options.hpp.

Here is the caller graph for this function:

◆ get_num() [3/4]

template<typename T >
T openvpn::OptionList::get_num ( const std::string &  name,
const size_t  idx,
const T  default_value,
const T  min_value,
const T  max_value 
) const
inline

Definition at line 1427 of file options.hpp.

◆ get_num() [4/4]

template<typename T >
T openvpn::OptionList::get_num ( const std::string &  name,
const size_t  idx,
const T  min_value,
const T  max_value 
) const
inline

Definition at line 1442 of file options.hpp.

◆ get_optional()

std::string openvpn::OptionList::get_optional ( const std::string &  name,
size_t  index,
const size_t  max_len 
) const
inline

Definition at line 1342 of file options.hpp.

Here is the caller graph for this function:

◆ get_optional_noexcept()

std::string openvpn::OptionList::get_optional_noexcept ( const std::string &  name,
size_t  index,
const size_t  max_len 
) const
inline

Definition at line 1362 of file options.hpp.

◆ get_optional_relaxed()

std::string openvpn::OptionList::get_optional_relaxed ( const std::string &  name,
size_t  index,
const size_t  max_len 
) const
inline

Definition at line 1352 of file options.hpp.

◆ get_ptr()

const Option * openvpn::OptionList::get_ptr ( const std::string &  name) const
inline

Definition at line 1186 of file options.hpp.

Here is the caller graph for this function:

◆ get_unique_ptr()

const Option * openvpn::OptionList::get_unique_ptr ( const std::string &  name) const
inline

Definition at line 1208 of file options.hpp.

Here is the caller graph for this function:

◆ ignore_line()

static bool openvpn::OptionList::ignore_line ( const std::string &  line)
inlinestatic

Definition at line 1581 of file options.hpp.

Here is the caller graph for this function:

◆ is_close_meta_tag()

static bool openvpn::OptionList::is_close_meta_tag ( const std::string &  str,
const std::string &  prefix,
const std::string &  tag 
)
inlinestaticprivate

Definition at line 1658 of file options.hpp.

Here is the caller graph for this function:

◆ is_close_tag()

static bool openvpn::OptionList::is_close_tag ( const std::string &  str,
const std::string &  tag 
)
inlinestatic

Definition at line 1602 of file options.hpp.

Here is the caller graph for this function:

◆ is_comment()

static bool openvpn::OptionList::is_comment ( const char  c)
inlinestatic

Definition at line 524 of file options.hpp.

Here is the caller graph for this function:

◆ is_open_meta_tag()

static bool openvpn::OptionList::is_open_meta_tag ( const std::string &  str)
inlinestaticprivate

Definition at line 1652 of file options.hpp.

Here is the caller graph for this function:

◆ is_open_tag()

static bool openvpn::OptionList::is_open_tag ( const std::string &  str)
inlinestatic

Definition at line 1595 of file options.hpp.

Here is the caller graph for this function:

◆ line_too_long()

static void openvpn::OptionList::line_too_long ( const int  line_num)
inlinestaticprivate

Definition at line 1681 of file options.hpp.

Here is the caller graph for this function:

◆ map()

const IndexMap & openvpn::OptionList::map ( ) const
inline

Definition at line 1562 of file options.hpp.

Here is the caller graph for this function:

◆ meta_unused()

size_t openvpn::OptionList::meta_unused ( ) const
inline

Definition at line 1526 of file options.hpp.

◆ n_unused()

size_t openvpn::OptionList::n_unused ( bool  ignore_meta = false) const
inline

Definition at line 1512 of file options.hpp.

Here is the caller graph for this function:

◆ not_closed_out_err()

static void openvpn::OptionList::not_closed_out_err ( const char *  type,
const Option opt 
)
inlinestaticprivate

Definition at line 1676 of file options.hpp.

Here is the caller graph for this function:

◆ parse_from_argv()

void openvpn::OptionList::parse_from_argv ( const std::vector< std::string > &  argv)
inline

Definition at line 911 of file options.hpp.

Here is the caller graph for this function:

◆ parse_from_argv_static()

static OptionList openvpn::OptionList::parse_from_argv_static ( const std::vector< std::string > &  argv)
inlinestatic

Definition at line 875 of file options.hpp.

Here is the caller graph for this function:

◆ parse_from_config()

void openvpn::OptionList::parse_from_config ( const std::string &  str,
Limits lim 
)
inline

Definition at line 985 of file options.hpp.

Here is the caller graph for this function:

◆ parse_from_config_static()

static OptionList openvpn::OptionList::parse_from_config_static ( const std::string &  str,
Limits lim 
)
inlinestatic

Definition at line 859 of file options.hpp.

Here is the caller graph for this function:

◆ parse_from_config_static_ptr()

static OptionList::Ptr openvpn::OptionList::parse_from_config_static_ptr ( const std::string &  str,
Limits lim 
)
inlinestatic

Definition at line 867 of file options.hpp.

Here is the caller graph for this function:

◆ parse_from_csv()

void openvpn::OptionList::parse_from_csv ( const std::string &  str,
Limits lim 
)
inline

Definition at line 890 of file options.hpp.

Here is the caller graph for this function:

◆ parse_from_csv_static()

static OptionList openvpn::OptionList::parse_from_csv_static ( const std::string &  str,
Limits lim 
)
inlinestatic

Definition at line 844 of file options.hpp.

Here is the caller graph for this function:

◆ parse_from_csv_static_nomap()

static OptionList openvpn::OptionList::parse_from_csv_static_nomap ( const std::string &  str,
Limits lim 
)
inlinestatic

Definition at line 852 of file options.hpp.

Here is the caller graph for this function:

◆ parse_from_key_value_list()

void openvpn::OptionList::parse_from_key_value_list ( const KeyValueList list,
const std::string &  meta_tag,
Limits lim 
)
inline

Definition at line 959 of file options.hpp.

Here is the caller graph for this function:

◆ parse_from_peer_info()

void openvpn::OptionList::parse_from_peer_info ( const std::string &  str,
Limits lim 
)
inline

Definition at line 934 of file options.hpp.

Here is the caller graph for this function:

◆ parse_meta_from_config()

void openvpn::OptionList::parse_meta_from_config ( const std::string &  str,
const std::string &  tag,
Limits lim 
)
inline

Definition at line 1052 of file options.hpp.

Here is the caller graph for this function:

◆ parse_option_from_line()

static Option openvpn::OptionList::parse_option_from_line ( const std::string &  line,
Limits lim 
)
inlinestatic

Definition at line 979 of file options.hpp.

Here is the caller graph for this function:

◆ render()

std::string openvpn::OptionList::render ( const unsigned int  flags) const
inline

Definition at line 1465 of file options.hpp.

Here is the caller graph for this function:

◆ render_csv()

std::string openvpn::OptionList::render_csv ( ) const
inline

Definition at line 1481 of file options.hpp.

Here is the caller graph for this function:

◆ render_map()

std::string openvpn::OptionList::render_map ( ) const
inline

Definition at line 1497 of file options.hpp.

Here is the caller graph for this function:

◆ show_unused_options()

void openvpn::OptionList::show_unused_options ( const char *  title = nullptr) const
inline

Definition at line 1538 of file options.hpp.

◆ touch()

void openvpn::OptionList::touch ( const std::string &  name) const
inline

Definition at line 1456 of file options.hpp.

Here is the caller graph for this function:

◆ untag_open_meta_tag()

static void openvpn::OptionList::untag_open_meta_tag ( std::string &  str)
inlinestaticprivate

Definition at line 1664 of file options.hpp.

Here is the caller graph for this function:

◆ untag_open_tag()

static void openvpn::OptionList::untag_open_tag ( std::string &  str)
inlinestatic

Definition at line 1609 of file options.hpp.

Here is the caller graph for this function:

◆ update_map()

void openvpn::OptionList::update_map ( )
inline

Definition at line 1569 of file options.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ map_

IndexMap openvpn::OptionList::map_
private

Definition at line 1698 of file options.hpp.


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