Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

phArgTable Class Reference
[Command Line Argument Parsing]

#include <phArgTable.h>

Inheritance diagram for phArgTable:

phObject List of all members.

Detailed Description

The phArgTable class is used to parse command line arguments. This class is used to set up a table that maps command line switches to variables within a program. The parsing process is:

If a switch isn't provided, the pointer to the variable is not altered. When any of the variables are passed as the pointer parameter, they should be referenced using the “&” operator to get their local address. For example, “int value” should be passed to the add method as such: “&value”.

All arguments are parsed in the order which they are supplied on the command line. If there are multiple instances of the same switch string within the table, the first switch added will be used.

This is not meant to be a complicated mechanism for parsing the command line. A list of strings to look for in the arguments is built using phArgTable::add. Generally this class is used near the begining of the main function and main's arguments (argc and argv) are passed to the phArgTable::parse method.

Todo:
Document more thoroughly

Definition at line 225 of file phArgTable.h.

Public Member Functions

 phArgTable ()
 ~phArgTable ()
int parse (int argc, char *argv[])
int add (const char *switch_string, void *pointer, int type)

Private Attributes

argument_table_structm_table


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



Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:43 2007 for phission by  doxygen 1.4.4