FFSM++ 1.1.0
French Forest Sector Model ++
Loading...
Searching...
No Matches
AnyOption Class Reference

#include <anyoption.h>

Public Member Functions

 AnyOption ()
 
 AnyOption (int maxoptions)
 
 AnyOption (int maxoptions, int maxcharoptions)
 
 ~AnyOption ()
 
void setCommandPrefixChar (char _prefix)
 
void setCommandLongPrefix (char *_prefix)
 
void setFileCommentChar (char _comment)
 
void setFileDelimiterChar (char _delimiter)
 
void useCommandArgs (int _argc, char **_argv)
 
void useFiileName (const char *_filename)
 
void noPOSIX ()
 
void setVerbose ()
 
void setOption (const char *opt_string)
 
void setOption (char opt_char)
 
void setOption (const char *opt_string, char opt_char)
 
void setFlag (const char *opt_string)
 
void setFlag (char opt_char)
 
void setFlag (const char *opt_string, char opt_char)
 
void setCommandOption (const char *opt_string)
 
void setCommandOption (char opt_char)
 
void setCommandOption (const char *opt_string, char opt_char)
 
void setCommandFlag (const char *opt_string)
 
void setCommandFlag (char opt_char)
 
void setCommandFlag (const char *opt_string, char opt_char)
 
void setFileOption (const char *opt_string)
 
void setFileOption (char opt_char)
 
void setFileOption (const char *opt_string, char opt_char)
 
void setFileFlag (const char *opt_string)
 
void setFileFlag (char opt_char)
 
void setFileFlag (const char *opt_string, char opt_char)
 
void processOptions ()
 
void processCommandArgs ()
 
void processCommandArgs (int max_args)
 
bool processFile ()
 
void processCommandArgs (int _argc, char **_argv)
 
void processCommandArgs (int _argc, char **_argv, int max_args)
 
bool processFile (const char *_filename)
 
char * getValue (const char *_option)
 
bool getFlag (const char *_option)
 
char * getValue (char _optchar)
 
bool getFlag (char _optchar)
 
void printUsage ()
 
void printAutoUsage ()
 
void addUsage (const char *line)
 
void printHelp ()
 
void autoUsagePrint (bool flag)
 
int getArgc ()
 
char * getArgv (int index)
 
bool hasOptions ()
 

Private Member Functions

void init ()
 
void init (int maxopt, int maxcharopt)
 
bool alloc ()
 
void cleanup ()
 
bool valueStoreOK ()
 
bool doubleOptStorage ()
 
bool doubleCharStorage ()
 
bool doubleUsageStorage ()
 
bool setValue (const char *option, char *value)
 
bool setFlagOn (const char *option)
 
bool setValue (char optchar, char *value)
 
bool setFlagOn (char optchar)
 
void addOption (const char *option, int type)
 
void addOption (char optchar, int type)
 
void addOptionError (const char *opt)
 
void addOptionError (char opt)
 
bool findFlag (char *value)
 
void addUsageError (const char *line)
 
bool CommandSet ()
 
bool FileSet ()
 
bool POSIX ()
 
char parsePOSIX (char *arg)
 
int parseGNU (char *arg)
 
bool matchChar (char c)
 
int matchOpt (char *opt)
 
char * readFile ()
 
char * readFile (const char *fname)
 
bool consumeFile (char *buffer)
 
void processLine (char *theline, int length)
 
char * chomp (char *str)
 
void valuePairs (char *type, char *value)
 
void justValue (char *value)
 
void printVerbose (const char *msg)
 
void printVerbose (char *msg)
 
void printVerbose (char ch)
 
void printVerbose ()
 

Private Attributes

int argc
 
char ** argv
 
const char * filename
 
char * appname
 
int * new_argv
 
int new_argc
 
int max_legal_args
 
int max_options
 
const char ** options
 
int * optiontype
 
int * optionindex
 
int option_counter
 
int max_char_options
 
char * optionchars
 
int * optchartype
 
int * optcharindex
 
int optchar_counter
 
char ** values
 
int g_value_counter
 
const char ** usage
 
int max_usage_lines
 
int usage_lines
 
bool command_set
 
bool file_set
 
bool mem_allocated
 
bool posix_style
 
bool verbose
 
bool print_usage
 
bool print_help
 
char opt_prefix_char
 
char long_opt_prefix [MAX_LONG_PREFIX_LENGTH+1]
 
char file_delimiter_char
 
char file_comment_char
 
char equalsign
 
char comment
 
char delimiter
 
char endofline
 
char whitespace
 
char nullterminate
 
bool set
 
bool once
 
bool hasoptions
 
bool autousage
 

Detailed Description

Definition at line 32 of file anyoption.h.

Constructor & Destructor Documentation

◆ AnyOption() [1/3]

AnyOption ( )

Definition at line 65 of file anyoption.cpp.

66{
67 init();
68}
void init()
Definition anyoption.cpp:87
Here is the call graph for this function:

◆ AnyOption() [2/3]

AnyOption ( int  maxoptions)

Definition at line 70 of file anyoption.cpp.

71{
72 init( maxopt , maxopt );
73}
Here is the call graph for this function:

◆ AnyOption() [3/3]

AnyOption ( int  maxoptions,
int  maxcharoptions 
)

Definition at line 75 of file anyoption.cpp.

76{
77 init( maxopt , maxcharopt );
78}
Here is the call graph for this function:

◆ ~AnyOption()

~AnyOption ( )

Definition at line 80 of file anyoption.cpp.

81{
82 if( mem_allocated )
83 cleanup();
84}
bool mem_allocated
Definition anyoption.h:198
void cleanup()
Here is the call graph for this function:

Member Function Documentation

◆ addOption() [1/2]

void addOption ( char  optchar,
int  type 
)
private

Definition at line 536 of file anyoption.cpp.

537{
538 if( !POSIX() ){
539 printVerbose("Ignoring the option character \"");
540 printVerbose( opt );
541 printVerbose( "\" ( POSIX options are turned off )" );
542 printVerbose();
543 return;
544 }
545
546
548 if( doubleCharStorage() == false ){
549 addOptionError( opt );
550 return;
551 }
552 }
554 optchartype[ optchar_counter ] = type ;
557}
int max_char_options
Definition anyoption.h:181
bool doubleCharStorage()
bool POSIX()
int optchar_counter
Definition anyoption.h:185
int * optchartype
Definition anyoption.h:183
int g_value_counter
Definition anyoption.h:189
char * optionchars
Definition anyoption.h:182
int * optcharindex
Definition anyoption.h:184
void addOptionError(const char *opt)
void printVerbose()
Here is the call graph for this function:

◆ addOption() [2/2]

void addOption ( const char *  option,
int  type 
)
private

Definition at line 521 of file anyoption.cpp.

522{
524 if( doubleOptStorage() == false ){
525 addOptionError( opt );
526 return;
527 }
528 }
529 options[ option_counter ] = opt ;
530 optiontype[ option_counter ] = type ;
533}
int * optionindex
Definition anyoption.h:177
int max_options
Definition anyoption.h:174
int option_counter
Definition anyoption.h:178
int * optiontype
Definition anyoption.h:176
bool doubleOptStorage()
const char ** options
Definition anyoption.h:175

Referenced by setCommandFlag(), setCommandFlag(), setCommandFlag(), setCommandOption(), setCommandOption(), setCommandOption(), setFileFlag(), setFileFlag(), setFileFlag(), setFileOption(), setFileOption(), setFileOption(), setFlag(), setFlag(), setFlag(), setOption(), setOption(), and setOption().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addOptionError() [1/2]

void addOptionError ( char  opt)
private

Definition at line 571 of file anyoption.cpp.

572{
573 cout << endl ;
574 cout << "OPTIONS ERROR : Failed allocating extra memory " << endl ;
575 cout << "While adding the option: \""<< opt << "\"" << endl;
576 cout << "Exiting." << endl ;
577 cout << endl ;
578 exit(0);
579}

◆ addOptionError() [2/2]

void addOptionError ( const char *  opt)
private

Definition at line 560 of file anyoption.cpp.

561{
562 cout << endl ;
563 cout << "OPTIONS ERROR : Failed allocating extra memory " << endl ;
564 cout << "While adding the option : \""<< opt << "\"" << endl;
565 cout << "Exiting." << endl ;
566 cout << endl ;
567 exit(0);
568}

Referenced by addOption(), and addOption().

Here is the caller graph for this function:

◆ addUsage()

void addUsage ( const char *  line)

Definition at line 1153 of file anyoption.cpp.

1154{
1156 if( doubleUsageStorage() == false ){
1157 addUsageError( line );
1158 exit(1);
1159 }
1160 }
1161 usage[ usage_lines ] = line ;
1162 usage_lines++;
1163}
void addUsageError(const char *line)
int max_usage_lines
Definition anyoption.h:193
const char ** usage
Definition anyoption.h:192
int usage_lines
Definition anyoption.h:194
bool doubleUsageStorage()

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addUsageError()

void addUsageError ( const char *  line)
private

Definition at line 1166 of file anyoption.cpp.

1167{
1168 cout << endl ;
1169 cout << "OPTIONS ERROR : Failed allocating extra memory " << endl ;
1170 cout << "While adding the usage/help : \""<< line << "\"" << endl;
1171 cout << "Exiting." << endl ;
1172 cout << endl ;
1173 exit(0);
1174
1175}

Referenced by addUsage().

Here is the caller graph for this function:

◆ alloc()

bool alloc ( )
private

Definition at line 143 of file anyoption.cpp.

144{
145 int i = 0 ;
146 int size = 0 ;
147
148 if( mem_allocated )
149 return true;
150
151 size = (max_options+1) * sizeof(const char*);
152 options = (const char**)malloc( size );
153 optiontype = (int*) malloc( (max_options+1)*sizeof(int) );
154 optionindex = (int*) malloc( (max_options+1)*sizeof(int) );
155 if( options == NULL || optiontype == NULL || optionindex == NULL )
156 return false;
157 else
158 mem_allocated = true;
159 for( i = 0 ; i < max_options ; i++ ){
160 options[i] = NULL;
161 optiontype[i] = 0 ;
162 optionindex[i] = -1 ;
163 }
164 optionchars = (char*) malloc( (max_char_options+1)*sizeof(char) );
165 optchartype = (int*) malloc( (max_char_options+1)*sizeof(int) );
166 optcharindex = (int*) malloc( (max_char_options+1)*sizeof(int) );
167 if( optionchars == NULL ||
168 optchartype == NULL ||
169 optcharindex == NULL )
170 {
171 mem_allocated = false;
172 return false;
173 }
174 for( i = 0 ; i < max_char_options ; i++ ){
175 optionchars[i] = '0';
176 optchartype[i] = 0 ;
177 optcharindex[i] = -1 ;
178 }
179
180 size = (max_usage_lines+1) * sizeof(const char*) ;
181 usage = (const char**) malloc( size );
182
183 if( usage == NULL ){
184 mem_allocated = false;
185 return false;
186 }
187 for( i = 0 ; i < max_usage_lines ; i++ )
188 usage[i] = NULL;
189
190 return true;
191}

Referenced by init().

Here is the caller graph for this function:

◆ autoUsagePrint()

void autoUsagePrint ( bool  flag)

Definition at line 362 of file anyoption.cpp.

363{
364 autousage = _autousage;
365}
bool autousage
Definition anyoption.h:219

◆ chomp()

char * chomp ( char *  str)
private

Definition at line 1053 of file anyoption.cpp.

1054{
1055 while( *str == whitespace )
1056 str++;
1057 char *end = str+strlen(str)-1;
1058 while( *end == whitespace )
1059 end--;
1060 *(end+1) = nullterminate;
1061 return str;
1062}
char whitespace
Definition anyoption.h:212
char nullterminate
Definition anyoption.h:213

Referenced by justValue(), and valuePairs().

Here is the caller graph for this function:

◆ cleanup()

void cleanup ( )
private

Definition at line 253 of file anyoption.cpp.

254{
255 free (options);
256 free (optiontype);
257 free (optionindex);
258 free (optionchars);
259 free (optchartype);
260 free (optcharindex);
261 free (usage);
262 if( values != NULL )
263 free (values);
264 if( new_argv != NULL )
265 free (new_argv);
266}
int * new_argv
Definition anyoption.h:168
char ** values
Definition anyoption.h:188

Referenced by ~AnyOption().

Here is the caller graph for this function:

◆ CommandSet()

bool CommandSet ( )
private

Definition at line 298 of file anyoption.cpp.

299{
300 return( command_set );
301}
bool command_set
Definition anyoption.h:196

Referenced by processCommandArgs().

Here is the caller graph for this function:

◆ consumeFile()

bool consumeFile ( char *  buffer)
private

Definition at line 971 of file anyoption.cpp.

972{
973
974 if( buffer == NULL )
975 return false;
976
977 char *cursor = buffer;/* preserve the ptr */
978 char *pline = NULL ;
979 int linelength = 0;
980 bool newline = true;
981 for( unsigned int i = 0 ; i < strlen( buffer ) ; i++ ){
982 if( *cursor == endofline ) { /* end of line */
983 if( pline != NULL ) /* valid line */
984 processLine( pline, linelength );
985 pline = NULL;
986 newline = true;
987 }else if( newline ){ /* start of line */
988 newline = false;
989 if( (*cursor != comment ) ){ /* not a comment */
990 pline = cursor ;
991 linelength = 0 ;
992 }
993 }
994 cursor++; /* keep moving */
995 linelength++;
996 }
997 free (buffer);
998 return true;
999}
void processLine(char *theline, int length)
char comment
Definition anyoption.h:209
char endofline
Definition anyoption.h:211

Referenced by processFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doubleCharStorage()

bool doubleCharStorage ( )
private

Definition at line 215 of file anyoption.cpp.

216{
217 optionchars = (char*) realloc( optionchars,
218 ((2*max_char_options)+1)*sizeof(char) );
219 optchartype = (int*) realloc( optchartype,
220 ((2*max_char_options)+1)*sizeof(int) );
221 optcharindex = (int*) realloc( optcharindex,
222 ((2*max_char_options)+1)*sizeof(int) );
223 if( optionchars == NULL ||
224 optchartype == NULL ||
225 optcharindex == NULL )
226 return false;
227 /* init new storage */
228 for( int i = max_char_options ; i < 2*max_char_options ; i++ ){
229 optionchars[i] = '0';
230 optchartype[i] = 0 ;
231 optcharindex[i] = -1 ;
232 }
234 return true;
235}

Referenced by addOption().

Here is the caller graph for this function:

◆ doubleOptStorage()

bool doubleOptStorage ( )
private

Definition at line 194 of file anyoption.cpp.

195{
196 options = (const char**)realloc( options,
197 ((2*max_options)+1) * sizeof( const char*) );
198 optiontype = (int*) realloc( optiontype ,
199 ((2 * max_options)+1)* sizeof(int) );
200 optionindex = (int*) realloc( optionindex,
201 ((2 * max_options)+1) * sizeof(int) );
202 if( options == NULL || optiontype == NULL || optionindex == NULL )
203 return false;
204 /* init new storage */
205 for( int i = max_options ; i < 2*max_options ; i++ ){
206 options[i] = NULL;
207 optiontype[i] = 0 ;
208 optionindex[i] = -1 ;
209 }
211 return true;
212}

Referenced by addOption().

Here is the caller graph for this function:

◆ doubleUsageStorage()

bool doubleUsageStorage ( )
private

Definition at line 238 of file anyoption.cpp.

239{
240 usage = (const char**)realloc( usage,
241 ((2*max_usage_lines)+1) * sizeof( const char*) );
242 if ( usage == NULL )
243 return false;
244 for( int i = max_usage_lines ; i < 2*max_usage_lines ; i++ )
245 usage[i] = NULL;
247 return true;
248
249}

Referenced by addUsage().

Here is the caller graph for this function:

◆ FileSet()

bool FileSet ( )
private

Definition at line 304 of file anyoption.cpp.

305{
306 return( file_set );
307}
bool file_set
Definition anyoption.h:197

Referenced by processFile().

Here is the caller graph for this function:

◆ findFlag()

bool findFlag ( char *  value)
private

Definition at line 829 of file anyoption.cpp.

830{
831 if( val == NULL )
832 return false;
833
834 if( strcmp( TRUE_FLAG , val ) == 0 )
835 return true;
836
837 return false;
838}
#define TRUE_FLAG
Definition anyoption.h:28

Referenced by getFlag(), and getFlag().

Here is the caller graph for this function:

◆ getArgc()

int getArgc ( )

Definition at line 905 of file anyoption.cpp.

906{
907 return new_argc;
908}
int new_argc
Definition anyoption.h:169

Referenced by main().

Here is the caller graph for this function:

◆ getArgv()

char * getArgv ( int  index)

Definition at line 911 of file anyoption.cpp.

912{
913 if( index < new_argc ){
914 return ( argv[ new_argv[ index ] ] );
915 }
916 return NULL;
917}
char ** argv
Definition anyoption.h:164

◆ getFlag() [1/2]

bool getFlag ( char  _optchar)

Definition at line 817 of file anyoption.cpp.

818{
819 if( !valueStoreOK() )
820 return false;
821 for( int i = 0 ; i < optchar_counter ; i++ ){
822 if( optionchars[i] == option )
823 return findFlag( values[ optcharindex[i] ] ) ;
824 }
825 return false;
826}
bool valueStoreOK()
bool findFlag(char *value)
Here is the call graph for this function:

◆ getFlag() [2/2]

bool getFlag ( const char *  _option)

Definition at line 793 of file anyoption.cpp.

794{
795 if( !valueStoreOK() )
796 return false;
797 for( int i = 0 ; i < option_counter ; i++ ){
798 if( strcmp( options[i], option ) == 0 )
799 return findFlag( values[ optionindex[i] ] );
800 }
801 return false;
802}

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getValue() [1/2]

char * getValue ( char  _optchar)

Definition at line 805 of file anyoption.cpp.

806{
807 if( !valueStoreOK() )
808 return NULL;
809 for( int i = 0 ; i < optchar_counter ; i++ ){
810 if( optionchars[i] == option )
811 return values[ optcharindex[i] ];
812 }
813 return NULL;
814}
Here is the call graph for this function:

◆ getValue() [2/2]

char * getValue ( const char *  _option)

Definition at line 780 of file anyoption.cpp.

781{
782 if( !valueStoreOK() )
783 return NULL;
784
785 for( int i = 0 ; i < option_counter ; i++ ){
786 if( strcmp( options[i], option ) == 0 )
787 return values[ optionindex[i] ];
788 }
789 return NULL;
790}

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasOptions()

bool hasOptions ( )

Definition at line 356 of file anyoption.cpp.

357{
358 return hasoptions;
359}
bool hasoptions
Definition anyoption.h:218

◆ init() [1/2]

void init ( )
private

Definition at line 87 of file anyoption.cpp.

88{
90}
#define DEFAULT_MAXOPTS
Definition anyoption.h:22

Referenced by AnyOption(), AnyOption(), AnyOption(), and init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init() [2/2]

void init ( int  maxopt,
int  maxcharopt 
)
private

Definition at line 93 of file anyoption.cpp.

94{
95
96 max_options = maxopt;
97 max_char_options = maxcharopt;
99 usage_lines = 0 ;
100 argc = 0;
101 argv = NULL;
102 posix_style = true;
103 verbose = false;
104 filename = NULL;
105 appname = NULL;
106 option_counter = 0;
107 optchar_counter = 0;
108 new_argv = NULL;
109 new_argc = 0 ;
110 max_legal_args = 0 ;
111 command_set = false;
112 file_set = false;
113 values = NULL;
114 g_value_counter = 0;
115 mem_allocated = false;
116 command_set = false;
117 file_set = false;
118 opt_prefix_char = '-';
120 file_comment_char = '#';
121 equalsign = '=';
122 comment = '#' ;
123 delimiter = ':' ;
124 endofline = '\n';
125 whitespace = ' ' ;
126 nullterminate = '\0';
127 set = false;
128 once = true;
129 hasoptions = false;
130 autousage = false;
131
132 strcpy( long_opt_prefix , "--" );
133
134 if( alloc() == false ){
135 cout << endl << "OPTIONS ERROR : Failed allocating memory" ;
136 cout << endl ;
137 cout << "Exiting." << endl ;
138 exit (0);
139 }
140}
#define DEFAULT_MAXUSAGE
Definition anyoption.h:25
char file_delimiter_char
Definition anyoption.h:206
char opt_prefix_char
Definition anyoption.h:204
char delimiter
Definition anyoption.h:210
bool posix_style
Definition anyoption.h:199
int max_legal_args
Definition anyoption.h:170
const char * filename
Definition anyoption.h:165
char equalsign
Definition anyoption.h:208
bool alloc()
char * appname
Definition anyoption.h:166
bool verbose
Definition anyoption.h:200
char file_comment_char
Definition anyoption.h:207
bool once
Definition anyoption.h:216
char long_opt_prefix[MAX_LONG_PREFIX_LENGTH+1]
Definition anyoption.h:205
Here is the call graph for this function:

◆ justValue()

void justValue ( char *  value)
private

Definition at line 1096 of file anyoption.cpp.

1097{
1098
1099 if ( strlen(chomp(type)) == 1 ){ /* this is a char option */
1100 for( int i = 0 ; i < optchar_counter ; i++ ){
1101 if( optionchars[i] == type[0] ){ /* match */
1102 if( optchartype[i] == COMMON_FLAG ||
1103 optchartype[i] == FILE_FLAG )
1104 {
1105 setFlagOn( type[0] );
1106 return;
1107 }
1108 }
1109 }
1110 }
1111 /* if no char options matched */
1112 for( int i = 0 ; i < option_counter ; i++ ){
1113 if( strcmp( options[i], type ) == 0 ){ /* match */
1114 if( optiontype[i] == COMMON_FLAG ||
1115 optiontype[i] == FILE_FLAG )
1116 {
1117 setFlagOn( type );
1118 return;
1119 }
1120 }
1121 }
1122 printVerbose( "Unknown option in resourcefile : " );
1123 printVerbose( type );
1124 printVerbose( );
1125}
#define COMMON_FLAG
Definition anyoption.h:12
#define FILE_FLAG
Definition anyoption.h:14
char * chomp(char *str)
bool setFlagOn(const char *option)

Referenced by processLine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ matchChar()

bool matchChar ( char  c)
private

Definition at line 738 of file anyoption.cpp.

739{
740 for( int i = 0 ; i < optchar_counter ; i++ ){
741 if( optionchars[i] == c ) { /* found match */
742 if(optchartype[i] == COMMON_OPT ||
744 { /* an option store and stop scanning */
745 return true;
746 }else if( optchartype[i] == COMMON_FLAG ||
747 optchartype[i] == COMMAND_FLAG ) { /* a flag store and keep scanning */
748 setFlagOn( c );
749 return false;
750 }
751 }
752 }
753 printVerbose( "Unknown command argument option : " );
754 printVerbose( c ) ;
755 printVerbose( );
757 return false;
758}
#define COMMAND_OPT
Definition anyoption.h:10
#define COMMAND_FLAG
Definition anyoption.h:13
#define COMMON_OPT
Definition anyoption.h:9
void printAutoUsage()

Referenced by parsePOSIX().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ matchOpt()

int matchOpt ( char *  opt)
private

Definition at line 715 of file anyoption.cpp.

716{
717 for( int i = 0 ; i < option_counter ; i++ ){
718 if( strcmp( options[i], opt ) == 0 ){
719 if( optiontype[i] == COMMON_OPT ||
720 optiontype[i] == COMMAND_OPT )
721 { /* found option return index */
722 return i;
723 }else if( optiontype[i] == COMMON_FLAG ||
725 { /* found flag, set it */
726 setFlagOn( opt );
727 return -1;
728 }
729 }
730 }
731 printVerbose( "Unknown command argument option : " );
732 printVerbose( opt ) ;
733 printVerbose( );
735 return -1;
736}

Referenced by parseGNU().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ noPOSIX()

void noPOSIX ( )

Definition at line 310 of file anyoption.cpp.

311{
312 posix_style = false;
313}

◆ parseGNU()

int parseGNU ( char *  arg)
private

Definition at line 680 of file anyoption.cpp.

681{
682 int split_at = 0;
683 /* if has a '=' sign get value */
684 for( unsigned int i = 0 ; i < strlen(arg) ; i++ ){
685 if(arg[i] == equalsign ){
686 split_at = i ; /* store index */
687 i = strlen(arg); /* get out of loop */
688 }
689 }
690 if( split_at > 0 ){ /* it is an option value pair */
691 char* tmp = (char*) malloc( (split_at+1)*sizeof(char) );
692 for( int i = 0 ; i < split_at ; i++ )
693 tmp[i] = arg[i];
694 tmp[split_at] = '\0';
695
696 if ( matchOpt( tmp ) >= 0 ){
697 setValue( options[matchOpt(tmp)] , arg+split_at+1 );
698 free (tmp);
699 }else{
700 printVerbose( "Unknown command argument option : " );
701 printVerbose( arg );
702 printVerbose( );
704 free (tmp);
705 return -1;
706 }
707 }else{ /* regular options with no '=' sign */
708 return matchOpt(arg);
709 }
710 return -1;
711}
bool setValue(const char *option, char *value)
int matchOpt(char *opt)

Referenced by processCommandArgs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parsePOSIX()

char parsePOSIX ( char *  arg)
private

Definition at line 653 of file anyoption.cpp.

654{
655
656 for( unsigned int i = 0 ; i < strlen(arg) ; i++ ){
657 char ch = arg[i] ;
658 if( matchChar(ch) ) { /* keep matching flags till an option */
659 /*if last char argv[++i] is the value */
660 if( i == strlen(arg)-1 ){
661 return ch;
662 }else{/* else the rest of arg is the value */
663 i++; /* skip any '=' and ' ' */
664 while( arg[i] == whitespace
665 || arg[i] == equalsign )
666 i++;
667 setValue( ch , arg+i );
668 return '0';
669 }
670 }
671 }
672 printVerbose( "Unknown command argument option : " );
673 printVerbose( arg );
674 printVerbose( );
676 return '0';
677}
bool matchChar(char c)

Referenced by processCommandArgs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ POSIX()

bool POSIX ( )
private

Definition at line 316 of file anyoption.cpp.

317{
318 return posix_style;
319}

Referenced by addOption(), and processCommandArgs().

Here is the caller graph for this function:

◆ printAutoUsage()

void printAutoUsage ( )

Definition at line 1133 of file anyoption.cpp.

1134{
1135 if( autousage ) printUsage();
1136}
void printUsage()

Referenced by matchChar(), matchOpt(), parseGNU(), parsePOSIX(), and processCommandArgs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printHelp()

void printHelp ( )

◆ printUsage()

void printUsage ( )

Definition at line 1139 of file anyoption.cpp.

1140{
1141
1142 if( once ) {
1143 once = false ;
1144 cout << endl ;
1145 for( int i = 0 ; i < usage_lines ; i++ )
1146 cout << usage[i] << endl ;
1147 cout << endl ;
1148 }
1149}

Referenced by main(), and printAutoUsage().

Here is the caller graph for this function:

◆ printVerbose() [1/4]

void printVerbose ( )
private

Definition at line 329 of file anyoption.cpp.

330{
331 if( verbose )
332 cout << endl ;
333}

Referenced by addOption(), justValue(), matchChar(), matchOpt(), parseGNU(), parsePOSIX(), processCommandArgs(), and valuePairs().

Here is the caller graph for this function:

◆ printVerbose() [2/4]

void printVerbose ( char *  msg)
private

Definition at line 342 of file anyoption.cpp.

343{
344 if( verbose )
345 cout << msg ;
346}

◆ printVerbose() [3/4]

void printVerbose ( char  ch)
private

Definition at line 349 of file anyoption.cpp.

350{
351 if( verbose )
352 cout << ch ;
353}

◆ printVerbose() [4/4]

void printVerbose ( const char *  msg)
private

Definition at line 335 of file anyoption.cpp.

336{
337 if( verbose )
338 cout << msg ;
339}

◆ processCommandArgs() [1/4]

void processCommandArgs ( )

Definition at line 610 of file anyoption.cpp.

611{
612 if( ! ( valueStoreOK() && CommandSet() ) )
613 return;
614
615 if( max_legal_args == 0 )
617 new_argv = (int*) malloc( (max_legal_args+1) * sizeof(int) );
618 for( int i = 1 ; i < argc ; i++ ){/* ignore first argv */
619 if( argv[i][0] == long_opt_prefix[0] &&
620 argv[i][1] == long_opt_prefix[1] ) { /* long GNU option */
621 int match_at = parseGNU( argv[i]+2 ); /* skip -- */
622 if( match_at >= 0 && i < argc-1 ) /* found match */
623 setValue( options[match_at] , argv[++i] );
624 }else if( argv[i][0] == opt_prefix_char ) { /* POSIX char */
625 if( POSIX() ){
626 char ch = parsePOSIX( argv[i]+1 );/* skip - */
627 if( ch != '0' && i < argc-1 ) /* matching char */
628 setValue( ch , argv[++i] );
629 } else { /* treat it as GNU option with a - */
630 int match_at = parseGNU( argv[i]+1 ); /* skip - */
631 if( match_at >= 0 && i < argc-1 ) /* found match */
632 setValue( options[match_at] , argv[++i] );
633 }
634 }else { /* not option but an argument keep index */
635 if( new_argc < max_legal_args ){
636 new_argv[ new_argc ] = i ;
637 new_argc++;
638 }else{ /* ignore extra arguments */
639 printVerbose( "Ignoring extra argument: " );
640 printVerbose( argv[i] );
641 printVerbose( );
643 }
644 printVerbose( "Unknown command argument option : " );
645 printVerbose( argv[i] );
646 printVerbose( );
648 }
649 }
650}
char parsePOSIX(char *arg)
int parseGNU(char *arg)
bool CommandSet()

Referenced by main(), processCommandArgs(), processCommandArgs(), and processCommandArgs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processCommandArgs() [2/4]

void processCommandArgs ( int  _argc,
char **  _argv 
)

Definition at line 603 of file anyoption.cpp.

604{
605 useCommandArgs( _argc, _argv );
607}
void processCommandArgs()
void useCommandArgs(int _argc, char **_argv)
Here is the call graph for this function:

◆ processCommandArgs() [3/4]

void processCommandArgs ( int  _argc,
char **  _argv,
int  max_args 
)

Definition at line 596 of file anyoption.cpp.

597{
598 max_legal_args = max_args;
599 processCommandArgs( _argc, _argv );
600}
Here is the call graph for this function:

◆ processCommandArgs() [4/4]

void processCommandArgs ( int  max_args)

Definition at line 589 of file anyoption.cpp.

590{
591 max_legal_args = max_args;
593}
Here is the call graph for this function:

◆ processFile() [1/2]

bool processFile ( )

Definition at line 922 of file anyoption.cpp.

923{
924 if( ! (valueStoreOK() && FileSet()) )
925 return false;
926 return ( consumeFile(readFile()) );
927}
char * readFile()
bool consumeFile(char *buffer)
bool FileSet()

Referenced by processFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processFile() [2/2]

bool processFile ( const char *  _filename)

Definition at line 930 of file anyoption.cpp.

931{
933 return ( processFile() );
934}
void useFiileName(const char *_filename)
bool processFile()
Here is the call graph for this function:

◆ processLine()

void processLine ( char *  theline,
int  length 
)
private

Definition at line 1023 of file anyoption.cpp.

1024{
1025 bool found = false;
1026 char *pline = (char*) malloc( (length+1)*sizeof(char) );
1027 for( int i = 0 ; i < length ; i ++ )
1028 pline[i]= *(theline++);
1029 pline[length] = nullterminate;
1030 char *cursor = pline ; /* preserve the ptr */
1031 if( *cursor == delimiter || *(cursor+length-1) == delimiter ){
1032 justValue( pline );/* line with start/end delimiter */
1033 }else{
1034 for( int i = 1 ; i < length-1 && !found ; i++){/* delimiter */
1035 if( *cursor == delimiter ){
1036 *(cursor-1) = nullterminate; /* two strings */
1037 found = true;
1038 valuePairs( pline , cursor+1 );
1039 }
1040 cursor++;
1041 }
1042 cursor++;
1043 if( !found ) /* not a pair */
1044 justValue( pline );
1045 }
1046 free (pline);
1047}
void valuePairs(char *type, char *value)
void justValue(char *value)

Referenced by consumeFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processOptions()

void processOptions ( )

Definition at line 582 of file anyoption.cpp.

583{
584 if( ! valueStoreOK() )
585 return;
586}
Here is the call graph for this function:

◆ readFile() [1/2]

char * readFile ( )
private

Definition at line 937 of file anyoption.cpp.

938{
939 return ( readFile(filename) );
940}

Referenced by processFile(), and readFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readFile() [2/2]

char * readFile ( const char *  fname)
private

Definition at line 947 of file anyoption.cpp.

948{
949 int length;
950 char *buffer;
951 ifstream is;
952 is.open ( fname , ifstream::in );
953 if( ! is.good() ){
954 is.close();
955 return NULL;
956 }
957 is.seekg (0, ios::end);
958 length = is.tellg();
959 is.seekg (0, ios::beg);
960 buffer = (char*) malloc(length*sizeof(char));
961 is.read (buffer,length);
962 is.close();
963 return buffer;
964}

◆ setCommandFlag() [1/3]

void setCommandFlag ( char  opt_char)

Definition at line 418 of file anyoption.cpp.

419{
420 addOption( opt , COMMAND_FLAG );
422}
void addOption(const char *option, int type)
Here is the call graph for this function:

◆ setCommandFlag() [2/3]

void setCommandFlag ( const char *  opt_string)

Definition at line 411 of file anyoption.cpp.

412{
413 addOption( opt , COMMAND_FLAG );
415}
Here is the call graph for this function:

◆ setCommandFlag() [3/3]

void setCommandFlag ( const char *  opt_string,
char  opt_char 
)

Definition at line 425 of file anyoption.cpp.

426{
427 addOption( opt , COMMAND_FLAG );
428 addOption( optchar , COMMAND_FLAG );
430}
Here is the call graph for this function:

◆ setCommandLongPrefix()

void setCommandLongPrefix ( char *  _prefix)

Definition at line 275 of file anyoption.cpp.

276{
277 if( strlen( _prefix ) > MAX_LONG_PREFIX_LENGTH ){
278 *( _prefix + MAX_LONG_PREFIX_LENGTH ) = '\0';
279 }
280
281 strcpy (long_opt_prefix, _prefix);
282}
#define MAX_LONG_PREFIX_LENGTH
Definition anyoption.h:23

◆ setCommandOption() [1/3]

void setCommandOption ( char  opt_char)

Definition at line 396 of file anyoption.cpp.

397{
398 addOption( opt , COMMAND_OPT );
400}
Here is the call graph for this function:

◆ setCommandOption() [2/3]

void setCommandOption ( const char *  opt_string)

Definition at line 389 of file anyoption.cpp.

390{
391 addOption( opt , COMMAND_OPT );
393}
Here is the call graph for this function:

◆ setCommandOption() [3/3]

void setCommandOption ( const char *  opt_string,
char  opt_char 
)

Definition at line 403 of file anyoption.cpp.

404{
405 addOption( opt , COMMAND_OPT );
406 addOption( optchar , COMMAND_OPT );
408}
Here is the call graph for this function:

◆ setCommandPrefixChar()

void setCommandPrefixChar ( char  _prefix)

Definition at line 269 of file anyoption.cpp.

270{
271 opt_prefix_char = _prefix;
272}

◆ setFileCommentChar()

void setFileCommentChar ( char  _comment)

Definition at line 285 of file anyoption.cpp.

286{
287 file_delimiter_char = _comment;
288}

◆ setFileDelimiterChar()

void setFileDelimiterChar ( char  _delimiter)

Definition at line 292 of file anyoption.cpp.

293{
294 file_comment_char = _delimiter ;
295}

◆ setFileFlag() [1/3]

void setFileFlag ( char  opt_char)

Definition at line 462 of file anyoption.cpp.

463{
464 addOption( opt , FILE_FLAG );
466}
Here is the call graph for this function:

◆ setFileFlag() [2/3]

void setFileFlag ( const char *  opt_string)

Definition at line 455 of file anyoption.cpp.

456{
457 addOption( opt , FILE_FLAG );
459}
Here is the call graph for this function:

◆ setFileFlag() [3/3]

void setFileFlag ( const char *  opt_string,
char  opt_char 
)

Definition at line 469 of file anyoption.cpp.

470{
471 addOption( opt , FILE_FLAG );
472 addOption( optchar , FILE_FLAG );
474}
Here is the call graph for this function:

◆ setFileOption() [1/3]

void setFileOption ( char  opt_char)

Definition at line 440 of file anyoption.cpp.

441{
442 addOption( opt , FILE_OPT );
444}
#define FILE_OPT
Definition anyoption.h:11
Here is the call graph for this function:

◆ setFileOption() [2/3]

void setFileOption ( const char *  opt_string)

Definition at line 433 of file anyoption.cpp.

434{
435 addOption( opt , FILE_OPT );
437}
Here is the call graph for this function:

◆ setFileOption() [3/3]

void setFileOption ( const char *  opt_string,
char  opt_char 
)

Definition at line 447 of file anyoption.cpp.

448{
449 addOption( opt , FILE_OPT );
450 addOption( optchar, FILE_OPT );
452}
Here is the call graph for this function:

◆ setFlag() [1/3]

void setFlag ( char  opt_char)

Definition at line 506 of file anyoption.cpp.

507{
508 addOption( opt , COMMON_FLAG );
510}
Here is the call graph for this function:

◆ setFlag() [2/3]

void setFlag ( const char *  opt_string)

Definition at line 499 of file anyoption.cpp.

500{
501 addOption( opt , COMMON_FLAG );
503}

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFlag() [3/3]

void setFlag ( const char *  opt_string,
char  opt_char 
)

Definition at line 513 of file anyoption.cpp.

514{
515 addOption( opt , COMMON_FLAG );
516 addOption( optchar , COMMON_FLAG );
518}
Here is the call graph for this function:

◆ setFlagOn() [1/2]

bool setFlagOn ( char  optchar)
private

Definition at line 889 of file anyoption.cpp.

890{
891 if( !valueStoreOK() )
892 return false;
893 for( int i = 0 ; i < optchar_counter ; i++ ){
894 if( optionchars[i] == option ){
895 values[ optcharindex[i] ] = (char*) malloc((strlen(TRUE_FLAG)+1)*sizeof(char));
896 strcpy( values[ optcharindex[i] ] , TRUE_FLAG );
897 return true;
898 }
899 }
900 return false;
901}
Here is the call graph for this function:

◆ setFlagOn() [2/2]

bool setFlagOn ( const char *  option)
private

Definition at line 859 of file anyoption.cpp.

860{
861 if( !valueStoreOK() )
862 return false;
863 for( int i = 0 ; i < option_counter ; i++ ){
864 if( strcmp( options[i], option ) == 0 ){
865 values[ optionindex[i] ] = (char*) malloc((strlen(TRUE_FLAG)+1)*sizeof(char));
866 strcpy( values[ optionindex[i] ] , TRUE_FLAG );
867 return true;
868 }
869 }
870 return false;
871}

Referenced by justValue(), matchChar(), and matchOpt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOption() [1/3]

void setOption ( char  opt_char)

Definition at line 484 of file anyoption.cpp.

485{
486 addOption( opt , COMMON_OPT );
488}
Here is the call graph for this function:

◆ setOption() [2/3]

void setOption ( const char *  opt_string)

Definition at line 477 of file anyoption.cpp.

478{
479 addOption( opt , COMMON_OPT );
481}

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOption() [3/3]

void setOption ( const char *  opt_string,
char  opt_char 
)

Definition at line 491 of file anyoption.cpp.

492{
493 addOption( opt , COMMON_OPT );
494 addOption( optchar , COMMON_OPT );
496}
Here is the call graph for this function:

◆ setValue() [1/2]

bool setValue ( char  optchar,
char *  value 
)
private

Definition at line 874 of file anyoption.cpp.

875{
876 if( !valueStoreOK() )
877 return false;
878 for( int i = 0 ; i < optchar_counter ; i++ ){
879 if( optionchars[i] == option ){
880 values[ optcharindex[i] ] = (char*) malloc((strlen(value)+1)*sizeof(char));
881 strcpy( values[ optcharindex[i] ], value );
882 return true;
883 }
884 }
885 return false;
886}
Here is the call graph for this function:

◆ setValue() [2/2]

bool setValue ( const char *  option,
char *  value 
)
private

Definition at line 844 of file anyoption.cpp.

845{
846 if( !valueStoreOK() )
847 return false;
848 for( int i = 0 ; i < option_counter ; i++ ){
849 if( strcmp( options[i], option ) == 0 ){
850 values[ optionindex[i] ] = (char*) malloc((strlen(value)+1)*sizeof(char));
851 strcpy( values[ optionindex[i] ], value );
852 return true;
853 }
854 }
855 return false;
856}

Referenced by parseGNU(), parsePOSIX(), processCommandArgs(), and valuePairs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVerbose()

void setVerbose ( )

Definition at line 323 of file anyoption.cpp.

324{
325 verbose = true ;
326}

◆ useCommandArgs()

void useCommandArgs ( int  _argc,
char **  _argv 
)

Definition at line 368 of file anyoption.cpp.

369{
370 argc = _argc;
371 argv = _argv;
372 command_set = true;
373 appname = argv[0];
374 if(argc > 1) hasoptions = true;
375}

Referenced by processCommandArgs().

Here is the caller graph for this function:

◆ useFiileName()

void useFiileName ( const char *  _filename)

Definition at line 378 of file anyoption.cpp.

379{
380 filename = _filename;
381 file_set = true;
382}

Referenced by processFile().

Here is the caller graph for this function:

◆ valuePairs()

void valuePairs ( char *  type,
char *  value 
)
private

Definition at line 1065 of file anyoption.cpp.

1066{
1067 if ( strlen(chomp(type)) == 1 ){ /* this is a char option */
1068 for( int i = 0 ; i < optchar_counter ; i++ ){
1069 if( optionchars[i] == type[0] ){ /* match */
1070 if( optchartype[i] == COMMON_OPT ||
1071 optchartype[i] == FILE_OPT )
1072 {
1073 setValue( type[0] , chomp(value) );
1074 return;
1075 }
1076 }
1077 }
1078 }
1079 /* if no char options matched */
1080 for( int i = 0 ; i < option_counter ; i++ ){
1081 if( strcmp( options[i], type ) == 0 ){ /* match */
1082 if( optiontype[i] == COMMON_OPT ||
1083 optiontype[i] == FILE_OPT )
1084 {
1085 setValue( type , chomp(value) );
1086 return;
1087 }
1088 }
1089 }
1090 printVerbose( "Unknown option in resourcefile : " );
1091 printVerbose( type );
1092 printVerbose( );
1093}

Referenced by processLine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valueStoreOK()

bool valueStoreOK ( )
private

Definition at line 761 of file anyoption.cpp.

762{
763 int size= 0;
764 if( !set ){
765 if( g_value_counter > 0 ){
766 size = g_value_counter * sizeof(char*);
767 values = (char**)malloc( size );
768 for( int i = 0 ; i < g_value_counter ; i++)
769 values[i] = NULL;
770 set = true;
771 }
772 }
773 return set;
774}

Referenced by getFlag(), getFlag(), getValue(), getValue(), processCommandArgs(), processFile(), processOptions(), setFlagOn(), setFlagOn(), setValue(), and setValue().

Here is the caller graph for this function:

Member Data Documentation

◆ appname

char* appname
private

Definition at line 166 of file anyoption.h.

Referenced by init(), and useCommandArgs().

◆ argc

int argc
private

Definition at line 163 of file anyoption.h.

Referenced by init(), processCommandArgs(), and useCommandArgs().

◆ argv

char** argv
private

Definition at line 164 of file anyoption.h.

Referenced by getArgv(), init(), processCommandArgs(), and useCommandArgs().

◆ autousage

bool autousage
private

Definition at line 219 of file anyoption.h.

Referenced by autoUsagePrint(), init(), and printAutoUsage().

◆ command_set

bool command_set
private

Definition at line 196 of file anyoption.h.

Referenced by CommandSet(), init(), and useCommandArgs().

◆ comment

char comment
private

Definition at line 209 of file anyoption.h.

Referenced by consumeFile(), and init().

◆ delimiter

char delimiter
private

Definition at line 210 of file anyoption.h.

Referenced by init(), and processLine().

◆ endofline

char endofline
private

Definition at line 211 of file anyoption.h.

Referenced by consumeFile(), and init().

◆ equalsign

char equalsign
private

Definition at line 208 of file anyoption.h.

Referenced by init(), parseGNU(), and parsePOSIX().

◆ file_comment_char

char file_comment_char
private

Definition at line 207 of file anyoption.h.

Referenced by init(), and setFileDelimiterChar().

◆ file_delimiter_char

char file_delimiter_char
private

Definition at line 206 of file anyoption.h.

Referenced by init(), and setFileCommentChar().

◆ file_set

bool file_set
private

Definition at line 197 of file anyoption.h.

Referenced by FileSet(), init(), and useFiileName().

◆ filename

const char* filename
private

Definition at line 165 of file anyoption.h.

Referenced by init(), processFile(), readFile(), and useFiileName().

◆ g_value_counter

◆ hasoptions

bool hasoptions
private

Definition at line 218 of file anyoption.h.

Referenced by hasOptions(), init(), and useCommandArgs().

◆ long_opt_prefix

char long_opt_prefix[MAX_LONG_PREFIX_LENGTH+1]
private

Definition at line 205 of file anyoption.h.

Referenced by init(), processCommandArgs(), and setCommandLongPrefix().

◆ max_char_options

int max_char_options
private

Definition at line 181 of file anyoption.h.

Referenced by addOption(), alloc(), doubleCharStorage(), and init().

◆ max_legal_args

int max_legal_args
private

Definition at line 170 of file anyoption.h.

Referenced by init(), processCommandArgs(), processCommandArgs(), and processCommandArgs().

◆ max_options

int max_options
private

Definition at line 174 of file anyoption.h.

Referenced by addOption(), alloc(), doubleOptStorage(), and init().

◆ max_usage_lines

int max_usage_lines
private

Definition at line 193 of file anyoption.h.

Referenced by addUsage(), alloc(), doubleUsageStorage(), and init().

◆ mem_allocated

bool mem_allocated
private

Definition at line 198 of file anyoption.h.

Referenced by alloc(), init(), and ~AnyOption().

◆ new_argc

int new_argc
private

Definition at line 169 of file anyoption.h.

Referenced by getArgc(), getArgv(), init(), and processCommandArgs().

◆ new_argv

int* new_argv
private

Definition at line 168 of file anyoption.h.

Referenced by cleanup(), getArgv(), init(), and processCommandArgs().

◆ nullterminate

char nullterminate
private

Definition at line 213 of file anyoption.h.

Referenced by chomp(), init(), and processLine().

◆ once

bool once
private

Definition at line 216 of file anyoption.h.

Referenced by init(), and printUsage().

◆ opt_prefix_char

char opt_prefix_char
private

Definition at line 204 of file anyoption.h.

Referenced by init(), processCommandArgs(), and setCommandPrefixChar().

◆ optchar_counter

int optchar_counter
private

◆ optcharindex

int* optcharindex
private

◆ optchartype

int* optchartype
private

Definition at line 183 of file anyoption.h.

Referenced by addOption(), alloc(), cleanup(), doubleCharStorage(), justValue(), matchChar(), and valuePairs().

◆ option_counter

int option_counter
private

◆ optionchars

char* optionchars
private

◆ optionindex

int* optionindex
private

◆ options

◆ optiontype

int* optiontype
private

Definition at line 176 of file anyoption.h.

Referenced by addOption(), alloc(), cleanup(), doubleOptStorage(), justValue(), matchOpt(), and valuePairs().

◆ posix_style

bool posix_style
private

Definition at line 199 of file anyoption.h.

Referenced by init(), noPOSIX(), and POSIX().

◆ print_help

bool print_help
private

Definition at line 202 of file anyoption.h.

◆ print_usage

bool print_usage
private

Definition at line 201 of file anyoption.h.

◆ set

bool set
private

Definition at line 215 of file anyoption.h.

Referenced by init(), and valueStoreOK().

◆ usage

const char** usage
private

Definition at line 192 of file anyoption.h.

Referenced by addUsage(), alloc(), cleanup(), doubleUsageStorage(), and printUsage().

◆ usage_lines

int usage_lines
private

Definition at line 194 of file anyoption.h.

Referenced by addUsage(), init(), and printUsage().

◆ values

char** values
private

◆ verbose

bool verbose
private

Definition at line 200 of file anyoption.h.

Referenced by init(), printVerbose(), printVerbose(), printVerbose(), printVerbose(), and setVerbose().

◆ whitespace

char whitespace
private

Definition at line 212 of file anyoption.h.

Referenced by chomp(), init(), and parsePOSIX().


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