summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authoreea1 <eea1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-08-14 18:53:19 +0000
committereea1 <eea1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-08-14 18:53:19 +0000
commit735a204f4627666f093a91b17cc6f7a342bf1550 (patch)
tree7de28c90b4c979beac9fb03ba4bcc4652a8f5248 /ace
parent6ee472bdf41822583b34c85e3c903f364a14115a (diff)
downloadATCD-735a204f4627666f093a91b17cc6f7a342bf1550.tar.gz
*** empty log message ***
Diffstat (limited to 'ace')
-rw-r--r--ace/ARGV.cpp40
-rw-r--r--ace/ARGV.h14
-rw-r--r--ace/ARGV.i27
3 files changed, 45 insertions, 36 deletions
diff --git a/ace/ARGV.cpp b/ace/ARGV.cpp
index 370de0b8f97..170d59743f9 100644
--- a/ace/ARGV.cpp
+++ b/ace/ARGV.cpp
@@ -135,12 +135,12 @@ ACE_ARGV::string_to_array()
ACE_ARGV::ACE_ARGV (char buf[],
int substitute_env_args)
- : argc_ (0),
- substitute_env_args_ (substitute_env_args),
- argv_ (0),
+ : substitute_env_args_ (substitute_env_args),
+ state_ (TO_PTR_ARRAY),
+ argc_ (0),
+ argv_ (0),
buf_ (0),
- length_ (0),
- state_ (TO_PTR_ARRAY)
+ length_ (0)
{
ACE_TRACE ("ACE_ARGV::ACE_ARGV char[] to char *[]");
@@ -157,12 +157,12 @@ ACE_ARGV::ACE_ARGV (char buf[],
ACE_ARGV::ACE_ARGV (char *argv[],
int substitute_env_args)
- : argc_ (0),
- substitute_env_args_ (substitute_env_args),
- argv_ (0),
+ : substitute_env_args_ (substitute_env_args),
+ state_ (TO_STRING),
+ argc_ (0),
+ argv_ (0),
buf_ (0),
- length_ (0),
- state_ (TO_STRING)
+ length_ (0)
{
ACE_TRACE ("ACE_ARGV::ACE_ARGV char*[] to char[]");
@@ -195,8 +195,9 @@ ACE_ARGV::ACE_ARGV (char *argv[],
ACE_NEW (this->buf_, char[buf_len + 1]);
char *end = this->buf_;
+ int j;
- for (int j = 0; argv[j] != 0; j++)
+ for (j = 0; argv[j] != 0; j++)
{
char *temp;
@@ -220,12 +221,12 @@ ACE_ARGV::ACE_ARGV (char *argv[],
}
ACE_ARGV::ACE_ARGV(int substitute_env_args)
- : argc_ (0),
- substitute_env_args_ (substitute_env_args),
- argv_ (0),
+ : substitute_env_args_ (substitute_env_args),
+ state_ (ITERATIVE),
+ argc_ (0),
+ argv_ (0),
buf_ (0),
- length_ (0),
- state_ (ITERATIVE)
+ length_ (0)
{
ACE_TRACE ("ACE_ARGV::ACE_ARGV Iterative");
@@ -330,3 +331,10 @@ ACE_ARGV::create_buf_from_queue(void)
return 0;
}
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+template class ACE_Unbounded_Queue<char *>;
+template class ACE_Unbounded_Queue_Iterator<char *>;
+#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
+#pragma instantiate ACE_Unbounded_Queue<char *>
+#pragma instantiate ACE_Unbounded_Queue_Iterator<char *>
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/ace/ARGV.h b/ace/ARGV.h
index 27e4068bf98..9f96ea40c46 100644
--- a/ace/ARGV.h
+++ b/ace/ARGV.h
@@ -53,7 +53,7 @@ public:
// Destructor.
// = Accessor arguments.
- const char *operator[] (int index);
+ const char *operator[] (size_t index);
// Returns the <index>th string in the ARGV array.
char **argv (void);
@@ -91,18 +91,18 @@ public:
private:
- int substitute_env_args_;
- // Replace args with environment variable values?
-
- int state_;
- // Current state marker
-
int create_buf_from_queue(void);
// Creates buf_ from the queue, deletes previous buf_
void string_to_array(void);
// Converts buf_ into the char *argv[] format
+ int substitute_env_args_;
+ // Replace args with environment variable values?
+
+ int state_;
+ // Current state marker
+
size_t argc_;
// Number of arguments in the ARGV array.
diff --git a/ace/ARGV.i b/ace/ARGV.i
index 94eb114cae5..0bf928c54b8 100644
--- a/ace/ARGV.i
+++ b/ace/ARGV.i
@@ -31,19 +31,6 @@ ACE_ARGV::buf (void)
return (const char *)this->buf_;
}
-// Subscript operator.
-ACE_INLINE const char *
-ACE_ARGV::operator[] (int i)
-{
- ACE_TRACE ("ACE_ARGV::operator[]");
-
- // Don't go out of bounds
- if (i >= this->argc_)
- return 0;
-
- return (const char *)(this->argv()[i]);
-}
-
// Return the arguments in an entry-per-argument array
ACE_INLINE char **
ACE_ARGV::argv (void)
@@ -63,4 +50,18 @@ ACE_ARGV::argv (void)
return this->argv_;
}
+// Subscript operator.
+ACE_INLINE const char *
+ACE_ARGV::operator[] (size_t i)
+{
+ ACE_TRACE ("ACE_ARGV::operator[]");
+
+ // Don't go out of bounds
+ if (i >= this->argc_)
+ return 0;
+
+ return (const char *)(this->argv()[i]);
+}
+
+