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
00043
00051 #ifndef WINSTL_INCL_WINSTL_SHIMS_ACCESS_STRING_HPP_TIME
00052 #define WINSTL_INCL_WINSTL_SHIMS_ACCESS_STRING_HPP_TIME
00053
00054 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00055 # define WINSTL_VER_WINSTL_SHIMS_ACCESS_STRING_HPP_TIME_MAJOR 2
00056 # define WINSTL_VER_WINSTL_SHIMS_ACCESS_STRING_HPP_TIME_MINOR 3
00057 # define WINSTL_VER_WINSTL_SHIMS_ACCESS_STRING_HPP_TIME_REVISION 6
00058 # define WINSTL_VER_WINSTL_SHIMS_ACCESS_STRING_HPP_TIME_EDIT 53
00059 #endif
00060
00061
00062
00063
00064
00065 #ifndef WINSTL_INCL_WINSTL_H_WINSTL
00066 # include <winstl/winstl.h>
00067 #endif
00068 #ifndef WINSTL_INCL_WINSTL_ERROR_HPP_CONVERSION_ERROR
00069 # include <winstl/error/conversion_error.hpp>
00070 #endif
00071 #ifndef WINSTL_INCL_WINSTL_SHIMS_CONVERSION_TO_SYSTEMTIME_HPP_FILETIME
00072 # include <winstl/shims/conversion/to_SYSTEMTIME/FILETIME.hpp>
00073 #endif
00074 #ifndef WINSTL_INCL_WINSTL_TIME_HPP_FORMAT_FUNCTIONS
00075 # include <winstl/time/format_functions.hpp>
00076 #endif
00077 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_STRING_STD_H_C_STRING
00078 # include <stlsoft/shims/access/string/std/c_string.h>
00079 #endif
00080 #ifndef STLSOFT_INCL_STLSOFT_STRING_HPP_SHIM_STRING
00081 # include <stlsoft/string/shim_string.hpp>
00082 #endif
00083 #ifdef WINSTL_UDATE_DEFINED
00084 # include <objbase.h>
00085 # include <oleauto.h>
00086 #endif
00087
00088
00089
00090
00091
00092 #ifndef _WINSTL_NO_NAMESPACE
00093 # if defined(_STLSOFT_NO_NAMESPACE) || \
00094 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00095
00096 namespace winstl
00097 {
00098 # else
00099
00100
00101 namespace stlsoft
00102 {
00103
00104 namespace winstl_project
00105 {
00106
00107 # endif
00108 #endif
00109
00110
00111
00112
00113
00114 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00115 struct winstl_shims_access_string_time_impl
00116 {
00117 typedef int (STLSOFT_STDCALL *pfnGetDateTimeFmtA_t)(LCID Locale
00118 , DWORD dwFlags
00119 , CONST SYSTEMTIME *lpTime
00120 , ws_char_a_t const *lpFormat
00121 , ws_char_a_t *lpTimeStr
00122 , int cchTime);
00123
00124 typedef int (STLSOFT_STDCALL *pfnGetDateTimeFmtW_t)(LCID Locale
00125 , DWORD dwFlags
00126 , CONST SYSTEMTIME *lpTime
00127 , ws_char_w_t const *lpFormat
00128 , ws_char_w_t *lpTimeStr
00129 , int cchTime);
00130
00131
00132 static ws_size_t calc_sizes(SYSTEMTIME const& t
00133 , pfnGetDateTimeFmtA_t pfnGetDateFmtA
00134 , pfnGetDateTimeFmtA_t pfnGetTimeFmtA
00135 , ws_size_t& cchDate
00136 , ws_size_t& cchTime)
00137 {
00138 cchDate = static_cast<ws_size_t>(pfnGetDateFmtA(LOCALE_USER_DEFAULT, 0, &t, NULL, NULL, 0));
00139
00140 if(0 != cchDate)
00141 {
00142 cchTime = static_cast<ws_size_t>(pfnGetTimeFmtA(LOCALE_USER_DEFAULT, 0, &t, NULL, NULL, 0));
00143
00144 if(0 != cchTime)
00145 {
00146 return (cchDate - 1) + 1 + (cchTime - 1);
00147 }
00148 }
00149
00150 #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
00151 throw conversion_error("failed to convert date/time", ::GetLastError());
00152 #endif
00153
00154 #if !defined(STLSOFT_CF_EXCEPTION_SUPPORT) || \
00155 defined(STLSOFT_CF_REQUIRE_RETURN_ALWAYS)
00156 return 0;
00157 #endif
00158 }
00159
00160
00161 static ws_size_t calc_sizes(SYSTEMTIME const& t
00162 , pfnGetDateTimeFmtW_t pfnGetDateFmtW
00163 , pfnGetDateTimeFmtW_t pfnGetTimeFmtW
00164 , ws_size_t& cchDate
00165 , ws_size_t& cchTime)
00166 {
00167 cchDate = static_cast<ws_size_t>(pfnGetDateFmtW(LOCALE_USER_DEFAULT, 0, &t, NULL, NULL, 0));
00168
00169 if(0 != cchDate)
00170 {
00171 cchTime = static_cast<ws_size_t>(pfnGetTimeFmtW(LOCALE_USER_DEFAULT, 0, &t, NULL, NULL, 0));
00172
00173 if(0 != cchTime)
00174 {
00175 return (cchDate - 1) + 1 + (cchTime - 1);
00176 }
00177 }
00178
00179 #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
00180 throw conversion_error("failed to convert date/time", ::GetLastError());
00181 #endif
00182
00183 #if !defined(STLSOFT_CF_EXCEPTION_SUPPORT) || \
00184 defined(STLSOFT_CF_REQUIRE_RETURN_ALWAYS)
00185 return 0;
00186 #endif
00187 }
00188 };
00189 #endif
00190
00191
00192
00193
00194
00209 inline SYSTEMTIME FILETIME2SYSTEMTIME(FILETIME const& ft)
00210 {
00211 return winstl_ns_qual(to_SYSTEMTIME)(ft);
00212 }
00213
00214 template <ss_typename_param_k S>
00215 inline void stream_insert(S &stm, SYSTEMTIME const& t)
00216 {
00217 typedef stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> string_t;
00218 typedef winstl_shims_access_string_time_impl impl_t;
00219
00220 ws_size_t cchDate = 0;
00221 ws_size_t cchTime = 0;
00222 const ws_size_t cchTotal = impl_t::calc_sizes(t, ::GetDateFormatA, ::GetTimeFormatA, cchDate, cchTime);
00223
00224 #ifdef STLSOFT_CD_EXCEPTION_SUPPORT
00225 WINSTL_ASSERT(0 != cchTotal);
00226 #else
00227 if(0 != cchTotal)
00228 #endif
00229 {
00230 string_t s(cchTotal);
00231
00232 if(cchTotal == s.size())
00233 {
00234 ::GetDateFormatA(LOCALE_USER_DEFAULT, 0, &t, NULL, &s.data()[0], static_cast<int>(cchDate));
00235 s.data()[cchDate - 1] = ' ';
00236 ::GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &t, NULL, &s.data()[0] + cchDate, static_cast<int>(cchTime));
00237
00238
00239
00240
00241
00242
00243 s.data()[cchTotal] = '\0';
00244 }
00245
00246 stm << s.data();
00247 }
00248 }
00249
00250 template <ss_typename_param_k S>
00251 inline void stream_insert(S &stm, FILETIME const& ft)
00252 {
00253 stream_insert(stm, FILETIME2SYSTEMTIME(ft));
00254 }
00255
00256 #ifdef WINSTL_UDATE_DEFINED
00257
00258 template <ss_typename_param_k S>
00259 inline void stream_insert(S &stm, UDATE const& ud)
00260 {
00261 stream_insert(stm, ud.st);
00262 }
00263
00264 #endif
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_a(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00277 {
00278 typedef stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> string_t;
00279 typedef winstl_shims_access_string_time_impl impl_t;
00280
00281 int (STLSOFT_STDCALL *pfnGetTimeFormatA)( LCID Locale
00282 , DWORD dwFlags
00283 , CONST SYSTEMTIME *lpTime
00284 , ws_char_a_t const *lpFormat
00285 , ws_char_a_t *lpTimeStr
00286 , int cchTime)
00287
00288 = bMilliseconds ? GetTimeFormat_msA : ::GetTimeFormatA;
00289
00290 ws_size_t cchDate = 0;
00291 ws_size_t cchTime = 0;
00292 const ws_size_t cchTotal = impl_t::calc_sizes(t, ::GetDateFormatA, pfnGetTimeFormatA, cchDate, cchTime);
00293 string_t s(cchTotal);
00294
00295 if( 0 != cchTotal &&
00296 cchTotal == s.size())
00297 {
00298 ::GetDateFormatA(LOCALE_USER_DEFAULT, 0, &t, NULL, &s.data()[0], static_cast<int>(cchDate));
00299 s.data()[cchDate - 1] = ' ';
00300 pfnGetTimeFormatA(LOCALE_USER_DEFAULT, 0, &t, NULL, &s.data()[0] + cchDate, static_cast<int>(cchTime));
00301
00302
00303
00304
00305
00306
00307 s.data()[cchTotal] = '\0';
00308 }
00309
00310 return s;
00311 }
00312 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_a(SYSTEMTIME const& t)
00313 {
00314 return c_str_ptr_a(t, ws_false_v);
00315 }
00316
00317 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_w(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00318 {
00319 typedef stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> string_t;
00320 typedef winstl_shims_access_string_time_impl impl_t;
00321
00322 int (STLSOFT_STDCALL *pfnGetTimeFormatW)( LCID Locale
00323 , DWORD dwFlags
00324 , CONST SYSTEMTIME *lpTime
00325 , ws_char_w_t const *lpFormat
00326 , ws_char_w_t *lpTimeStr
00327 , int cchTime)
00328
00329 = bMilliseconds ? GetTimeFormat_msW : ::GetTimeFormatW;
00330
00331 ws_size_t cchDate = 0;
00332 ws_size_t cchTime = 0;
00333 const ws_size_t cchTotal = impl_t::calc_sizes(t, ::GetDateFormatW, pfnGetTimeFormatW, cchDate, cchTime);
00334 string_t s(cchTotal);
00335
00336 if( 0 != cchTotal &&
00337 cchTotal == s.size())
00338 {
00339 ::GetDateFormatW(LOCALE_USER_DEFAULT, 0, &t, NULL, &s.data()[0], static_cast<int>(cchDate));
00340 s.data()[cchDate - 1] = ' ';
00341 pfnGetTimeFormatW(LOCALE_USER_DEFAULT, 0, &t, NULL, &s.data()[0] + cchDate, static_cast<int>(cchTime));
00342
00343
00344
00345
00346
00347
00348 s.data()[cchTotal] = '\0';
00349 }
00350
00351 return s;
00352 }
00353 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_w(SYSTEMTIME const& t)
00354 {
00355 return c_str_ptr_w(t, ws_false_v);
00356 }
00357
00358 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00359 {
00360 #ifdef UNICODE
00361 return c_str_ptr_w(t, bMilliseconds);
00362 #else
00363 return c_str_ptr_a(t, bMilliseconds);
00364 #endif
00365 }
00366 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr(SYSTEMTIME const& t)
00367 {
00368 return c_str_ptr(t, ws_false_v);
00369 }
00370
00371
00372
00373
00374 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_a(FILETIME const& t, ws_bool_t bMilliseconds)
00375 {
00376 return c_str_ptr_a(FILETIME2SYSTEMTIME(t), bMilliseconds);
00377 }
00378 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_a(FILETIME const& t)
00379 {
00380 return c_str_ptr_a(t, ws_false_v);
00381 }
00382
00383 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_w(FILETIME const& t, ws_bool_t bMilliseconds)
00384 {
00385 return c_str_ptr_w(FILETIME2SYSTEMTIME(t), bMilliseconds);
00386 }
00387 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_w(FILETIME const& t)
00388 {
00389 return c_str_ptr_w(t, ws_false_v);
00390 }
00391
00392 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr(FILETIME const& t, ws_bool_t bMilliseconds)
00393 {
00394 return c_str_ptr(FILETIME2SYSTEMTIME(t), bMilliseconds);
00395 }
00396 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr(FILETIME const& t)
00397 {
00398 return c_str_ptr(t, ws_false_v);
00399 }
00400
00401
00402 #ifdef WINSTL_UDATE_DEFINED
00403
00404
00405
00406 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_a(UDATE const& ud, ws_bool_t bMilliseconds)
00407 {
00408 return c_str_ptr_a(ud.st, bMilliseconds);
00409 }
00410
00411 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_a(UDATE const& ud)
00412 {
00413 return c_str_ptr_a(ud.st);
00414 }
00415
00416 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_w(UDATE const& ud, ws_bool_t bMilliseconds)
00417 {
00418 return c_str_ptr_w(ud.st, bMilliseconds);
00419 }
00420
00421 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_w(UDATE const& ud)
00422 {
00423 return c_str_ptr_w(ud.st);
00424 }
00425
00426 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr(UDATE const& ud, ws_bool_t bMilliseconds)
00427 {
00428 return c_str_ptr(ud.st, bMilliseconds);
00429 }
00430
00431 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr(UDATE const& ud)
00432 {
00433 return c_str_ptr(ud.st);
00434 }
00435
00436 #endif
00437
00438
00439
00440
00441
00442
00443
00444 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_data_a(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00445 {
00446 return c_str_ptr_a(t, bMilliseconds);
00447 }
00448 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_data_a(SYSTEMTIME const& t)
00449 {
00450 return c_str_data_a(t, ws_false_v);
00451 }
00452
00453 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_data_w(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00454 {
00455 return c_str_ptr_w(t, bMilliseconds);
00456 }
00457 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_data_w(SYSTEMTIME const& t)
00458 {
00459 return c_str_data_w(t, ws_false_v);
00460 }
00461
00462 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_data(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00463 {
00464 #ifdef UNICODE
00465 return c_str_data_w(t, bMilliseconds);
00466 #else
00467 return c_str_data_a(t, bMilliseconds);
00468 #endif
00469 }
00470 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_data(SYSTEMTIME const& t)
00471 {
00472 return c_str_data(t, ws_false_v);
00473 }
00474
00475
00476
00477
00478 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_data_a(FILETIME const& t, ws_bool_t bMilliseconds)
00479 {
00480 return c_str_ptr_a(FILETIME2SYSTEMTIME(t), bMilliseconds);
00481 }
00482 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_data_a(FILETIME const& t)
00483 {
00484 return c_str_data_a(FILETIME2SYSTEMTIME(t), ws_false_v);
00485 }
00486
00487 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_data_w(FILETIME const& t, ws_bool_t bMilliseconds)
00488 {
00489 return c_str_ptr_w(FILETIME2SYSTEMTIME(t), bMilliseconds);
00490 }
00491 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_data_w(FILETIME const& t)
00492 {
00493 return c_str_data_w(FILETIME2SYSTEMTIME(t), ws_false_v);
00494 }
00495
00496 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_data(FILETIME const& t, ws_bool_t bMilliseconds)
00497 {
00498 return c_str_ptr(FILETIME2SYSTEMTIME(t), bMilliseconds);
00499 }
00500 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_data(FILETIME const& t)
00501 {
00502 return c_str_data(FILETIME2SYSTEMTIME(t), ws_false_v);
00503 }
00504
00505
00506
00507
00508 #ifdef WINSTL_UDATE_DEFINED
00509
00510 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_data_a(UDATE const& t, ws_bool_t bMilliseconds)
00511 {
00512 return c_str_ptr_a(t.st, bMilliseconds);
00513 }
00514 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_data_a(UDATE const& t)
00515 {
00516 return c_str_data_a(t.st, ws_false_v);
00517 }
00518
00519 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_data_w(UDATE const& t, ws_bool_t bMilliseconds)
00520 {
00521 return c_str_ptr_w(t.st, bMilliseconds);
00522 }
00523 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_data_w(UDATE const& t)
00524 {
00525 return c_str_data_w(t.st, ws_false_v);
00526 }
00527
00528 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_data(UDATE const& t, ws_bool_t bMilliseconds)
00529 {
00530 return c_str_ptr(t.st, bMilliseconds);
00531 }
00532 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_data(UDATE const& t)
00533 {
00534 return c_str_data(t.st, ws_false_v);
00535 }
00536
00537 #endif
00538
00539
00540
00541
00542
00543
00544
00545 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_null_a(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00546 {
00547 return c_str_ptr_a(t, bMilliseconds);
00548 }
00549 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_null_a(SYSTEMTIME const& t)
00550 {
00551 return c_str_ptr_null_a(t, ws_false_v);
00552 }
00553
00554
00555 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_null_w(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00556 {
00557 return c_str_ptr_w(t, bMilliseconds);
00558 }
00559 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_null_w(SYSTEMTIME const& t)
00560 {
00561 return c_str_ptr_null_w(t, ws_false_v);
00562 }
00563
00564
00565 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr_null(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00566 {
00567 return c_str_ptr(t, bMilliseconds);
00568 }
00569 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr_null(SYSTEMTIME const& t)
00570 {
00571 return c_str_ptr_null(t, ws_false_v);
00572 }
00573
00574
00575
00576
00577
00578 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_null_a(FILETIME const& t, ws_bool_t bMilliseconds)
00579 {
00580 return c_str_ptr_null_a(FILETIME2SYSTEMTIME(t), bMilliseconds);
00581 }
00582 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_null_a(FILETIME const& t)
00583 {
00584 return c_str_ptr_null_a(FILETIME2SYSTEMTIME(t), ws_false_v);
00585 }
00586
00587
00588 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_null_w(FILETIME const& t, ws_bool_t bMilliseconds)
00589 {
00590 return c_str_ptr_null_w(FILETIME2SYSTEMTIME(t), bMilliseconds);
00591 }
00592 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_null_w(FILETIME const& t)
00593 {
00594 return c_str_ptr_null_w(FILETIME2SYSTEMTIME(t), ws_false_v);
00595 }
00596
00597
00598 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr_null(FILETIME const& t, ws_bool_t bMilliseconds)
00599 {
00600 return c_str_ptr_null(FILETIME2SYSTEMTIME(t), bMilliseconds);
00601 }
00602 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr_null(FILETIME const& t)
00603 {
00604 return c_str_ptr_null(FILETIME2SYSTEMTIME(t), ws_false_v);
00605 }
00606
00607
00608
00609
00610 #ifdef WINSTL_UDATE_DEFINED
00611
00612 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_null_a(UDATE const& t, ws_bool_t bMilliseconds)
00613 {
00614 return c_str_ptr_null_a(t.st, bMilliseconds);
00615 }
00616 inline stlsoft_ns_qual(basic_shim_string)<ws_char_a_t> c_str_ptr_null_a(UDATE const& t)
00617 {
00618 return c_str_ptr_null_a(t.st, ws_false_v);
00619 }
00620
00621
00622 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_null_w(UDATE const& t, ws_bool_t bMilliseconds)
00623 {
00624 return c_str_ptr_null_w(t.st, bMilliseconds);
00625 }
00626 inline stlsoft_ns_qual(basic_shim_string)<ws_char_w_t> c_str_ptr_null_w(UDATE const& t)
00627 {
00628 return c_str_ptr_null_w(t.st, ws_false_v);
00629 }
00630
00631
00632 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr_null(UDATE const& t, ws_bool_t bMilliseconds)
00633 {
00634 return c_str_ptr_null(t.st, bMilliseconds);
00635 }
00636 inline stlsoft_ns_qual(basic_shim_string)<TCHAR> c_str_ptr_null(UDATE const& t)
00637 {
00638 return c_str_ptr_null(t.st, ws_false_v);
00639 }
00640
00641 #endif
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654 inline ws_size_t c_str_len_a(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00655 {
00656 typedef winstl_shims_access_string_time_impl impl_t;
00657
00658 int (STLSOFT_STDCALL *pfnGetTimeFormatA)( LCID Locale
00659 , DWORD dwFlags
00660 , CONST SYSTEMTIME *lpTime
00661 , ws_char_a_t const *lpFormat
00662 , ws_char_a_t *lpTimeStr
00663 , int cchTime)
00664
00665 = bMilliseconds ? GetTimeFormat_msA : ::GetTimeFormatA;
00666
00667 ws_size_t cchDate = 0;
00668 ws_size_t cchTime = 0;
00669
00670 return impl_t::calc_sizes(t, ::GetDateFormatA, pfnGetTimeFormatA, cchDate, cchTime);
00671 }
00672 inline ws_size_t c_str_len_a(SYSTEMTIME const& t)
00673 {
00674 return c_str_len_a(t, ws_false_v);
00675 }
00676
00677 inline ws_size_t c_str_len_w(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00678 {
00679 typedef winstl_shims_access_string_time_impl impl_t;
00680
00681 int (STLSOFT_STDCALL *pfnGetTimeFormatW)( LCID Locale
00682 , DWORD dwFlags
00683 , CONST SYSTEMTIME *lpTime
00684 , ws_char_w_t const *lpFormat
00685 , ws_char_w_t *lpTimeStr
00686 , int cchTime)
00687
00688 = bMilliseconds ? GetTimeFormat_msW : ::GetTimeFormatW;
00689
00690 ws_size_t cchDate = 0;
00691 ws_size_t cchTime = 0;
00692
00693 return impl_t::calc_sizes(t, ::GetDateFormatW, pfnGetTimeFormatW, cchDate, cchTime);
00694 }
00695 inline ws_size_t c_str_len_w(SYSTEMTIME const& t)
00696 {
00697 return c_str_len_w(t, ws_false_v);
00698 }
00699
00700 inline ws_size_t c_str_len(SYSTEMTIME const& t, ws_bool_t bMilliseconds)
00701 {
00702 #ifdef UNICODE
00703 return c_str_len_w(t, bMilliseconds);
00704 #else
00705 return c_str_len_a(t, bMilliseconds);
00706 #endif
00707 }
00708 inline ws_size_t c_str_len(SYSTEMTIME const& t)
00709 {
00710 return c_str_len(t, ws_false_v);
00711 }
00712
00713
00714
00715
00716 inline ws_size_t c_str_len_a(FILETIME const& t, ws_bool_t bMilliseconds)
00717 {
00718 return c_str_len_a(FILETIME2SYSTEMTIME(t), bMilliseconds);
00719 }
00720 inline ws_size_t c_str_len_a(FILETIME const& t)
00721 {
00722 return c_str_len_a(FILETIME2SYSTEMTIME(t), ws_false_v);
00723 }
00724
00725 inline ws_size_t c_str_len_w(FILETIME const& t, ws_bool_t bMilliseconds)
00726 {
00727 return c_str_len_w(FILETIME2SYSTEMTIME(t), bMilliseconds);
00728 }
00729 inline ws_size_t c_str_len_w(FILETIME const& t)
00730 {
00731 return c_str_len_w(FILETIME2SYSTEMTIME(t), ws_false_v);
00732 }
00733
00734
00735 inline ws_size_t c_str_len(FILETIME const& t, ws_bool_t bMilliseconds)
00736 {
00737 return c_str_len(FILETIME2SYSTEMTIME(t), bMilliseconds);
00738 }
00739 inline ws_size_t c_str_len(FILETIME const& t)
00740 {
00741 return c_str_len(FILETIME2SYSTEMTIME(t), ws_false_v);
00742 }
00743
00744
00745
00746
00747 #ifdef WINSTL_UDATE_DEFINED
00748
00749 inline ws_size_t c_str_len_a(UDATE const& t, ws_bool_t bMilliseconds)
00750 {
00751 return c_str_len_a(t.st, bMilliseconds);
00752 }
00753 inline ws_size_t c_str_len_a(UDATE const& t)
00754 {
00755 return c_str_len_a(t.st, ws_false_v);
00756 }
00757
00758 inline ws_size_t c_str_len_w(UDATE const& t, ws_bool_t bMilliseconds)
00759 {
00760 return c_str_len_w(t.st, bMilliseconds);
00761 }
00762 inline ws_size_t c_str_len_w(UDATE const& t)
00763 {
00764 return c_str_len_w(t.st, ws_false_v);
00765 }
00766
00767 inline ws_size_t c_str_len(UDATE const& t, ws_bool_t bMilliseconds)
00768 {
00769 return c_str_len(t.st, bMilliseconds);
00770 }
00771 inline ws_size_t c_str_len(UDATE const& t)
00772 {
00773 return c_str_len(t.st, ws_false_v);
00774 }
00775
00776 #endif
00777
00778
00779
00780
00781
00782
00788 template <ss_typename_param_k S>
00789 inline S& operator <<(S& s, SYSTEMTIME const& st)
00790 {
00791 stream_insert(s, st);
00792
00793 return s;
00794 }
00795
00801 template <ss_typename_param_k S>
00802 inline S& operator <<(S& s, FILETIME const& ft)
00803 {
00804 stream_insert(s, ft);
00805
00806 return s;
00807 }
00808
00809 #ifdef WINSTL_UDATE_DEFINED
00810
00816 template <ss_typename_param_k S>
00817 inline S& operator <<(S& s, UDATE const& ud)
00818 {
00819 stream_insert(s, ud);
00820
00821 return s;
00822 }
00823
00824 #endif
00825
00826
00827
00828 #ifndef _WINSTL_NO_NAMESPACE
00829 # if defined(_STLSOFT_NO_NAMESPACE) || \
00830 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00831 }
00832 # else
00833 }
00834 }
00835 # endif
00836
00842 template <ss_typename_param_k S>
00843 inline S& operator <<(S& s, SYSTEMTIME const& st)
00844 {
00845 ::winstl::stream_insert(s, st);
00846
00847 return s;
00848 }
00849
00855 template <ss_typename_param_k S>
00856 inline S& operator <<(S& s, FILETIME const& st)
00857 {
00858 ::winstl::stream_insert(s, st);
00859
00860 return s;
00861 }
00862
00863 namespace stlsoft
00864 {
00865 using ::winstl::c_str_ptr_null;
00866 using ::winstl::c_str_ptr_null_a;
00867 using ::winstl::c_str_ptr_null_w;
00868
00869 using ::winstl::c_str_ptr;
00870 using ::winstl::c_str_ptr_a;
00871 using ::winstl::c_str_ptr_w;
00872
00873 using ::winstl::c_str_data;
00874 using ::winstl::c_str_data_a;
00875 using ::winstl::c_str_data_w;
00876
00877 using ::winstl::c_str_len;
00878
00879 using ::winstl::c_str_len_a;
00880 using ::winstl::c_str_len_w;
00881
00882 }
00883
00884 #endif
00885
00886
00887
00888
00889
00890 #ifndef _WINSTL_NO_NAMESPACE
00891 # if defined(_STLSOFT_NO_NAMESPACE) || \
00892 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00893
00894 namespace winstl
00895 {
00896 # else
00897
00898
00899 namespace stlsoft
00900 {
00901
00902 namespace winstl_project
00903 {
00904
00905 # endif
00906 #endif
00907
00909
00910
00911 #ifdef STLSOFT_UNITTEST
00912 # include "./unittest/time_unittest_.h"
00913 #endif
00914
00915
00916
00917 #ifndef _WINSTL_NO_NAMESPACE
00918 # if defined(_STLSOFT_NO_NAMESPACE) || \
00919 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00920 }
00921 # else
00922 }
00923 }
00924 # endif
00925 #endif
00926
00927
00928
00929 #endif
00930
00931