72 init( maxopt , maxopt );
77 init( maxopt , maxcharopt );
134 if(
alloc() ==
false ){
135 cout << endl <<
"OPTIONS ERROR : Failed allocating memory" ;
137 cout <<
"Exiting." << endl ;
152 options = (
const char**)malloc( size );
181 usage = (
const char**) malloc( size );
563 cout <<
"OPTIONS ERROR : Failed allocating extra memory " << endl ;
564 cout <<
"While adding the option : \""<< opt <<
"\"" << endl;
565 cout <<
"Exiting." << endl ;
574 cout <<
"OPTIONS ERROR : Failed allocating extra memory " << endl ;
575 cout <<
"While adding the option: \""<< opt <<
"\"" << endl;
576 cout <<
"Exiting." << endl ;
618 for(
int i = 1 ; i <
argc ; i++ ){
622 if( match_at >= 0 && i < argc-1 )
627 if( ch !=
'0' && i < argc-1 )
631 if( match_at >= 0 && i < argc-1 )
656 for(
unsigned int i = 0 ; i < strlen(arg) ; i++ ){
660 if( i == strlen(arg)-1 ){
684 for(
unsigned int i = 0 ; i < strlen(arg) ; i++ ){
691 char* tmp = (
char*) malloc( (split_at+1)*
sizeof(char) );
692 for(
int i = 0 ; i < split_at ; i++ )
694 tmp[split_at] =
'\0';
718 if( strcmp(
options[i], opt ) == 0 ){
767 values = (
char**)malloc( size );
786 if( strcmp(
options[i], option ) == 0 )
798 if( strcmp(
options[i], option ) == 0 )
849 if( strcmp(
options[i], option ) == 0 ){
851 strcpy(
values[ optionindex[i] ], value );
864 if( strcmp(
options[i], option ) == 0 ){
881 strcpy(
values[ optcharindex[i] ], value );
952 is.open ( fname , ifstream::in );
957 is.seekg (0, ios::end);
959 is.seekg (0, ios::beg);
960 buffer = (
char*) malloc(length*
sizeof(
char));
961 is.read (buffer,length);
977 char *cursor = buffer;
981 for(
unsigned int i = 0 ; i < strlen( buffer ) ; i++ ){
1026 char *pline = (
char*) malloc( (length+1)*
sizeof(char) );
1027 for(
int i = 0 ; i < length ; i ++ )
1028 pline[i]= *(theline++);
1030 char *cursor = pline ;
1034 for(
int i = 1 ; i < length-1 && !found ; i++){
1057 char *end = str+strlen(str)-1;
1067 if ( strlen(
chomp(type)) == 1 ){
1081 if( strcmp(
options[i], type ) == 0 ){
1099 if ( strlen(
chomp(type)) == 1 ){
1113 if( strcmp(
options[i], type ) == 0 ){
1146 cout <<
usage[i] << endl ;
1169 cout <<
"OPTIONS ERROR : Failed allocating extra memory " << endl ;
1170 cout <<
"While adding the usage/help : \""<< line <<
"\"" << endl;
1171 cout <<
"Exiting." << endl ;
void setFileDelimiterChar(char _delimiter)
#define MAX_LONG_PREFIX_LENGTH
void useCommandArgs(int _argc, char **_argv)
bool consumeFile(char *buffer)
char * getArgv(int index)
bool setFlagOn(const char *option)
void useFiileName(const char *_filename)
bool doubleUsageStorage()
void setFlag(const char *opt_string)
void processLine(char *theline, int length)
char parsePOSIX(char *arg)
bool findFlag(char *value)
void autoUsagePrint(bool flag)
void setFileCommentChar(char _comment)
void setCommandPrefixChar(char _prefix)
void setCommandOption(const char *opt_string)
bool getFlag(const char *_option)
void processCommandArgs()
void setFileOption(const char *opt_string)
char * getValue(const char *_option)
void addUsageError(const char *line)
void justValue(char *value)
void setCommandFlag(const char *opt_string)
void addUsage(const char *line)
bool setValue(const char *option, char *value)
void setCommandLongPrefix(char *_prefix)
void setOption(const char *opt_string)
void valuePairs(char *type, char *value)
void addOption(const char *option, int type)
char long_opt_prefix[MAX_LONG_PREFIX_LENGTH+1]
void addOptionError(const char *opt)
void setFileFlag(const char *opt_string)