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_BLOB
00050 #define PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_BLOB
00051
00052
00053
00054
00055
00056 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00057 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_BLOB_MAJOR 2
00058 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_BLOB_MINOR 4
00059 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_BLOB_REVISION 4
00060 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_BLOB_EDIT 27
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 #ifndef PANTHEIOS_INCL_H_STDIO
00079 # define PANTHEIOS_INCL_H_STDIO
00080 # include <stdio.h>
00081 #endif
00082
00083
00084
00085
00086
00087 #if !defined(PANTHEIOS_NO_NAMESPACE)
00088 namespace pantheios
00089 {
00090
00091 #endif
00092
00093
00094
00095
00096
00153 class blob
00154 {
00157 public:
00158 typedef blob class_type;
00160
00163 public:
00169 blob( void const* pv
00170 , size_t cb);
00171
00181 blob( void const* pv
00182 , size_t cb
00183 , unsigned bytesPerGroup
00184 , pan_char_t const* groupSeparator);
00185
00198 blob( void const* pv
00199 , size_t cb
00200 , unsigned bytesPerGroup
00201 , pan_char_t const* groupSeparator
00202 , int groupsPerLine
00203 , pan_char_t const* lineSeparator = PANTHEIOS_LITERAL_STRING("\n")
00204 );
00205
00207 ~blob() stlsoft_throw_0();
00209
00212 public:
00214 pan_char_t const* data() const;
00216 pan_char_t const* c_str() const;
00218 size_t length() const;
00220
00223 private:
00224 void construct_() const;
00225 void construct_();
00227
00230 private:
00231 pan_char_t const* m_value;
00232 size_t m_len;
00233 void const* const m_pv;
00234 size_t m_cb;
00235 unsigned m_byteGrouping;
00236 pan_char_t const* m_groupSeparator;
00237 int m_groupsPerLine;
00238 pan_char_t const* m_lineSeparator;
00240
00243 private:
00244 #if !defined(STLSOFT_COMPILER_IS_GCC)
00245 blob(class_type const&);
00246 #endif
00247 class_type& operator =(class_type const&);
00249 };
00250
00251
00252
00253
00254
00255 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00256
00257 # if !defined(PANTHEIOS_NO_NAMESPACE)
00258 namespace shims
00259 {
00260 # endif
00261
00263 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00264 inline wchar_t const* c_str_data_w(blob const& b)
00265 {
00266 return b.data();
00267 }
00268 # else
00269 inline char const* c_str_data_a(blob const& b)
00270 {
00271 return b.data();
00272 }
00273 # endif
00274
00275 inline pan_char_t const* c_str_data(blob const& b)
00276 {
00277 return b.data();
00278 }
00279
00281 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00282 inline size_t c_str_len_w(blob const& b)
00283 # else
00284 inline size_t c_str_len_a(blob const& b)
00285 # endif
00286 {
00287 return b.length();
00288 }
00290 inline size_t c_str_len(blob const& b)
00291 {
00292 return b.length();
00293 }
00294
00296 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00297 inline wchar_t const* c_str_ptr_w(blob const& b)
00298 {
00299 return b.c_str();
00300 }
00301 # else
00302 inline char const* c_str_ptr_a(blob const& b)
00303 {
00304 return b.c_str();
00305 }
00306 # endif
00307
00308 inline pan_char_t const* c_str_ptr(blob const& b)
00309 {
00310 return b.c_str();
00311 }
00312
00313 # if !defined(PANTHEIOS_NO_NAMESPACE)
00314 }
00315
00316 # if defined(STLSOFT_COMPILER_IS_GCC)
00317
00318
00319
00320
00321
00322 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00323 using ::pantheios::shims::c_str_data_w;
00324 using ::pantheios::shims::c_str_len_w;
00325 using ::pantheios::shims::c_str_ptr_w;
00326 # else
00327 using ::pantheios::shims::c_str_data_a;
00328 using ::pantheios::shims::c_str_len_a;
00329 using ::pantheios::shims::c_str_ptr_a;
00330 # endif
00331 using ::pantheios::shims::c_str_data;
00332 using ::pantheios::shims::c_str_len;
00333 using ::pantheios::shims::c_str_ptr;
00334 # endif
00335
00336 # endif
00337
00338 #endif
00339
00340
00341
00342
00343
00344 #if !defined(PANTHEIOS_NO_NAMESPACE)
00345 }
00346
00347 namespace stlsoft
00348 {
00349
00350
00351
00352
00353
00354
00355
00356 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00357 using ::pantheios::shims::c_str_data_w;
00358 using ::pantheios::shims::c_str_len_w;
00359 using ::pantheios::shims::c_str_ptr_w;
00360 # else
00361 using ::pantheios::shims::c_str_data_a;
00362 using ::pantheios::shims::c_str_len_a;
00363 using ::pantheios::shims::c_str_ptr_a;
00364 # endif
00365 using ::pantheios::shims::c_str_data;
00366 using ::pantheios::shims::c_str_len;
00367 using ::pantheios::shims::c_str_ptr;
00368 }
00369
00370 #endif
00371
00372
00373
00374
00375
00376 #ifdef STLSOFT_PPF_pragma_once_SUPPORT
00377 # pragma once
00378 #endif
00379
00380
00381
00382 #endif
00383
00384