Main Page | Class List | File List | Class Members | File Members

COptPsr Interface 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) COptPsr:
 

Add '--help' option to parser.

Description
Add '--help' option to parser.

- (void) COptPsr: (id) 
(COpt *) 
(id)  opt
 

Add option to parser.

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

- (void) COptPsr:
 

Add '--usage' option to parser.

Description
Add '--usage' option to parser.

- (NSString *) COptPsr:
 

Get application name.

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

- (CList *) COptPsr:
 

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) COptPsr:
 

Release resource for the object.

Description
Release resource for the object.

- (id) COptPsr:
 

Initialize instance of COptPsr class.

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

- (uint_t) COptPsr:
 

Get number of options.

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

- (BOOL) COptPsr: (id) 
(int) 
(id)  argc
and: (id) 
(const char **) 
(id)  argv
withErrorMessage: (id) 
(BOOL) 
(id)  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* COptPsr::app_name [protected]
 

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

CList* COptPsr::arg_list [protected]
 

List of arguments. This is result of parsing.

COpt* COptPsr::opt_help [protected]
 

"help" option

CList* COptPsr::opt_list [protected]
 

List of options given by addOpt() method

COpt* COptPsr::opt_usage [protected]
 

"usage" option


The documentation for this interface was generated from the following file:
Generated on Wed Jul 14 18:34:59 2004 for Coconut by doxygen 1.3.6