LeoArg(3)

NAME
LeoArg -

SYNOPSIS

#include <LeoArg.hh>

  Public Types
typedef list<std::string> ArgList
arg list type.
typedef list<std::string>::iterator ArgListIt
arg list type iterator.
typedef std::list<Option> OptionList
Option list type.
typedef OptionList::iterator OptionListIt
Option list iterator.

  Public Methods
LeoArg ( int argc, char **argv, std::string long_option_switch = --",std::stringshort_option_switch=-)"
LeoArg ( Setting& setting )
initialize with a filled setting structure.
void short_option_string ( bool short_os )
enable/disable the short option string.
bool short_option_string () const
returns true if short option string parsing is enabled.
Setting get_setting () const
returns the current setting.
bool has_parameters () const
true if any optin or parameter is set.
bool get_option ( Option& option )
returns a specific option.
bool get_first ( std::string& ret_value ) const
eg.: ./cmdhello--filea_fileanother_file"thefunctionwillreturnhello."
bool get_first ( ArgList& arglist ) const
eg.: ./cmdhelloworld--filea_fileanother_file"thefunctionwillfilltheArgListwithhelloandworld."
bool get_last ( std::string & ret_value ) const
eg.: ./cmd--filea_fileanother_file"thefunctionwillreturnanother_file."
bool get_last ( ArgList& arglist ) const
eg.: ./cmd--filea_fileanother_file"thefunctionwillfilltheArgListwitha_fileandanother_file."
std::string get_prog_name () const
void clear_cache ()
clear the cache.

  Private Methods
bool parse_option ( Option& option ) const
void correct_option ( Option& option ) const
void correct_setting ()
bool find_option ( Option& option ) const
function searches in cache for the specific option.
bool is_in_sos ( const Option& option ) const
checks if an option is in the short option string.
int has_sos () const
finds a short option string.

  Private Attributes
Setting setting
the setting.

DETAILED DESCRIPTION

Examples:

leoargmain.cpp.

MEMBER TYPEDEF DOCUMENTATION

  typedef list<std::string> LeoArg::ArgList

arg list type.

  typedef list<std::string>::iterator LeoArg::ArgListIt

arg list type iterator.

  typedef std::list<Option> LeoArg::OptionList

Option list type.

  typedef OptionList::iterator LeoArg::OptionListIt

Option list iterator.

CONSTRUCTOR & DESTRUCTOR DOCUMENTATION

  LeoArg::LeoArg (int argc, char ** argv, std::string long_option_switch = -- , std::string short_option_switch = - )

  LeoArg::LeoArg (Setting & setting)

initialize with a filled setting structure.

MEMBER FUNCTION DOCUMENTATION

  void LeoArg::clear_cache () [inline]

clear the cache.

  void LeoArg::correct_option (Option & option) const [private]

  void LeoArg::correct_setting () [private]

  bool LeoArg::find_option (Option & option) const [private]

function searches in cache for the specific option.

  bool LeoArg::get_first (ArgList & arglist) const

eg.: "./cmd hello world --file a_file another_file" the function will fill the ArgList with "hello" and "world".

  bool LeoArg::get_first (std::string & ret_value) const

eg.: "./cmd hello --file a_file another_file" the function will return "hello".

Examples:
leoargmain.cpp.

  bool LeoArg::get_last (ArgList & arglist) const

eg.: "./cmd --file a_file another_file" the function will fill the ArgList with "a_file" and "another_file".

  bool LeoArg::get_last (std::string & ret_value) const

eg.: "./cmd --file a_file another_file" the function will return "another_file".

Examples:
leoargmain.cpp.

  bool LeoArg::get_option (Option & option)

returns a specific option.

Examples:
leoargmain.cpp.

  std::string LeoArg::get_prog_name () const [inline]

  Setting LeoArg::get_setting () const [inline]

returns the current setting.

  bool LeoArg::has_parameters () const [inline]

true if any optin or parameter is set.

Examples:
leoargmain.cpp.

  int LeoArg::has_sos () const [private]

finds a short option string.

If no sos was found it returns zero

  bool LeoArg::is_in_sos (const Option & option) const [private]

checks if an option is in the short option string.

  bool LeoArg::parse_option (Option & option) const [private]

  bool LeoArg::short_option_string () const [inline]

returns true if short option string parsing is enabled.

Examples:
leoargmain.cpp.

  void LeoArg::short_option_string (bool short_os) [inline]

enable/disable the short option string.

MEMBER DATA DOCUMENTATION

  Setting LeoArg::setting [private]

the setting.

AUTHOR

Generated automatically by Doxygen for LeoArg from the source code.