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
00047 #ifndef PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_BOOLEAN
00048 #define PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_BOOLEAN
00049
00050
00051
00052
00053
00054 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00055 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_BOOLEAN_MAJOR 1
00056 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_BOOLEAN_MINOR 3
00057 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_BOOLEAN_REVISION 3
00058 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_BOOLEAN_EDIT 17
00059 #endif
00060
00061
00062
00063
00064
00065 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00066 # include <pantheios/pantheios.h>
00067 #endif
00068
00069 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_STRING_H_FWD
00070 # include <stlsoft/shims/access/string/fwd.h>
00071 #endif
00072
00073
00074
00075
00076
00077 #if !defined(PANTHEIOS_NO_NAMESPACE)
00078 namespace pantheios
00079 {
00080 #else
00081 # if defined(__RPCNDR_H__)
00082 # error pantheios::boolean may not be used with Windows when namespace is suspended. If you are including pantheios/inserters.hpp, try including only those specific inserter files that you need
00083 # endif
00084 #endif
00085
00086
00087
00088
00089
00112 class boolean
00113 {
00116 public:
00117 typedef boolean class_type;
00119
00122 public:
00126 explicit boolean(bool value)
00127 : m_value(value)
00128 {}
00129 private:
00130 class_type& operator =(class_type const&);
00132
00135 public:
00136 static void set_value_strings(pan_char_t const* falseName, pan_char_t const* trueName) ;
00138
00141 public:
00143 pan_char_t const* data() const
00144 {
00145 return get_slice_(m_value)->ptr;
00146 }
00148 pan_char_t const* c_str() const
00149 {
00150 return get_slice_(m_value)->ptr;
00151 }
00153 size_t length() const
00154 {
00155 return get_slice_(m_value)->len;
00156 }
00158
00161 private:
00162 virtual
00163 pan_slice_t const* get_slice_(bool value) const
00164 {
00165 return get_slice_(0, value);
00166 }
00167 protected:
00168 static pan_slice_t const* get_slice_(
00169 int index
00170 , bool value
00171 );
00173
00176 protected:
00177 const bool m_value;
00179 };
00180
00181
00182
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
00196 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00197
00198 inline wchar_t const* c_str_data_w(boolean const& b)
00199 {
00200 return b.data();
00201 }
00202 # else
00203
00204 inline char const* c_str_data_a(boolean const& b)
00205 {
00206 return b.data();
00207 }
00208 # endif
00209
00210 inline pan_char_t const* c_str_data(boolean const& b)
00211 {
00212 return b.data();
00213 }
00214
00215 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00216
00217 inline size_t c_str_len_w(boolean const& b)
00218 {
00219 return b.length();
00220 }
00221 # else
00222
00223 inline size_t c_str_len_a(boolean const& b)
00224 {
00225 return b.length();
00226 }
00227 # endif
00228
00229 inline size_t c_str_len(boolean const& b)
00230 {
00231 return b.length();
00232 }
00233
00234 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00235
00236 inline wchar_t const* c_str_ptr_w(boolean const& b)
00237 {
00238 return b.c_str();
00239 }
00240 # else
00241
00242 inline char const* c_str_ptr_a(boolean const& b)
00243 {
00244 return b.c_str();
00245 }
00246 # endif
00247
00248 inline pan_char_t const* c_str_ptr(boolean const& b)
00249 {
00250 return b.c_str();
00251 }
00252
00253 # if !defined(PANTHEIOS_NO_NAMESPACE)
00254 }
00255
00256 # if defined(STLSOFT_COMPILER_IS_GCC)
00257
00258
00259
00260
00261
00262 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00263 using ::pantheios::shims::c_str_data_w;
00264 using ::pantheios::shims::c_str_len_w;
00265 using ::pantheios::shims::c_str_ptr_w;
00266 # else
00267 using ::pantheios::shims::c_str_data_a;
00268 using ::pantheios::shims::c_str_len_a;
00269 using ::pantheios::shims::c_str_ptr_a;
00270 # endif
00271 using ::pantheios::shims::c_str_data;
00272 using ::pantheios::shims::c_str_len;
00273 using ::pantheios::shims::c_str_ptr;
00274 # endif
00275
00276 # endif
00277
00278 #endif
00279
00280
00281
00282
00283
00284 #if !defined(PANTHEIOS_NO_NAMESPACE)
00285 }
00286
00287 namespace stlsoft
00288 {
00289
00290
00291
00292
00293
00294
00295
00296 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00297 using ::pantheios::shims::c_str_data_w;
00298 using ::pantheios::shims::c_str_len_w;
00299 using ::pantheios::shims::c_str_ptr_w;
00300 # else
00301 using ::pantheios::shims::c_str_data_a;
00302 using ::pantheios::shims::c_str_len_a;
00303 using ::pantheios::shims::c_str_ptr_a;
00304 # endif
00305
00306 using ::pantheios::shims::c_str_data;
00307 using ::pantheios::shims::c_str_len;
00308 using ::pantheios::shims::c_str_ptr;
00309 }
00310
00311 #endif
00312
00313
00314
00315
00316
00317 #ifdef STLSOFT_PPF_pragma_once_SUPPORT
00318 # pragma once
00319 #endif
00320
00321
00322
00323 #endif
00324
00325