diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-03-01 09:47:33 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-03-01 09:47:33 +0000 |
commit | c52616d272466865e1491ca278880f415356fe6b (patch) | |
tree | 58ed6536cdd651d677fef5c0d12a729a82f89a26 /ace | |
parent | 5b9b0d8a2ecd9b47bea3e5391f1608d1a02afb8b (diff) | |
download | ATCD-c52616d272466865e1491ca278880f415356fe6b.tar.gz |
ChangelogTag: Wed Mar 1 07:36:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Env_Value_T.h | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/ace/Env_Value_T.h b/ace/Env_Value_T.h index 42735b42ef7..0a01705dfbb 100644 --- a/ace/Env_Value_T.h +++ b/ace/Env_Value_T.h @@ -91,72 +91,71 @@ ACE_END_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL -// Default calls a CTOR on type T of the form 'T::T(const char*)', but -// users can feel free to create their own specialized conversion -// functions if necessary, as shown below. Note that for 'char*' the -// default is used because a simple cast will be performed and no -// conversion will be necessary. - -template <class T> inline void -ACE_Convert (const ACE_TCHAR *s, T &t) -{ - t = T (s); -} - -inline void +template <> inline void ACE_Convert (const ACE_TCHAR *s, ACE_TCHAR *&v) { v = (ACE_TCHAR *) s; } -inline void +template <> inline void ACE_Convert (const ACE_TCHAR *s, const ACE_TCHAR *&v) { v = (const ACE_TCHAR *) s; } -inline void +template <> inline void ACE_Convert (const ACE_TCHAR *s, short &si) { si = static_cast<short> (ACE_OS::strtol (s, 0, 10)); } -inline void +template <> inline void ACE_Convert (const ACE_TCHAR *s, u_short &us) { us = static_cast <u_short> (ACE_OS::strtol (s, 0, 10)); } -inline void +template <> inline void ACE_Convert (const ACE_TCHAR *s, u_int &i) { i = static_cast<u_int> (ACE_OS::strtol (s, 0, 10)); } -inline void +template <> inline void ACE_Convert (const ACE_TCHAR *s, long &l) { l = ACE_OS::strtol (s, 0, 10); } -inline void +template <> inline void ACE_Convert (const ACE_TCHAR *s, int &i) { i = static_cast<int> (ACE_OS::strtol (s, 0, 10)); } -inline void +template <> inline void ACE_Convert (const ACE_TCHAR *s, u_long &ul) { ul = ACE_OS::strtoul (s, 0, 10); } -inline void +template <> inline void ACE_Convert (const ACE_TCHAR *s, double &d) { d = ACE_OS::strtod (s, 0); } +// Default calls a CTOR on type T of the form 'T::T(const char*)', but +// users can feel free to create their own specialized conversion +// functions if necessary, as shown above. Note that for 'char*' the +// default is used because a simple cast will be performed and no +// conversion will be necessary. +template <class T> inline void +ACE_Convert (const ACE_TCHAR *s, T &t) +{ + t = T (s); +} + ACE_END_VERSIONED_NAMESPACE_DECL #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) |