/* -*- C++ -*- */ // $Id$ // ============================================================================ // // = LIBRARY // ace // // = FILENAME // ARGV.h // // = AUTHOR // Doug Schmidt // // ============================================================================ #if !defined (ACE_ARGUMENT_VECTOR_H) #define ACE_ARGUMENT_VECTOR_H #include "ace/ACE.h" class ACE_Export ACE_ARGV // = TITLE // Transforms a string into an style vector of // strings or an style vector of string , performing // environment variable substitutions if necessary. { public: // = Initialization and termination. ACE_ARGV (char buf[], int substitute_env_args = 1); // Converts into an -style vector of strings. If // is enabled then we'll substitute the // environment variables for each $ENV encountered in the string. ACE_ARGV (char *argv[], int substitute_env_args = 1); // Converts into a linear string. If // is enabled then we'll substitute the environment variables for // each $ENV encountered in the string. ~ACE_ARGV (void); // Destructor. // = Accessor arguments. char *operator[] (int index) const; // Returns the th string in the ARGV array. char **argv (void) const; // Returns the array. Caller should not delete this memory // since the destructor will delete it. size_t argc (void) const; // Returns . char *buf (void) const; // Returns the . Caller should not delete this memory since // the destructor will delete it. void dump (void) const; // Dump the state of an object. ACE_ALLOC_HOOK_DECLARE; // Declare the dynamic allocation hooks. private: size_t argc_; // Number of arguments in the ARGV array. char **argv_; // The array of string arguments. char *buf_; // Buffer containing the contents. }; #if defined (__ACE_INLINE__) #include "ace/ARGV.i" #endif /* __ACE_INLINE__ */ #endif /* ACE_ARGUMENT_VECTOR_H */