#include <OTC/program/program.hh> class OTC_Program {
public:
static void initialise(int argc, char* argv[]);
static OTC_String const& name();
static int numOptions();
static OTC_String const& option(u_int theNum=1);
static OTC_Boolean match(char const* thePattern, u_int theNum=1);
static OTC_Iterator<OTC_String> options( OTC_Direction theDirection=OTCLIB_FORWARD );
static OTC_Iterator<OTC_String> options( u_int theStart, u_int theLength, OTC_Direction theDirection=OTCLIB_FORWARD );
static OTC_Iterator<OTC_String> options( OTC_Range const& theRange, OTC_Direction theDirection=OTCLIB_FORWARD );
static void shift(u_int theNum=1);
static void restore();
};
initialise()
at the
start of main()
. Upon doing this it will maintain a copy of the
name of the program and the options to the program.
static void initialise(int argc, char* argv[]);
static OTC_String const& name();
static int numOptions();
argc
this does not
include the name of the program in the
count. If this class has not been
initialised, then -1
will be returned.
static OTC_String const& option(u_int theNum=1);
theNum
.
Generates an exception if theNum
is
greater than the number of options.
If theNum
is 0
then the name of the
program is returned.
static OTC_Boolean match(char const* thePattern, u_int theNum=1);
theNum
and returns
OTCLIB_TRUE
if sucessful.
Generates an exception if theNum
is
greater than the number of options.
If theNum
is 0
then the name of the
program will be matched against.
static OTC_Iterator<OTC_String> options(
OTC_Direction theDirection=OTCLIB_FORWARD
);
static OTC_Iterator<OTC_String> options(
u_int theStart,
u_int theLength,
OTC_Direction theDirection=OTCLIB_FORWARD
);
theStart
and with length theLength
.
static OTC_Iterator<OTC_String> options(
OTC_Range const& theRange,
OTC_Direction theDirection=OTCLIB_FORWARD
);
theRange
.
static void shift(u_int theNum=1);
theNum
options and shift all
other options down one spot. This is
analagous to the shift
operator in shell
scripts.
static void restore();
shift()
.