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
00041
00042
00049 #ifndef PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_REAL
00050 #define PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_REAL
00051
00052
00053
00054
00055
00056 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00057 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_REAL_MAJOR 2
00058 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_REAL_MINOR 3
00059 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_REAL_REVISION 4
00060 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_REAL_EDIT 26
00061 #endif
00062
00063
00064
00065
00066
00067 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00068 # include <pantheios/pantheios.h>
00069 #endif
00070 #ifndef PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_FMT
00071 # include <pantheios/inserters/fmt.hpp>
00072 #endif
00073
00074 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_STRING_H_FWD
00075 # include <stlsoft/shims/access/string/fwd.h>
00076 #endif
00077
00078
00079
00080
00081
00082 #if !defined(PANTHEIOS_NO_NAMESPACE)
00083 namespace pantheios
00084 {
00085
00086 #endif
00087
00088
00089
00090
00091
00120 class real
00121 {
00122 public:
00124 typedef real class_type;
00125
00126 public:
00131 explicit real(float value, int widthAndFormat = 0);
00136 explicit real(double value, int widthAndFormat = 0);
00141 explicit real(long double value, int widthAndFormat = 0);
00142
00143 private:
00144 explicit real(int);
00145
00146 public:
00148 pan_char_t const* data() const;
00150 pan_char_t const* c_str() const;
00152 size_t length() const;
00153
00154 private:
00155 void construct_() const;
00156 void construct_();
00157
00158 private:
00159 enum RealSize
00160 {
00161 typeIsFloat = -1
00162 , typeIsDouble = -2
00163 , typeIsLongDouble = -3
00164 };
00165
00166 union u
00167 {
00168 float fValue;
00169 double dValue;
00170 long double ldValue;
00171 };
00172
00173 u m_value;
00174 size_t m_len;
00175 pan_char_t m_sz[256];
00176 const int m_widthAndFormat;
00177
00178 private:
00179 #if !defined(STLSOFT_COMPILER_IS_GCC)
00180 real(class_type const&);
00181 #endif
00182 class_type& operator =(class_type const&);
00183 };
00184
00185
00186
00187
00188
00189 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00190
00191 # if !defined(PANTHEIOS_NO_NAMESPACE)
00192 namespace shims
00193 {
00194 # endif
00195
00197 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00198 inline wchar_t const* c_str_data_w(real const& r)
00199 # else
00200 inline char const* c_str_data_a(real const& r)
00201 # endif
00202 {
00203 return r.data();
00204 }
00206 inline pan_char_t const* c_str_data(real const& r)
00207 {
00208 return r.data();
00209 }
00210
00212 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00213 inline size_t c_str_len_w(real const& r)
00214 # else
00215 inline size_t c_str_len_a(real const& r)
00216 # endif
00217 {
00218 return r.length();
00219 }
00221 inline size_t c_str_len(real const& r)
00222 {
00223 return r.length();
00224 }
00225
00227 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00228 inline wchar_t const* c_str_ptr_w(real const& r)
00229 # else
00230 inline char const* c_str_ptr_a(real const& r)
00231 # endif
00232 {
00233 return r.c_str();
00234 }
00236 inline pan_char_t const* c_str_ptr(real const& r)
00237 {
00238 return r.c_str();
00239 }
00240
00241 # if !defined(PANTHEIOS_NO_NAMESPACE)
00242 }
00243
00244 # if defined(STLSOFT_COMPILER_IS_GCC)
00245
00246
00247
00248
00249
00250 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00251 using ::pantheios::shims::c_str_data_w;
00252 using ::pantheios::shims::c_str_len_w;
00253 using ::pantheios::shims::c_str_ptr_w;
00254 # else
00255 using ::pantheios::shims::c_str_data_a;
00256 using ::pantheios::shims::c_str_len_a;
00257 using ::pantheios::shims::c_str_ptr_a;
00258 # endif
00259 using ::pantheios::shims::c_str_data;
00260 using ::pantheios::shims::c_str_len;
00261 using ::pantheios::shims::c_str_ptr;
00262 # endif
00263
00264 # endif
00265
00266 #endif
00267
00268
00269
00270
00271
00272 #if !defined(PANTHEIOS_NO_NAMESPACE)
00273 }
00274
00275 namespace stlsoft
00276 {
00277
00278
00279
00280
00281
00282
00283
00284 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00285 using ::pantheios::shims::c_str_data_w;
00286 using ::pantheios::shims::c_str_len_w;
00287 using ::pantheios::shims::c_str_ptr_w;
00288 # else
00289 using ::pantheios::shims::c_str_data_a;
00290 using ::pantheios::shims::c_str_len_a;
00291 using ::pantheios::shims::c_str_ptr_a;
00292 # endif
00293 using ::pantheios::shims::c_str_data;
00294 using ::pantheios::shims::c_str_len;
00295 using ::pantheios::shims::c_str_ptr;
00296 }
00297
00298 #endif
00299
00300
00301
00302
00303
00304 #ifdef STLSOFT_PPF_pragma_once_SUPPORT
00305 # pragma once
00306 #endif
00307
00308
00309
00310 #endif
00311
00312