Env_Value_T.inl

Go to the documentation of this file.
00001 // Env_Value_T.inl,v 4.3 2005/10/28 16:14:52 ossama Exp
00002 
00003 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00004 
00005 template <class T> ACE_INLINE
00006 ACE_Env_Value<T>::operator T (void)
00007 {
00008   return value_;
00009 }
00010 
00011 template <class T> ACE_INLINE
00012 ACE_Env_Value<T>::ACE_Env_Value (void)
00013   : varname_ (0)
00014 {
00015 }
00016 
00017 template <class T> ACE_INLINE
00018 ACE_Env_Value<T>::ACE_Env_Value (const ACE_TCHAR *varname,
00019                                  const T &defval)
00020   : varname_ (varname),
00021     value_(defval)
00022 {
00023   this->fetch_value ();
00024 }
00025 
00026 template <class T> ACE_INLINE void
00027 ACE_Env_Value<T>::open (const ACE_TCHAR *varname,
00028                         const T &defval)
00029 {
00030   this->varname_ = varname;
00031   this->value_ = defval;
00032   this->fetch_value ();
00033 }
00034 
00035 template <class T> ACE_INLINE void
00036 ACE_Env_Value<T>::fetch_value (void)
00037 {
00038 #if defined (ACE_WIN32)
00039   const ACE_TCHAR *env = ACE_OS::getenv (this->varname_);
00040   if (env != 0)
00041     ACE_Convert (env, value_);
00042 #else
00043   char *nenv = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (this->varname_));
00044   if (nenv != 0)
00045     ACE_Convert (ACE_TEXT_CHAR_TO_TCHAR (nenv), this->value_);
00046 #endif
00047 }
00048 
00049 template <class T> ACE_INLINE const ACE_TCHAR*
00050 ACE_Env_Value<T>::varname (void) const
00051 {
00052   return this->varname_;
00053 }
00054 
00055 template <class T> ACE_INLINE
00056 ACE_Env_Value<T>::~ACE_Env_Value (void)
00057 {
00058 }
00059 
00060 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 09:41:50 2006 for ACE by doxygen 1.3.6