From 8c87ea41ff90d4eaca198cfc8cfc7ebe68c95d22 Mon Sep 17 00:00:00 2001 From: ljb1 Date: Mon, 13 Sep 1999 18:33:22 +0000 Subject: ChangeLogTag: Mon Sep 13 13:31:23 1999 Luther J Baker --- ace/Arg_Shifter.h | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) (limited to 'ace/Arg_Shifter.h') diff --git a/ace/Arg_Shifter.h b/ace/Arg_Shifter.h index cd1f5517344..41769d17320 100644 --- a/ace/Arg_Shifter.h +++ b/ace/Arg_Shifter.h @@ -54,24 +54,36 @@ public: char* get_current (void) const; // Get the current head of the vector. - char* get_current_parameter (int offset = 0); - // After checking for a flag, use this method return the parameter - // Safe to call without checking for current argument - // - // If offset > 0, returns current argument + offset - // if (offset == 2) ... "value" returns pointer to "lue" - // if (offset == 7) ... "value" returns 0 - // - // If offset == 0 - // consumes current argument - // if (is_parameter_next ()) is true - // then returns a pointer to the new current argument - // else returns 0 - // - // If offset < 0, returns current argument with offset - // but offset counts from the back - // if (offset == -2) ... "value" returns pointer to "ue" - // if (offset == -9) ... "value" returns 0 + char* get_the_parameter (const char* flag); + // If the matches the current_arg of arg shifter + // this method will attempt to return the associated + // parameter value + // + // Safe to call without checking for a current argument + // + // A char* to 'value' is returned: + // + // eg: main -foobar value, main -FooBar value + // main -FOOBARvalue + // + // all of the above will all match the == -FooBar + // and will return a char* to 'value' + // + // main -foobar 4 would succeed and return a char* to '4' + // main -foobar -4 wound not succeed (-4 is not a parameter) + // but instead, would return 0 + // + // 0 is returned: + // If the current argument does not match flag + // If there is no parameter found after a 'matched' flag + // + // If the flag is mateched and the flag and paramter DO NOT RUN + // together, the flag is consumed, the parameter is returned, + // and the new current argument is the paramter value. + // ie '-foobarflag VALUE + // + // If the flag is matched and the flag and parameter DO RUN + // together '-foobarflagVALUE, the flag is NOT consumed int cur_arg_strncasecmp (const char* flag); // Check if the current argument matches (case insensitive) -- cgit v1.2.1