Classes | Functions

Env_Value_T.h File Reference

#include "ace/Global_Macros.h"
#include "ace/OS_NS_stdlib.h"
#include "ace/Env_Value_T.inl"
#include "ace/Env_Value_T.cpp"
Include dependency graph for Env_Value_T.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ACE_Env_Value< T >
 Environment Variable Value. More...

Functions

template<class T >
void ACE_Convert (const ACE_TCHAR *s, T &t)
 Function to convert a string s into type T.
template<>
void ACE_Convert (const ACE_TCHAR *s, ACE_TCHAR *&v)
template<>
void ACE_Convert (const ACE_TCHAR *s, const ACE_TCHAR *&v)
template<>
void ACE_Convert (const ACE_TCHAR *s, short &si)
template<>
void ACE_Convert (const ACE_TCHAR *s, u_short &us)
template<>
void ACE_Convert (const ACE_TCHAR *s, u_int &i)
template<>
void ACE_Convert (const ACE_TCHAR *s, long &l)
template<>
void ACE_Convert (const ACE_TCHAR *s, int &i)
template<>
void ACE_Convert (const ACE_TCHAR *s, u_long &ul)
template<>
void ACE_Convert (const ACE_TCHAR *s, double &d)

Detailed Description

Id:
Env_Value_T.h 80826 2008-03-04 14:51:23Z wotte

Template to encapsulate getting a value from an environment variable and using a supplied default value if not in the environment.

Author:
Chris Cleeland (derived from work by Carlos O'Ryan)

Definition in file Env_Value_T.h.


Function Documentation

template<class T >
void ACE_Convert ( const ACE_TCHAR s,
T &  t 
) [inline]

Function to convert a string s into type T.

Definition at line 154 of file Env_Value_T.h.

{
  t = T (s);
}

template<>
void ACE_Convert ( const ACE_TCHAR s,
double &  d 
) [inline]

Definition at line 143 of file Env_Value_T.h.

{
  d = ACE_OS::strtod (s, 0);
}

template<>
void ACE_Convert ( const ACE_TCHAR s,
u_long &  ul 
) [inline]

Definition at line 137 of file Env_Value_T.h.

{
  ul = ACE_OS::strtoul (s, 0, 10);
}

template<>
void ACE_Convert ( const ACE_TCHAR s,
int &  i 
) [inline]

Definition at line 131 of file Env_Value_T.h.

{
  i = static_cast<int> (ACE_OS::strtol (s, 0, 10));
}

template<>
void ACE_Convert ( const ACE_TCHAR s,
long &  l 
) [inline]

Definition at line 125 of file Env_Value_T.h.

{
  l = ACE_OS::strtol (s, 0, 10);
}

template<>
void ACE_Convert ( const ACE_TCHAR s,
u_int &  i 
) [inline]

Definition at line 119 of file Env_Value_T.h.

{
  i = static_cast<u_int> (ACE_OS::strtol (s, 0, 10));
}

template<>
void ACE_Convert ( const ACE_TCHAR s,
u_short &  us 
) [inline]

Definition at line 113 of file Env_Value_T.h.

{
  us = static_cast <u_short> (ACE_OS::strtol (s, 0, 10));
}

template<>
void ACE_Convert ( const ACE_TCHAR s,
short &  si 
) [inline]

Definition at line 107 of file Env_Value_T.h.

{
  si = static_cast<short> (ACE_OS::strtol (s, 0, 10));
}

template<>
void ACE_Convert ( const ACE_TCHAR s,
const ACE_TCHAR *&  v 
) [inline]

Definition at line 101 of file Env_Value_T.h.

{
  v = (const ACE_TCHAR *) s;
}

template<>
void ACE_Convert ( const ACE_TCHAR s,
ACE_TCHAR *&  v 
) [inline]

Definition at line 95 of file Env_Value_T.h.

{
  v = (ACE_TCHAR *) s;
}

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines