00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00048 #ifndef STLSOFT_INCL_STLSOFT_STD_HPP_CSTDLIB
00049 #define STLSOFT_INCL_STLSOFT_STD_HPP_CSTDLIB
00050
00051 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00052 # define STLSOFT_VER_STLSOFT_STD_HPP_CSTDLIB_MAJOR 2
00053 # define STLSOFT_VER_STLSOFT_STD_HPP_CSTDLIB_MINOR 0
00054 # define STLSOFT_VER_STLSOFT_STD_HPP_CSTDLIB_REVISION 1
00055 # define STLSOFT_VER_STLSOFT_STD_HPP_CSTDLIB_EDIT 25
00056 #endif
00057
00058
00059
00060
00061
00062 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00063 # include <stlsoft/stlsoft.h>
00064 #endif
00065 #ifndef STLSOFT_INCL_STLSOFT_STD_HPP_CBASE_
00066 # include <stlsoft/std/cbase_.hpp>
00067 #endif
00068 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_HPP_STRING
00069 # include <stlsoft/shims/access/string.hpp>
00070 #endif
00071
00072 #ifndef STLSOFT_INCL_H_STDLIB
00073 # define STLSOFT_INCL_H_STDLIB
00074 # include <stdlib.h>
00075 #endif
00076
00077
00078
00079
00080
00081 #define STLSOFT_STD_CSTDLIB_ATOI_SUPPORTED
00082 #define STLSOFT_STD_CSTDLIB_ATOL_SUPPORTED
00083 #define STLSOFT_STD_CSTDLIB_ATOF_SUPPORTED
00084
00085 #if defined(STLSOFT_COMPILER_IS_BORLAND) || \
00086 defined(STLSOFT_COMPILER_IS_DMC) || \
00087 ( defined(STLSOFT_COMPILER_IS_GCC) && \
00088 defined(WIN32)) || \
00089 ( defined(STLSOFT_COMPILER_IS_INTEL) && \
00090 defined(WIN32)) || \
00091 defined(STLSOFT_COMPILER_IS_MSVC) || \
00092 defined(STLSOFT_COMPILER_IS_MWERKS) || \
00093 defined(STLSOFT_COMPILER_IS_WATCOM)
00094 # define STLSOFT_STD_CSTDLIB_WTOI_SUPPORTED
00095 #endif
00096
00097 #if defined(STLSOFT_COMPILER_IS_BORLAND) || \
00098 defined(STLSOFT_COMPILER_IS_DMC) || \
00099 ( defined(STLSOFT_COMPILER_IS_GCC) && \
00100 defined(WIN32)) || \
00101 ( defined(STLSOFT_COMPILER_IS_INTEL) && \
00102 defined(WIN32)) || \
00103 defined(STLSOFT_COMPILER_IS_MSVC) || \
00104 defined(STLSOFT_COMPILER_IS_WATCOM)
00105 # define STLSOFT_STD_CSTDLIB_WTOL_SUPPORTED
00106 #endif
00107
00108 #if defined(STLSOFT_COMPILER_IS_BORLAND) || \
00109 ( defined(STLSOFT_COMPILER_IS_MSVC) && \
00110 _MSC_VER >= 1300) || \
00111 defined(STLSOFT_COMPILER_IS_WATCOM)
00112 # define STLSOFT_STD_CSTDLIB_WTOF_SUPPORTED
00113 #endif
00114
00115
00116
00117
00118
00119 #ifndef _STLSOFT_NO_NAMESPACE
00120 namespace stlsoft
00121 {
00122 #endif
00123
00124
00125
00126
00127
00128 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00129 struct atoi_helper
00130 {
00131 static int call(char const* s)
00132 {
00133 return ::atoi(s);
00134 }
00135 #ifdef STLSOFT_STD_CSTDLIB_WTOI_SUPPORTED
00136 static int call(wchar_t const* s)
00137 {
00138 return ::_wtoi(s);
00139 }
00140 #endif
00141 };
00142
00143 struct atol_helper
00144 {
00145 static long call(char const* s)
00146 {
00147 return ::atol(s);
00148 }
00149 #ifdef STLSOFT_STD_CSTDLIB_WTOL_SUPPORTED
00150 static long call(wchar_t const* s)
00151 {
00152 return ::_wtol(s);
00153 }
00154 #endif
00155 };
00156
00157 struct atof_helper
00158 {
00159 static double call(char const* s)
00160 {
00161 return ::atof(s);
00162 }
00163 #ifdef STLSOFT_STD_CSTDLIB_WTOF_SUPPORTED
00164 static double call(wchar_t const* s)
00165 {
00166 return ::_wtof(s);
00167 }
00168 #endif
00169 };
00170
00171 #endif
00172
00173
00174
00175
00176
00177
00180
00181 template <ss_typename_param_k S>
00182 inline int atoi(S const& s)
00183 {
00184 return atoi_helper::call(stlsoft_ns_qual(c_str_ptr)(s));
00185 }
00186
00187 template <ss_typename_param_k S>
00188 inline long atol(S const& s)
00189 {
00190 return atol_helper::call(stlsoft_ns_qual(c_str_ptr)(s));
00191 }
00192
00193 template <ss_typename_param_k S>
00194 inline double atof(S const& s)
00195 {
00196 return atof_helper::call(stlsoft_ns_qual(c_str_ptr)(s));
00197 }
00198
00200
00201
00204
00205 inline long strtol(ss_char_a_t const* s, ss_char_a_t** endptr, int radix)
00206 {
00207 return ::strtol(s, endptr, radix);
00208 }
00209
00210 inline long strtol(ss_char_w_t const* s, ss_char_w_t** endptr, int radix)
00211 {
00212 return ::wcstol(s, endptr, radix);
00213 }
00214
00215 inline unsigned long strtoul(ss_char_a_t const* s, ss_char_a_t** endptr, int radix)
00216 {
00217 return ::strtoul(s, endptr, radix);
00218 }
00219
00220 inline unsigned long strtoul(ss_char_w_t const* s, ss_char_w_t** endptr, int radix)
00221 {
00222 return ::wcstoul(s, endptr, radix);
00223 }
00224
00225 inline double strtod(ss_char_a_t const* s, ss_char_a_t** endptr)
00226 {
00227 return ::strtod(s, endptr);
00228 }
00229
00230 inline double strtod(ss_char_w_t const* s, ss_char_w_t** endptr)
00231 {
00232 return ::wcstod(s, endptr);
00233 }
00234
00236
00237
00243 template <ss_typename_param_k S>
00244 inline int system(S const& s)
00245 {
00246 return ::system(stlsoft_ns_qual(c_str_ptr)(s));
00247 }
00248
00249
00250
00251
00252
00253 #ifdef STLSOFT_UNITTEST
00254 # include "./unittest/cstdlib_unittest_.h"
00255 #endif
00256
00257
00258
00259 #ifndef _STLSOFT_NO_NAMESPACE
00260 }
00261 #endif
00262
00263
00264
00265 #endif
00266
00267