#include <ARGV.h>
Collaboration diagram for ACE_ARGV:
Public Types | |
enum | States { TO_STRING = 1, TO_PTR_ARRAY = 2, ITERATIVE = 3 } |
Public Methods | |
ACE_ARGV (const ACE_TCHAR buf[], int substitute_env_args=1) | |
Converts <buf> into an <argv>-style vector of strings. More... | |
ACE_ARGV (ACE_TCHAR *argv[], int substitute_env_args=1) | |
Converts <argv> into a linear string. More... | |
ACE_ARGV (ACE_TCHAR *first_argv[], ACE_TCHAR *second_argv[], int substitute_env_args=1) | |
Creates an ACE_ARGV which is the concatenation of the first_argv and the second argv. More... | |
ACE_ARGV (int substitute_env_args=1) | |
Entry point for creating an ACE_TCHAR *[] command line iteratively via the <add> method. More... | |
~ACE_ARGV (void) | |
Destructor. More... | |
const ACE_TCHAR * | operator[] (size_t index) |
Returns the <index>th string in the ARGV array. More... | |
ACE_TCHAR ** | argv (void) |
Returns the <argv> array. More... | |
int | argc (void) const |
Returns <argc>. More... | |
const ACE_TCHAR * | buf (void) |
Returns the <buf>. Caller should not delete this memory since the <ARGV> destructor will delete it. More... | |
void | dump (void) const |
Dump the state of an object. More... | |
int | add (const ACE_TCHAR *next_arg) |
Add another argument. This only works in the <ITERATIVE> state. Note that this method does not copy <next_arg>, nor does it assume ownership of managing its memory, i.e., the caller is responsible for memory management. Returns -1 on failure and 0 on success. More... | |
int | add (ACE_TCHAR *argv[]) |
Add another <argv> array. More... | |
int | state (void) const |
What state is this ACE_ARGV in? More... | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. More... | |
Private Methods | |
int | create_buf_from_queue (void) |
Creates buf_ from the queue, deletes previous buf_. More... | |
int | string_to_argv (void) |
Converts buf_ into the ACE_TCHAR *argv[] format. More... | |
int | argv_to_string (ACE_TCHAR **argv, ACE_TCHAR *&buf) |
Returns the string created from argv in buf and returns the number of arguments. More... | |
Private Attributes | |
int | substitute_env_args_ |
Replace args with environment variable values? More... | |
int | state_ |
Current state marker. More... | |
int | argc_ |
Number of arguments in the ARGV array. More... | |
ACE_TCHAR ** | argv_ |
The array of string arguments. More... | |
ACE_TCHAR * | buf_ |
Buffer containing the <argv> contents. More... | |
size_t | length_ |
Total length of the arguments in the queue, not counting separating spaces. More... | |
ACE_Unbounded_Queue< ACE_TCHAR *> | queue_ |
Queue which keeps user supplied arguments. This is only active in the "iterative" mode. More... |
|
|
|
Converts <buf> into an <argv>-style vector of strings. If <substitute_env_args> is enabled then we'll substitute the environment variables for each $ENV encountered in the string. The subscript and <argv> operations are not allowed on an ACE_ARGV created this way. |
|
Converts <argv> into a linear string. If <substitute_env_args> is enabled then we'll substitute the environment variables for each $ENV encountered in the string. The <buf> operation is not allowed on an ACE_ARGV created this way. |
|
Creates an ACE_ARGV which is the concatenation of the first_argv and the second argv. The argv arguments should be null pointer terminated. |
|
Entry point for creating an ACE_TCHAR *[] command line iteratively via the <add> method. When this constructor is used, the <ITERATIVE> state is enabled. The <argv> and <buf> methods are allowed, and the result is recreated when called multiple times. The subscript operator is not allowed. |
|
Destructor.
|
|
Add another <argv> array. The <argv> parameter must be NULL terminated. This only works in the <ITERATIVE> state. Returns -1 on failure and 0 on success. |
|
Add another argument. This only works in the <ITERATIVE> state. Note that this method does not copy <next_arg>, nor does it assume ownership of managing its memory, i.e., the caller is responsible for memory management. Returns -1 on failure and 0 on success.
|
|
Returns <argc>.
|
|
Returns the <argv> array. Caller should not delete this memory since the <ARGV> destructor will delete it. If the caller modifies the array in the iterative mode, the changes are not saved to the queue. |
|
Returns the string created from argv in buf and returns the number of arguments.
|
|
Returns the <buf>. Caller should not delete this memory since the <ARGV> destructor will delete it.
|
|
Creates buf_ from the queue, deletes previous buf_.
|
|
Dump the state of an object.
|
|
Returns the <index>th string in the ARGV array.
|
|
What state is this ACE_ARGV in?
|
|
Converts buf_ into the ACE_TCHAR *argv[] format.
|
|
Declare the dynamic allocation hooks.
|
|
Number of arguments in the ARGV array.
|
|
The array of string arguments.
|
|
Buffer containing the <argv> contents.
|
|
Total length of the arguments in the queue, not counting separating spaces.
|
|
Queue which keeps user supplied arguments. This is only active in the "iterative" mode.
|
|
Current state marker.
|
|
Replace args with environment variable values?
|