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
00048 #ifndef PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_PAD
00049 #define PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_PAD
00050
00051
00052
00053
00054
00055 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00056 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_PAD_MAJOR 1
00057 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_PAD_MINOR 0
00058 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_PAD_REVISION 3
00059 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_PAD_EDIT 5
00060 #endif
00061
00062
00063
00064
00065
00066 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00067 # include <pantheios/pantheios.h>
00068 #endif
00069
00070 #include <stlsoft/memory/auto_buffer.hpp>
00071 #include <stlsoft/shims/access/string.hpp>
00072
00073
00074
00075
00076
00077 #if !defined(PANTHEIOS_NO_NAMESPACE)
00078 namespace pantheios
00079 {
00080 #endif
00081
00082
00083
00084
00085
00086 #ifdef PANTHEIOS_CF_NAMESPACE_SUPPORT
00087
00088
00089 #endif
00090
00094 class slice_inserter
00095 {
00098 public:
00099 typedef slice_inserter class_type;
00100 private:
00101 typedef stlsoft::auto_buffer<pan_char_t, 256> buffer_type_;
00103
00106 public:
00107 slice_inserter(
00108 pan_char_t const* str
00109 , size_t len
00110 , pan_char_t const* strName
00111 , pan_char_t const* lenName
00112 , pan_char_t const* equals
00113 , pan_char_t const* separator
00114 );
00115 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00116 slice_inserter(class_type const& rhs);
00117 #endif
00119
00122 public:
00124 pan_char_t const* data() const;
00126 pan_char_t const* c_str() const;
00128 size_t length() const;
00130
00133 private:
00134 void construct_() const;
00135 void construct_();
00137
00140 private:
00141 pan_char_t const* m_str;
00142 size_t m_len;
00143 pan_char_t const* m_strName;
00144 pan_char_t const* m_lenName;
00145 pan_char_t const* m_equals;
00146 pan_char_t const* m_separator;
00147 buffer_type_ m_buffer;
00149
00152 private:
00153 class_type& operator =(class_type const&);
00155 };
00156
00157 #ifdef PANTHEIOS_CF_NAMESPACE_SUPPORT
00158
00159
00160 #endif
00161
00162
00163
00164
00165
00172 inline pan_slice_t slice(
00173 pan_char_t const* str
00174 , size_t len
00175 )
00176 {
00177 return pan_slice_t(str, len);
00178 }
00179
00186 inline slice_inserter slice(
00187 pan_char_t const* str
00188 , size_t len
00189 , pan_char_t const* strName
00190 )
00191 {
00192 return slice_inserter(str, len, strName, NULL, NULL, NULL);
00193 }
00194
00202 inline slice_inserter slice(
00203 pan_char_t const* str
00204 , size_t len
00205 , pan_char_t const* strName
00206 , pan_char_t const* lenName
00207 )
00208 {
00209 return slice_inserter(str, len, strName, lenName, NULL, NULL);
00210 }
00211
00220 inline slice_inserter slice(
00221 pan_char_t const* str
00222 , size_t len
00223 , pan_char_t const* strName
00224 , pan_char_t const* lenName
00225 , pan_char_t const* equals
00226 )
00227 {
00228 return slice_inserter(str, len, strName, lenName, equals, NULL);
00229 }
00230
00240 inline slice_inserter slice(
00241 pan_char_t const* str
00242 , size_t len
00243 , pan_char_t const* strName
00244 , pan_char_t const* lenName
00245 , pan_char_t const* equals
00246 , pan_char_t const* separator
00247 )
00248 {
00249 return slice_inserter(str, len, strName, lenName, equals, separator);
00250 }
00251
00252
00253
00254
00255
00256 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00257
00258 # if !defined(PANTHEIOS_NO_NAMESPACE)
00259 namespace shims
00260 {
00261 # endif
00262
00264 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00265 inline wchar_t const* c_str_data_w(slice_inserter const& i)
00266 # else
00267 inline char const* c_str_data_a(slice_inserter const& i)
00268 # endif
00269 {
00270 return i.data();
00271 }
00273 inline pan_char_t const* c_str_data(slice_inserter const& i)
00274 {
00275 return i.data();
00276 }
00277
00279 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00280 inline size_t c_str_len_w(slice_inserter const& i)
00281 # else
00282 inline size_t c_str_len_a(slice_inserter const& i)
00283 # endif
00284 {
00285 return i.length();
00286 }
00288 inline size_t c_str_len(slice_inserter const& i)
00289 {
00290 return i.length();
00291 }
00292
00294 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00295 inline wchar_t const* c_str_ptr_w(slice_inserter const& i)
00296 # else
00297 inline char const* c_str_ptr_a(slice_inserter const& i)
00298 # endif
00299 {
00300 return i.c_str();
00301 }
00303 inline pan_char_t const* c_str_ptr(slice_inserter const& i)
00304 {
00305 return i.c_str();
00306 }
00307
00308 # if !defined(PANTHEIOS_NO_NAMESPACE)
00309 }
00310
00311 # if defined(STLSOFT_COMPILER_IS_GCC)
00312
00313
00314
00315
00316
00317 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00318 using ::pantheios::shims::c_str_data_w;
00319 using ::pantheios::shims::c_str_len_w;
00320 using ::pantheios::shims::c_str_ptr_w;
00321 # else
00322 using ::pantheios::shims::c_str_data_a;
00323 using ::pantheios::shims::c_str_len_a;
00324 using ::pantheios::shims::c_str_ptr_a;
00325 # endif
00326 using ::pantheios::shims::c_str_data;
00327 using ::pantheios::shims::c_str_len;
00328 using ::pantheios::shims::c_str_ptr;
00329 # endif
00330
00331 # endif
00332
00333 #endif
00334
00335
00336
00337
00338
00339 #if !defined(PANTHEIOS_NO_NAMESPACE)
00340 }
00341
00342 namespace stlsoft
00343 {
00344
00345
00346
00347
00348
00349
00350
00351 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00352 using ::pantheios::shims::c_str_data_w;
00353 using ::pantheios::shims::c_str_len_w;
00354 using ::pantheios::shims::c_str_ptr_w;
00355 # else
00356 using ::pantheios::shims::c_str_data_a;
00357 using ::pantheios::shims::c_str_len_a;
00358 using ::pantheios::shims::c_str_ptr_a;
00359 # endif
00360 using ::pantheios::shims::c_str_data;
00361 using ::pantheios::shims::c_str_len;
00362 using ::pantheios::shims::c_str_ptr;
00363 }
00364
00365 #endif
00366
00367
00368
00369
00370
00371 #ifdef STLSOFT_PPF_pragma_once_SUPPORT
00372 # pragma once
00373 #endif
00374
00375
00376
00377 #endif
00378
00379