Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

psArguments.h

Go to the documentation of this file.
00001 /** @file  psArguments.h
00002  *
00003  *  @brief Contains operations for parsing command line input arguments.
00004  *
00005  *  @ingroup Arguments
00006  *
00007  *  @author David Robbins, MHPCC
00008  *
00009  *  @version $Revision: 1.2 $ $Name: rel12 $
00010  *  @date $Date: 2006/01/25 03:02:47 $
00011  *
00012  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
00013  */
00014 
00015 #ifndef PS_ARGUMENTS_H
00016 #define PS_ARGUMENTS_H
00017 
00018 /// @addtogroup Arguments
00019 /// @{
00020 
00021 #include "psMetadata.h"
00022 
00023 /** Implements the various verbosity controls.
00024  *
00025  *  Arguments shall be removed from the argument list as they are processed.
00026  *
00027  *  @return int:        The resultant logging level.
00028  */
00029 int psArgumentVerbosity(
00030     int *argc,                         ///< number of arguments
00031     char **argv                        ///< the argument list
00032 );
00033 
00034 /** Checks for an argument and returns its index position if found.
00035  *
00036  *  @return int:        The index of the element in the argument list, otherwise 0.
00037  */
00038 int psArgumentGet(
00039     int argc,                          ///< number of arguments
00040     char **argv,                       ///< the argument list
00041     const char *arg                    ///< the specified argument to match
00042 );
00043 
00044 /** Removes from the argument list the argument whose index is argnum.
00045  *
00046  *  The number of entries in the argument list shall be decremented.
00047  *
00048  *  @return bool:       True if the argnum is in the argument list, otherwise false.
00049  */
00050 bool psArgumentRemove(
00051     int argnum,                        ///< the argument to remove
00052     int *argc,                         ///< number of arguments
00053     char **argv                        ///< the argument list
00054 );
00055 
00056 /** Parses the command line arguments into a metadata container of arguments.
00057  *
00058  *  The input arguments shall contain the list of possible arguments as the keywords providing
00059  *  the default values.  As matching arguments are found on the command line, the values shall be
00060  *  read into the arguments metadata, with the appropriate type.  The arguments and their values
00061  *  shall be removed from the list of command line arguments as they are processed.
00062  *
00063  *  @return bool:       False if any argument was encountered that is not present in arguments.
00064  */
00065 bool psArgumentParse(
00066     psMetadata *arguments,             ///< metadata container for arguments
00067     int *argc,                         ///< number of arguments
00068     char **argv                        ///< the argument list
00069 );
00070 
00071 /** Prints to stdout a guide to the command-line arguments.      */
00072 void psArgumentHelp(
00073     psMetadata *arguments              ///< metadata container for arguments
00074 );
00075 
00076 /** Sets the log level.
00077  *
00078  *  @return psS32:     the log level.
00079  */
00080 psS32 psLogArguments(
00081     int *argc,                         ///< number of arguments
00082     char **argv                        ///< the argument list
00083 );
00084 
00085 /** Sets trace levels by facility
00086  *
00087  *  @return psS32:      1 (true) if successful or else 2.
00088  */
00089 psS32 psTraceArguments(
00090     int *argc,                         ///< number of arguments
00091     char **argv                        ///< the argument list
00092 );
00093 
00094 
00095 /// @}
00096 
00097 #endif // #ifndef PS_ARGUMENTS_H

Generated on Mon Jul 3 14:13:44 2006 for Pan-STARRS Foundation Library by  doxygen 1.4.4