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_ARGS
00049 #define PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_ARGS
00050
00051
00052
00053
00054
00055 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00056 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_ARGS_MAJOR 1
00057 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_ARGS_MINOR 6
00058 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_ARGS_REVISION 4
00059 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_ARGS_EDIT 28
00060 #endif
00061
00062
00063
00064
00065
00066 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00067 # include <pantheios/pantheios.h>
00068 #endif
00069
00070 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_STRING_H_FWD
00071 # include <stlsoft/shims/access/string/fwd.h>
00072 #endif
00073
00074 #include <string>
00075
00076
00077
00078
00079
00080 #if !defined(PANTHEIOS_NO_NAMESPACE)
00081 namespace pantheios
00082 {
00083 #endif
00084
00085
00086
00087
00088
00142 class args
00143 {
00146 public:
00147 typedef args class_type;
00149
00152 public:
00154 enum format_flags
00155 {
00156 neverQuoteArgs = 0x0000
00157 , quoteArgsWithSpaces = 0x0001
00158 , alwaysQuoteArgs = 0x0002
00159 , arg0FileOnly = 0x0004
00160 };
00162
00165 public:
00174 args(int argc, pan_char_t const* const* argv, int flags = quoteArgsWithSpaces, pan_char_t const* separator = PANTHEIOS_LITERAL_STRING(", "));
00175
00176 #ifdef STLSOFT_COMPILER_IS_BORLAND
00177 args(int argc, pan_char_t** argv, int flags = quoteArgsWithSpaces, pan_char_t const* separator = PANTHEIOS_LITERAL_STRING(", "));
00178 #endif
00179
00180 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00181 ~args() stlsoft_throw_0();
00182 #endif
00184
00187 public:
00189 pan_char_t const* data() const;
00191 pan_char_t const* c_str() const;
00193 size_t size() const;
00195
00198 private:
00199 void construct_() const;
00200 void construct_();
00202
00205 private:
00206 typedef std::basic_string<pan_char_t> string_type_;
00207
00208 const int m_flags;
00209 const int m_argc;
00210 pan_char_t const* const* m_argv;
00211 const string_type_ m_separator;
00212 string_type_ m_result;
00214
00217 private:
00218 #if !defined(STLSOFT_COMPILER_IS_GCC)
00219 args(class_type const&);
00220 #endif
00221 class_type& operator =(class_type const&);
00223 };
00224
00225
00226
00227
00228
00229 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00230
00231 # if !defined(PANTHEIOS_NO_NAMESPACE)
00232 namespace shims
00233 {
00234 # endif
00235
00237 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00238 inline wchar_t const* c_str_data_w(args const& a)
00239 {
00240 return a.data();
00241 }
00242 # else
00243 inline char const* c_str_data_a(args const& a)
00244 {
00245 return a.data();
00246 }
00247 # endif
00248
00249 inline pan_char_t const* c_str_data(args const& a)
00250 {
00251 return a.data();
00252 }
00253
00255 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00256 inline size_t c_str_len_w(args const& a)
00257 # else
00258 inline size_t c_str_len_a(args const& a)
00259 # endif
00260 {
00261 return a.size();
00262 }
00264 inline size_t c_str_len(args const& a)
00265 {
00266 return a.size();
00267 }
00268
00270 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00271 inline wchar_t const* c_str_ptr_w(args const& a)
00272 {
00273 return a.c_str();
00274 }
00275 # else
00276 inline char const* c_str_ptr_a(args const& a)
00277 {
00278 return a.c_str();
00279 }
00280 # endif
00281
00282 inline pan_char_t const* c_str_ptr(args const& a)
00283 {
00284 return a.c_str();
00285 }
00286
00287 # if !defined(PANTHEIOS_NO_NAMESPACE)
00288 }
00289
00290 # if defined(STLSOFT_COMPILER_IS_GCC)
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 using ::pantheios::shims::c_str_data;
00306 using ::pantheios::shims::c_str_len;
00307 using ::pantheios::shims::c_str_ptr;
00308 # endif
00309
00310 # endif
00311
00312 #endif
00313
00314
00315
00316
00317
00318 #if !defined(PANTHEIOS_NO_NAMESPACE)
00319 }
00320
00321 namespace stlsoft
00322 {
00323
00324
00325
00326
00327
00328
00329
00330 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00331 using ::pantheios::shims::c_str_data_w;
00332 using ::pantheios::shims::c_str_len_w;
00333 using ::pantheios::shims::c_str_ptr_w;
00334 # else
00335 using ::pantheios::shims::c_str_data_a;
00336 using ::pantheios::shims::c_str_len_a;
00337 using ::pantheios::shims::c_str_ptr_a;
00338 # endif
00339 using ::pantheios::shims::c_str_data;
00340 using ::pantheios::shims::c_str_len;
00341 using ::pantheios::shims::c_str_ptr;
00342 }
00343
00344 #endif
00345
00346
00347
00348
00349
00350 #ifdef STLSOFT_PPF_pragma_once_SUPPORT
00351 # pragma once
00352 #endif
00353
00354
00355
00356 #endif
00357
00358