COptPsr Class Reference

COptPsr class parses command line options and arguments. More...

#import <coptpsr.h>

List of all members.

Public Member Functions

(id) - init
 Initialize instance of COptPsr class.
(void) - dealloc
 Release resource for the object.
(NSString *) - appName
 Get application name.
(void) - addOpt:
 Add option to parser.
(void) - addHelpOpt
 Add '--help' option to parser.
(void) - addUsageOpt
 Add '--usage' option to parser.
(uint_t) - optNum
 Get number of options.
(BOOL) - parse:and:withErrorMessage:
 Start parsing the command line.
(CList *) - argList
 Get list of arguments of command line.

Protected Attributes

CListopt_list
CListarg_list
NSString * app_name
COptopt_help
COptopt_usage


Detailed Description

COptPsr class parses command line options and arguments.

Description
COptPst class parses command line options and arguments.


Member Function Documentation

- (void) addHelpOpt  
 

Add '--help' option to parser.

Description
Add '--help' option to parser.

- (void) addOpt: (COpt *)  opt  
 

Add option to parser.

Parameters:
opt Source option to add.
Description
Add option to parser.

- (void) addUsageOpt  
 

Add '--usage' option to parser.

Description
Add '--usage' option to parser.

- (NSString *) appName  
 

Get application name.

Returns:
Name of application
Description
Get application name.
Warning:
This result will be valid after calling parse() method.

- (CList *) argList  
 

Get list of arguments of command line.

Returns:
List of arguments. It contains CString data. This pointer will NOT be nil.
Description
Get list of arguments of command line. The data class is CSting.

- (void) dealloc  
 

Release resource for the object.

Description
Release resource for the object.

- (id) init  
 

Initialize instance of COptPsr class.

Returns:
The object itself.
Description
Initialize instance of COptPsr class.

- (uint_t) optNum  
 

Get number of options.

Returns:
Number of options in the parser.
Description
Get number of options.

- (BOOL) parse: (int)  argc
and: (const char **)  argv
withErrorMessage: (BOOL)  withmsg
 
 

Start parsing the command line.

Return values:
true Parsing finished without error.
false Some error found in command line.
Parameters:
argc Number of arguments.
argv Array of argument strings.
withmsg If this value is true, error messages are printed.
Description
Start parsing the command line.


Member Data Documentation

- (NSString*) app_name [protected]
 

Name of application. It is given after parse() method

- (CList*) arg_list [protected]
 

List of arguments. This is result of parsing.

- (COpt*) opt_help [protected]
 

"help" option

- (CList*) opt_list [protected]
 

List of options given by addOpt() method

- (COpt*) opt_usage [protected]
 

"usage" option


The documentation for this class was generated from the following file:
Generated on Mon Mar 20 18:45:20 2006 for Coconut by  doxygen 1.4.6