diff options
author | Adam Mitz <mitza@ociweb.com> | 2019-02-13 17:11:37 -0600 |
---|---|---|
committer | Adam Mitz <mitza@ociweb.com> | 2019-02-13 17:16:55 -0600 |
commit | a7255f41da266630886c26007ea41a95491f396c (patch) | |
tree | ddec02e5c3662c88cc38d21e57bda3462f464308 /ACE/ace/Arg_Shifter.h | |
parent | 8d35eb8b12f4a9bae490620d5a0cf52d7f8f717e (diff) | |
download | ATCD-a7255f41da266630886c26007ea41a95491f396c.tar.gz |
Support instantiating ACE_Arg_Shifter_T<char> in wchar builds.
Cleaned up some comments and style guidelines violations.
Diffstat (limited to 'ACE/ace/Arg_Shifter.h')
-rw-r--r-- | ACE/ace/Arg_Shifter.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/ACE/ace/Arg_Shifter.h b/ACE/ace/Arg_Shifter.h index 74cabeef8d3..1ed6f136758 100644 --- a/ACE/ace/Arg_Shifter.h +++ b/ACE/ace/Arg_Shifter.h @@ -75,13 +75,13 @@ public: * (the default) the object will allocate and free the temporary * vector transparently. */ - ACE_Arg_Shifter_T (int& argc, + ACE_Arg_Shifter_T (int &argc, const CHAR_TYPE **argv, const CHAR_TYPE **temp = 0); /// Same behavior as the preceding constructor, but without the /// "const" qualifier. - ACE_Arg_Shifter_T (int& argc, + ACE_Arg_Shifter_T (int &argc, CHAR_TYPE **argv, CHAR_TYPE **temp = 0); @@ -98,12 +98,12 @@ public: * * Safe to call without checking that a current arg exists * - * In the following examples, a pointer to the char* "value" is ret + * In the following examples, a pointer to the char* "value" is returned * * eg: main -foobar value, main -FooBar value * main -FOOBARvalue * - * all of the above will all match the @a flag == -FooBar + * all of the above will match the @a flag == -FooBar * and will return a char* to "value" * * main -foobar 4 would succeed and return a char* to "4" @@ -123,7 +123,7 @@ public: * together '-foobarflagVALUE', the flag is NOT consumed * and the cur arg is left pointing to the entire flag/value pair */ - const CHAR_TYPE *get_the_parameter (const CHAR_TYPE* flag); + const CHAR_TYPE *get_the_parameter (const CHAR_TYPE *flag); /** * Check if the current argument matches (case insensitive) @a flag @@ -134,7 +134,7 @@ public: * 0 is returned. * * ie: when current_arg = "-foobar" or "-FOOBAR" or "-fooBAR" - * this->cur_arg_strncasecmp ("-FooBar); + * this->cur_arg_strncasecmp ("-FooBar"); * will return 0 * * ------------------------------------------------------------ @@ -142,11 +142,19 @@ public: * 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 + * after any initial spaces (see below). * * ie: when current_arg = "-foobar98023" - * this->cur_arg_strncasecmp ("-FooBar); + * this->cur_arg_strncasecmp ("-FooBar"); * will return 7 * + * Spaces separating the flag from its value (that are still part + * of the same argv element) are counted as part of the return value + * + * ie: when current_arg = "-foobar 98023" + * this->cur_arg_strncasecmp ("-FooBar"); + * will return 8 + * * Notice: this number will always be > 0 * * ------------------------------------------------------------ @@ -180,16 +188,16 @@ public: private: /// Copy Constructor should not be used. - ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T (const ACE_Arg_Shifter_T<CHAR_TYPE>&)) + ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T (const ACE_Arg_Shifter_T<CHAR_TYPE> &)) /// Assignment '=' operator should not be used. - ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T operator= (const ACE_Arg_Shifter_T<CHAR_TYPE>&)) + ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T operator= (const ACE_Arg_Shifter_T<CHAR_TYPE> &)) /// Refactor the constructor logic. void init (void); /// The size of the argument vector. - int& argc_; + int &argc_; /// The size of argv_. int total_size_; |