NAME

OTC_Program - Class to encapsulate information about a programs options.

SYNOPSIS


#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();
};

CLASS TYPE

Static

DESCRIPTION

This class should be initialised once using 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.

PUBLIC MEMBERS

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();

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1991 1992 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED