Covalent Bond  0.0.1-alpha
'covalent bond' is a data middle office. As a 2022-2023 Fall SWE final project.
Public Member Functions | Protected Attributes | List of all members
argp::parser Class Reference

#include <argparse.hpp>

Public Member Functions

 parser ()=default
 
 ~parser ()
 
template<typename T >
void add_arg (const string &name, const string &s_name, arg_type type, T default_v, bool is_necessary)
 
template<typename T >
void add_arg (const string &name, const string &s_name, arg_type type, bool is_necessary)
 
void add_arg (const string &name, const string &s_name, bool is_necessary)
 This function for no value flags. More...
 
template<typename T >
void _add_arg_ (const string &name, arg_payload< T > *arg_ptr)
 
template<typename T >
T & get_item (const string &key)
 
bool has_item (const string &key)
 
virtual bool parse (int argc, char **args)
 
virtual void show_all_parsed ()
 
virtual void show_all_defined ()
 

Protected Attributes

bool m_parsed = false
 
map< string, arg_payload_obj * > m_k_v
 
string m_current_prog
 
vector< bool > m_visited
 
vector< string > m_others
 

Detailed Description

Definition at line 53 of file argparse.hpp.

Constructor & Destructor Documentation

◆ parser()

argp::parser::parser ( )
default

◆ ~parser()

argp::parser::~parser ( )
inline

Definition at line 56 of file argparse.hpp.

Member Function Documentation

◆ _add_arg_()

template<typename T >
void argp::parser::_add_arg_ ( const string &  name,
arg_payload< T > *  arg_ptr 
)
inline

Definition at line 93 of file argparse.hpp.

◆ add_arg() [1/3]

template<typename T >
void argp::parser::add_arg ( const string &  name,
const string &  s_name,
arg_type  type,
bool  is_necessary 
)
inline

Definition at line 72 of file argparse.hpp.

◆ add_arg() [2/3]

template<typename T >
void argp::parser::add_arg ( const string &  name,
const string &  s_name,
arg_type  type,
default_v,
bool  is_necessary 
)
inline

Definition at line 62 of file argparse.hpp.

Referenced by main().

Here is the caller graph for this function:

◆ add_arg() [3/3]

void argp::parser::add_arg ( const string &  name,
const string &  s_name,
bool  is_necessary 
)
inline

This function for no value flags.

Definition at line 84 of file argparse.hpp.

References argp::t_none.

◆ get_item()

template<typename T >
T& argp::parser::get_item ( const string &  key)
inline

Definition at line 98 of file argparse.hpp.

Referenced by main().

Here is the caller graph for this function:

◆ has_item()

bool argp::parser::has_item ( const string &  key)
inline

Definition at line 107 of file argparse.hpp.

Referenced by main().

Here is the caller graph for this function:

◆ parse()

virtual bool argp::parser::parse ( int  argc,
char **  args 
)
inlinevirtual

Definition at line 112 of file argparse.hpp.

References argp::t_double, argp::t_float, argp::t_int, argp::t_none, argp::t_string, and argp::t_uint.

Referenced by main().

Here is the caller graph for this function:

◆ show_all_defined()

virtual void argp::parser::show_all_defined ( )
inlinevirtual

Definition at line 178 of file argparse.hpp.

References argp::t_double, argp::t_float, argp::t_int, argp::t_none, argp::t_string, and argp::t_uint.

Referenced by main().

Here is the caller graph for this function:

◆ show_all_parsed()

virtual void argp::parser::show_all_parsed ( )
inlinevirtual

Definition at line 173 of file argparse.hpp.

Member Data Documentation

◆ m_current_prog

string argp::parser::m_current_prog
protected

Definition at line 224 of file argparse.hpp.

◆ m_k_v

map<string, arg_payload_obj*> argp::parser::m_k_v
protected

Definition at line 223 of file argparse.hpp.

◆ m_others

vector<string> argp::parser::m_others
protected

Definition at line 226 of file argparse.hpp.

◆ m_parsed

bool argp::parser::m_parsed = false
protected

Definition at line 222 of file argparse.hpp.

◆ m_visited

vector<bool> argp::parser::m_visited
protected

Definition at line 225 of file argparse.hpp.


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