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

COpt Interface Reference

COpt class operates the information for command line options. More...

#import <copt.h>

List of all members.

Public Member Functions

(id) initOptNoArg:longName:optDesc:
 Initialize COpt instance for no arg option.

(id) initOptHasStr:longName:optDesc:argDesc:
 Initialize COpt instance which has string argument.

(id) initOptHasNum:longName:optDesc:argDesc:
 Initialize COpt instance which has number argument.

(void) dealloc
 Release resource for the object.

(int) optId
 Get option id.

(void) setGivenFlag:
 Set "is_given" flag in object.

(BOOL) isGiven
 Return true when this option is found in command line.

(NSString *) longName
 Get long name of the option.

(char) shortName
 Get short name of the option.

(COptArgTypeargType
 Get type of argument which is required by this option.

(void) setStrArg:
 Set string as an argument.

(NSString *) strArg
 Get argument of string option.

(void) setIntArg:
 Set integer as an argument.

(int) intArg
 Get argument of integer option.

(NSString *) optDescription
 Get descriotion string for option.

(NSString *) stringForOptionsForHelpMessage
 Make help message used for left section.

(void) print:
 Print the content of option data.


Protected Attributes

uint_t opt_id
BOOL is_given
NSString * long_name
char short_name
COptArgType arg_type
union {
   NSString *   str_arg
   int   int_arg
arg_data
NSString * opt_desc
NSString * arg_desc


Detailed Description

COpt class operates the information for command line options.

Description
COpt class operates the information for command line options.


Member Function Documentation

- (COptArgType) COpt:
 

Get type of argument which is required by this option.

Returns:
Type of argument.
Description
Get type of argument which is required by this option.

- (void) COpt:
 

Release resource for the object.

Description
Release resource for the object.

- (id) COpt: (id) 
(char) 
(id)  sname
longName: (id) 
(const char *) 
(id)  lname
optDesc: (id) 
(const char *) 
(id)  odesc
argDesc: (id) 
(const char *) 
(id)  adesc
 

Initialize COpt instance which has number argument.

Returns:
The object itself.
Parameters:
sname Short name (character).
lname Long name (string).
odesc Description for option.
adesc Description for argument.
Description
Initialize COpt instance which has number argument.

- (id) COpt: (id) 
(char) 
(id)  sname
longName: (id) 
(const char *) 
(id)  lname
optDesc: (id) 
(const char *) 
(id)  odesc
argDesc: (id) 
(const char *) 
(id)  adesc
 

Initialize COpt instance which has string argument.

Returns:
The object itself.
Parameters:
sname Short name (character).
lname Long name (string).
odesc Description for option.
adesc Description for argument.
Description
Initialize COpt instance which has string argument.

- (id) COpt: (id) 
(char) 
(id)  sname
longName: (id) 
(const char *) 
(id)  lname
optDesc: (id) 
(const char *) 
(id)  odesc
 

Initialize COpt instance for no arg option.

Returns:
The object itself.
Parameters:
sname Short name (character).
lname Long name (string).
odesc Description for option.
Description
Initialize COpt instance for no arg option.

- (int) COpt:
 

Get argument of integer option.

Description
Get argument of integer option. If this object does not allow to have integer argument. This method caused error.

- (BOOL) COpt:
 

Return true when this option is found in command line.

Returns:
True when this option is found in command line.
Description
True when this option is found in command line.

- (NSString *) COpt:
 

Get long name of the option.

Returns:
Long name string. If the long name is not set, this value will be nil.
Description
Get long name of the option.

- (NSString *) COpt:
 

Get descriotion string for option.

Returns:
Description string.
Description
Get descriotion string for option.

- (int) COpt:
 

Get option id.

Returns:
Option id.
Description
Get option id. The value is given automatically.

- (void) COpt: (id) 
(FILE *) 
(id)  outfp
 

Print the content of option data.

Parameters:
outfp Output stream.
Description
Print the content of option data.

- (void) COpt: (id) 
(BOOL) 
(id)  flag
 

Set "is_given" flag in object.

Parameters:
flag New value for the flag.
Description
Set "is_given" flag in object.

- (void) COpt: (id) 
(int) 
(id)  src
 

Set integer as an argument.

Parameters:
src Source value.
Description
Set value of integer argument.

- (void) COpt: (id) 
(NSString *) 
(id)  src
 

Set string as an argument.

Parameters:
src Source string.
Description
Set string as an argument.

- (char) COpt:
 

Get short name of the option.

Returns:
Short name string. If the short name is not set, this value will be 0.
Description
Get short name of the option.

- (NSString *) COpt:
 

Get argument of string option.

Returns:
String argument.
Description
Get argument of string option. If this object does not allow to have string argument. This method caused error.

- (NSString *) COpt:
 

Make help message used for left section.

Returns:
Left section of help message.
Description
Make help message used for left section. It contains short name and long name.


Member Data Documentation

union { ... } COpt::arg_data [protected]
 

Content of argument

NSString* COpt::arg_desc [protected]
 

Description for the argument (used by help option)

COptArgType COpt::arg_type [protected]
 

Type of argument

int COpt::int_arg [protected]
 

Integer to keep int arg option

BOOL COpt::is_given [protected]
 

is_given Flag means the option is given or not.

NSString* COpt::long_name [protected]
 

Long option name which started by '--'

NSString* COpt::opt_desc [protected]
 

Description for the option (used by help option)

uint_t COpt::opt_id [protected]
 

Option ID

char COpt::short_name [protected]
 

Short option name which started by '-'

NSString* COpt::str_arg [protected]
 

String to keep str arg 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