summaryrefslogtreecommitdiff
path: root/ace/Arg_Shifter.h
diff options
context:
space:
mode:
authorljb1 <ljb1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-29 06:11:13 +0000
committerljb1 <ljb1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-29 06:11:13 +0000
commit09b95e1089c22df6220f06e3190009f9cece5a6b (patch)
treeb901bf77d2fdc4b76be2f8faf9f82a246f7d9bcf /ace/Arg_Shifter.h
parentac3ccfc64e419fdee9785e5ee59ef3f1a6c1f151 (diff)
downloadATCD-09b95e1089c22df6220f06e3190009f9cece5a6b.tar.gz
ChangeLogTag: Sun Aug 29 00:14:09 1999 Luther Baker <ljb1@cs.wustle.edu>
Diffstat (limited to 'ace/Arg_Shifter.h')
-rw-r--r--ace/Arg_Shifter.h48
1 files changed, 21 insertions, 27 deletions
diff --git a/ace/Arg_Shifter.h b/ace/Arg_Shifter.h
index 012adfd3c0d..30ca53a9706 100644
--- a/ace/Arg_Shifter.h
+++ b/ace/Arg_Shifter.h
@@ -54,40 +54,34 @@ public:
char* get_current (void) const;
// Get the current head of the vector.
- char* is_or_contains_ignore_case(const char* flag);
- // Check if the current argument matches <flag>
+ int cur_arg_strncasecmp(const char* flag);
+ // Check if the current argument matches (case insensitive) <flag>
//
- // An argument matches if:
- // - it STARTS with <flag>
- // - any character may appear after the flag including
- // - digits, spaces, characters or nothing at all
- // - match is case insensitive.
- // - ie: "-Foobar" "-FOOBAR" "-fOobAr" "-foobarVALUE"
- // - all match the <flag> "-FooBar"
+ // ------------------------------------------------------------
//
- // If there is NOT a match, nil is returned
+ // Case A: Perfect Match (case insensitive)
+ // 0 is returned.
//
- // If there IS a match:
- // An attempt is made to return the <flag>'s parameter (or 'value')
+ // ie: when current_arg = "-foobar" or "-FOOBAR" or "-fooBAR"
+ // this->cur_arg_strncasecmp ("-FooBar);
+ // will return 0
//
- // Case A: value is separated from flag with a space:
- // Arg_Shifter calls consume_arg() (<flag>) and advances to the next arg
- // If the new current argument passes is_parameter_next()
- // - we return the 'new' current argument, ('value')
- // else, we return nil
+ // ------------------------------------------------------------
//
- // Case B: value is mangled together with flag: ie: "-fooBarVALUE"
- // A char* is returned - pointing to VALUE
+ // Case B: Perfect Match (case insensitive) but the current_arg
+ // is longer than the flag. Returns a number equal to the index
+ // in the char* indicating the start of the extra characters
//
- // This operation consumes the current argument if:
- // - there is a match &&
- // - and the value for the flag is separated from the flag with a space.
- // This operation does not consume the current argument if:
- // - there is a match but
- // - there is no space separating the value from the flag "-FooBarVALUE"
+ // ie: when current_arg = "-foobar98023"
+ // this->cur_arg_strncasecmp ("-FooBar);
+ // will return 7
//
- // This method is safe to call without checking for a valid
- // current argument.
+ // Notice: this number will always be > 0
+ //
+ // ------------------------------------------------------------
+ //
+ // Case C: If neither of Case A or B is met (no match)
+ // then -1 is returned
int consume_arg (int number = 1);
// Consume <number> argument(s) by sticking them/it on the end of