summaryrefslogtreecommitdiff
path: root/ace/Arg_Shifter.cpp
diff options
context:
space:
mode:
authorljb1 <ljb1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-09-01 20:06:50 +0000
committerljb1 <ljb1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-09-01 20:06:50 +0000
commit7bd8e4566031b542240f3c18ab19ae5f67e01587 (patch)
tree2cb1ce4513d89068ae4b3c0dc7015a9381d65954 /ace/Arg_Shifter.cpp
parenta5eb19943676d23119c5d0a4472543de96536a3f (diff)
downloadATCD-7bd8e4566031b542240f3c18ab19ae5f67e01587.tar.gz
ChangeLogTag: Wed Sep 1 15:15:00 1999 Luther Baker <ljb1@cs.wustl.edu>
Diffstat (limited to 'ace/Arg_Shifter.cpp')
-rw-r--r--ace/Arg_Shifter.cpp52
1 files changed, 50 insertions, 2 deletions
diff --git a/ace/Arg_Shifter.cpp b/ace/Arg_Shifter.cpp
index 926477b4f68..c12820ec851 100644
--- a/ace/Arg_Shifter.cpp
+++ b/ace/Arg_Shifter.cpp
@@ -58,6 +58,52 @@ ACE_Arg_Shifter::get_current (void) const
return retval;
}
+char*
+ACE_Arg_Shifter::get_current_parameter (int offset)
+{
+ if (this->is_anything_left())
+ {
+ unsigned int margin = 0;
+ if (offset < 0)
+ {
+ unsigned int difference = 0;
+ if ((difference = ACE_OS::strlen(this->temp_[current_index_])
+ + offset) < 0)
+ {
+ return 0;
+ }
+ else
+ {
+ margin = ++difference;
+ }
+ }
+ else if (offset > 0)
+ {
+ unsigned int difference = 0;
+ if ((difference = ACE_OS::strlen(this->temp_[current_index_])
+ - offset) < 0)
+ {
+ return 0;
+ }
+ else
+ {
+ margin = offset;
+ }
+ }
+ else
+ {
+ this->consume_arg ();
+ if (!this->is_parameter_next())
+ {
+ return 0;
+ }
+ }
+ return this->temp_[current_index_] + margin;
+ }
+
+ return 0;
+}
+
int
ACE_Arg_Shifter::cur_arg_strncasecmp (const char* flag)
{
@@ -79,8 +125,10 @@ ACE_Arg_Shifter::cur_arg_strncasecmp (const char* flag)
}
else
{
- // match but more info passed in
- return flag_length;
+ // matches, with more info to boot!
+ return ACE_OS::strspn
+ (this->temp_[current_index_] + flag_length,
+ " ") + flag_length;
}
}
}