Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ARGV.i

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: ARGV.i,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00003 
00004 // Return the number of args
00005 ACE_INLINE int
00006 ACE_ARGV::argc (void) const
00007 {
00008   ACE_TRACE ("ACE_ARGV::argc");
00009   return this->argc_;
00010 }
00011 
00012 // Return the state of this ACE_ARGV
00013 ACE_INLINE int
00014 ACE_ARGV::state(void) const
00015 {
00016   ACE_TRACE ("ACE_ARGV::state");
00017   return this->state_;
00018 }
00019 
00020 // Return the arguments in a space-separated string
00021 ACE_INLINE const ACE_TCHAR *
00022 ACE_ARGV::buf (void)
00023 {
00024   ACE_TRACE ("ACE_ARGV::buf");
00025 
00026   if (this->buf_ == 0 && this->state_ == ITERATIVE) 
00027     this->create_buf_from_queue ();
00028 
00029   return (const ACE_TCHAR *) this->buf_;
00030 }
00031 
00032 // Return the arguments in an entry-per-argument array
00033 
00034 ACE_INLINE ACE_TCHAR **
00035 ACE_ARGV::argv (void)
00036 {
00037   ACE_TRACE ("ACE_ARGV::argv");
00038 
00039   // Try to create the argv_ if it isn't there
00040   if (this->argv_ == 0) 
00041     {
00042       if (this->state_ == ITERATIVE && this->buf_ == 0)
00043         this->create_buf_from_queue ();
00044 
00045       // Convert buf_ to argv_
00046       if (this->string_to_argv () == -1)
00047         return (ACE_TCHAR **) 0;
00048     }
00049 
00050   return (ACE_TCHAR **) this->argv_;
00051 }
00052 
00053 // Subscript operator.  
00054 
00055 ACE_INLINE const ACE_TCHAR *
00056 ACE_ARGV::operator[] (size_t i)
00057 {
00058   ACE_TRACE ("ACE_ARGV::operator[]");
00059 
00060   // Don't go out of bounds.
00061   if (i >= ACE_static_cast (size_t, this->argc_))
00062     return 0;
00063 
00064   return (const ACE_TCHAR *) this->argv ()[i];
00065 }
00066 
00067 
00068 

Generated on Mon Jun 16 11:19:03 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002