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
00073 #ifndef PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_CHARACTER
00074 #define PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_CHARACTER
00075
00076
00077
00078
00079
00080 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00081 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_CHARACTER_MAJOR 1
00082 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_CHARACTER_MINOR 5
00083 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_CHARACTER_REVISION 2
00084 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_CHARACTER_EDIT 24
00085 #endif
00086
00087
00088
00089
00090
00091 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00092 # include <pantheios/pantheios.h>
00093 #endif
00094 #ifndef PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_FMT
00095 # include <pantheios/inserters/fmt.hpp>
00096 #endif
00097
00098 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_STRING_H_FWD
00099 # include <stlsoft/shims/access/string/fwd.h>
00100 #endif
00101
00102
00103
00104
00105
00106 #if !defined(PANTHEIOS_NO_NAMESPACE)
00107 namespace pantheios
00108 {
00109
00110 #endif
00111
00112
00113
00114
00115
00145 class character
00146 {
00147 public:
00149 typedef character class_type;
00150
00151 public:
00153 explicit character(pan_char_t value);
00154
00155 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00156 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00157 explicit character(char value);
00158 # endif
00159 #endif
00160
00161 private:
00162 explicit character(int);
00163
00164 public:
00166 pan_char_t const* data() const;
00168 pan_char_t const* c_str() const;
00170 size_t length() const;
00171
00172 private:
00173 pan_char_t m_value[2];
00174
00175 private:
00176 #if !defined(STLSOFT_COMPILER_IS_GCC)
00177 character(class_type const&);
00178 #endif
00179 class_type& operator =(class_type const&);
00180 };
00181
00182
00183
00184
00185
00186 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00187
00188 # if !defined(PANTHEIOS_NO_NAMESPACE)
00189 namespace shims
00190 {
00191 # endif
00192
00194 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00195 inline wchar_t const* c_str_data_w(character const& r)
00196 # else
00197 inline char const* c_str_data_a(character const& r)
00198 # endif
00199 {
00200 return r.data();
00201 }
00203 inline pan_char_t const* c_str_data(character const& r)
00204 {
00205 return r.data();
00206 }
00207
00209 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00210 inline size_t c_str_len_w(character const& r)
00211 # else
00212 inline size_t c_str_len_a(character const& r)
00213 # endif
00214 {
00215 return r.length();
00216 }
00218 inline size_t c_str_len(character const& r)
00219 {
00220 return r.length();
00221 }
00222
00224 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00225 inline wchar_t const* c_str_ptr_a(character const& r)
00226 # else
00227 inline char const* c_str_ptr_a(character const& r)
00228 # endif
00229 {
00230 return r.c_str();
00231 }
00233 inline pan_char_t const* c_str_ptr(character const& r)
00234 {
00235 return r.c_str();
00236 }
00237
00238 # if !defined(PANTHEIOS_NO_NAMESPACE)
00239 }
00240
00241 # if defined(STLSOFT_COMPILER_IS_GCC)
00242
00243
00244
00245
00246
00247 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00248 using ::pantheios::shims::c_str_data_w;
00249 using ::pantheios::shims::c_str_len_w;
00250 using ::pantheios::shims::c_str_ptr_w;
00251 # else
00252 using ::pantheios::shims::c_str_data_a;
00253 using ::pantheios::shims::c_str_len_a;
00254 using ::pantheios::shims::c_str_ptr_a;
00255 # endif
00256 using ::pantheios::shims::c_str_data;
00257 using ::pantheios::shims::c_str_len;
00258 using ::pantheios::shims::c_str_ptr;
00259 # endif
00260
00261 # endif
00262
00263 #endif
00264
00265
00266
00267
00268
00269 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00270
00271 inline character::character(pan_char_t value)
00272 {
00273 m_value[0] = value;
00274 m_value[1] = '\0';
00275 }
00276
00277 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00278 inline character::character(char value)
00279 {
00280 m_value[0] = value;
00281 m_value[1] = '\0';
00282 }
00283 # endif
00284
00285 inline pan_char_t const* character::data() const
00286 {
00287 return m_value;
00288 }
00289
00290 inline pan_char_t const* character::c_str() const
00291 {
00292 return m_value;
00293 }
00294
00295 inline size_t character::length() const
00296 {
00297 return 1;
00298 }
00299
00300 #endif
00301
00302
00303
00304
00305
00306 #if !defined(PANTHEIOS_NO_NAMESPACE)
00307 }
00308
00309 namespace stlsoft
00310 {
00311
00312
00313
00314
00315
00316
00317
00318 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00319 using ::pantheios::shims::c_str_data_w;
00320 using ::pantheios::shims::c_str_len_w;
00321 using ::pantheios::shims::c_str_ptr_w;
00322 # else
00323 using ::pantheios::shims::c_str_data_a;
00324 using ::pantheios::shims::c_str_len_a;
00325 using ::pantheios::shims::c_str_ptr_a;
00326 # endif
00327 using ::pantheios::shims::c_str_data;
00328 using ::pantheios::shims::c_str_len;
00329 using ::pantheios::shims::c_str_ptr;
00330 }
00331
00332 #endif
00333
00334
00335
00336
00337
00338 #ifdef STLSOFT_PPF_pragma_once_SUPPORT
00339 # pragma once
00340 #endif
00341
00342
00343
00344 #endif
00345
00346