NAME

ACE_Arg_Shifter - This ADT shifts known args to the back of the argv vector, so deeper levels of argument parsing can locate the yet unprocessed arguments at the beginning of the vector.

SYNOPSIS

#include <ace/Arg_Shifter.h>

class ACE_Arg_Shifter { public: ACE_Arg_Shifter (int& argc, char** argv, char** temp = 0); ~ACE_Arg_Shifter (void); char* get_current (void) const; char* get_the_parameter (const char* flag); int cur_arg_strncasecmp (const char* flag); int consume_arg (int number = 1); int ignore_arg (int number = 1); int is_anything_left (void) const; int is_option_next (void) const; int is_parameter_next (void) const; int num_ignored_args (void) const; private: int& argc_; int total_size_; char** temp_; char** argv_; int current_index_; int back_; int front_; };

DESCRIPTION

The ACE_Arg_Shifter copies the pointers of the argv vector into a temporary array. As the ACE_Arg_Shifter iterates over the temp, is places known arguments in the rear of the argv and unknown ones in the beginning. So, after having visited all the arguments in the temp vector, ACE_Arg_Shifter has placed all the unknown arguments in their original order at the front of argv.

Initialization and termination methods.

ACE_Arg_Shifter (int& argc, char** argv, char** temp = 0);

~ACE_Arg_Shifter (void);

char* get_current (void) const;

char* get_the_parameter (const char* flag);

int cur_arg_strncasecmp (const char* flag);

int consume_arg (int number = 1);

int ignore_arg (int number = 1);

int is_anything_left (void) const;

int is_option_next (void) const;

int is_parameter_next (void) const;

int num_ignored_args (void) const;

AUTHOR

Seth Widoff

LIBRARY

ace