2 #include "ace/Global_Macros.h"
4 // Open versioned namespace, if enabled by the user.
5 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
7 template <typename CHAR_TYPE> ACE_INLINE
8 ACE_ARGV_Queue_Entry_T<CHAR_TYPE>::ACE_ARGV_Queue_Entry_T (void)
15 template <typename CHAR_TYPE> ACE_INLINE
16 ACE_ARGV_Queue_Entry_T<CHAR_TYPE>::ACE_ARGV_Queue_Entry_T (const CHAR_TYPE *arg,
24 template <typename CHAR_TYPE> ACE_INLINE
25 ACE_ARGV_Queue_Entry_T<CHAR_TYPE>::ACE_ARGV_Queue_Entry_T (const ACE_ARGV_Queue_Entry_T<CHAR_TYPE> &entry)
27 quote_arg_(entry.quote_arg_)
32 template <typename CHAR_TYPE> ACE_INLINE
33 ACE_ARGV_Queue_Entry_T<CHAR_TYPE>::~ACE_ARGV_Queue_Entry_T (void)
35 // No-op just to keep some compilers happy...
38 // Return the number of args
39 template <typename CHAR_TYPE>
41 ACE_ARGV_T<CHAR_TYPE>::argc (void) const
43 ACE_TRACE ("ACE_ARGV_T::argc");
44 // Try to create the argv_ if it isn't there
45 ACE_ARGV_T<CHAR_TYPE> *nonconst_this =
46 const_cast <ACE_ARGV_T<CHAR_TYPE> *> (this);
47 (void) nonconst_this->argv ();
51 // Return the arguments in a space-separated string
52 template <typename CHAR_TYPE>
53 ACE_INLINE const CHAR_TYPE *
54 ACE_ARGV_T<CHAR_TYPE>::buf (void)
56 ACE_TRACE ("ACE_ARGV_T::buf");
58 if (this->buf_ == 0 && this->iterative_)
59 this->create_buf_from_queue ();
61 return (const CHAR_TYPE *) this->buf_;
64 // Return the arguments in an entry-per-argument array
66 template <typename CHAR_TYPE>
67 ACE_INLINE CHAR_TYPE **
68 ACE_ARGV_T<CHAR_TYPE>::argv (void)
70 ACE_TRACE ("ACE_ARGV_T::argv");
72 // Try to create the argv_ if it isn't there
75 if (this->iterative_ && this->buf_ == 0)
76 this->create_buf_from_queue ();
78 // Convert buf_ to argv_
79 if (this->string_to_argv () == -1)
80 return (CHAR_TYPE **) 0;
83 return (CHAR_TYPE **) this->argv_;
86 // Subscript operator.
88 template <typename CHAR_TYPE>
89 ACE_INLINE const CHAR_TYPE *
90 ACE_ARGV_T<CHAR_TYPE>::operator[] (size_t i)
92 ACE_TRACE ("ACE_ARGV_T::operator[]");
94 // Don't go out of bounds.
95 if (i >= static_cast<size_t> (this->argc_))
98 return (const CHAR_TYPE *) this->argv ()[i];
101 // Close versioned namespace, if enabled by the user.
102 ACE_END_VERSIONED_NAMESPACE_DECL