oasys::Getopt Class Reference

#include <Getopt.h>

List of all members.


Detailed Description

Definition at line 50 of file Getopt.h.

Static Public Member Functions

static void addopt (Opt *opt)
 Register a new option binding.
static int getopt (const char *progname, int argc, char *const argv[], const char *extra_usage="")
 Parse argv, processing all registered getopt.
static void usage (const char *progname, const char *extra_usage="")
 Prints a nicely formatted usage string to stderr.

Protected Types

typedef std::vector< Opt * > OptList

Static Protected Attributes

static Optopts_ []
static OptList allopts_


Member Typedef Documentation

typedef std::vector<Opt*> oasys::Getopt::OptList [protected]

Definition at line 79 of file Getopt.h.


Member Function Documentation

void oasys::Getopt::addopt ( Opt opt  )  [static]

Register a new option binding.

Definition at line 57 of file Getopt.cc.

References allopts_, opts_, and oasys::Opt::shortopt_.

Referenced by dtntunnel::DTNTunnel::get_options(), dtn::DTND::get_options(), and main().

int oasys::Getopt::getopt ( const char *  progname,
int  argc,
char *const   argv[],
const char *  extra_usage = "" 
) [static]

Parse argv, processing all registered getopt.

Returns the index of the first non-option argument in argv

Parameters:
progname the name of the executable
argc count of command line args
argv command line arg values
extra_opts additional usage string

Definition at line 73 of file Getopt.cc.

References allopts_, oasys::Opt::needval_, and oasys::Opt::shortopt_.

Referenced by dtntunnel::DTNTunnel::get_options(), dtn::DTND::get_options(), and main().

void oasys::Getopt::usage ( const char *  progname,
const char *  extra_usage = "" 
) [static]

Prints a nicely formatted usage string to stderr.

Parameters:
progname the name of the executable
extra_opts additional usage string

Definition at line 178 of file Getopt.cc.

References allopts_.

Referenced by dtntunnel::DTNTunnel::get_options(), dtn::DTND::get_options(), and main().


Member Data Documentation

Opt * oasys::Getopt::opts_ [static, protected]

Definition at line 81 of file Getopt.h.

Referenced by addopt().

Getopt::OptList oasys::Getopt::allopts_ [static, protected]

Definition at line 82 of file Getopt.h.

Referenced by addopt(), getopt(), and usage().


The documentation for this class was generated from the following files:
Generated on Fri Dec 22 14:48:07 2006 for DTN Reference Implementation by  doxygen 1.5.1