20template <
typename Character>
27 if (
value >= 10 || zero_fill)
29 *
p++ =
static_cast<Character
>(
'0' +
value / 10);
36 *
p++ =
static_cast<Character
>(
'0' +
value % 10);
48template <
typename Character>
57 buffer !=
nullptr && size_in_chars > 0,
76 Character* buffer_it =
buffer;
79 char const*
const day_first =
__dnames + tm_value->tm_wday * 3;
80 char const*
const day_last = day_first + 3;
81 for (
char const* day_it = day_first; day_it != day_last; ++day_it)
82 *buffer_it++ =
static_cast<Character
>(*day_it);
84 *buffer_it++ =
static_cast<Character
>(
' ');
87 char const*
const month_first =
__mnames + tm_value->tm_mon * 3;
88 char const*
const month_last = month_first + 3;
89 for (
char const* month_it = month_first; month_it != month_last; ++month_it)
90 *buffer_it++ =
static_cast<Character
>(*month_it);
92 *buffer_it++ =
static_cast<Character
>(
' ');
96 *buffer_it++ =
static_cast<Character
>(
' ');
100 *buffer_it++ =
static_cast<Character
>(
':');
102 *buffer_it++ =
static_cast<Character
>(
':');
104 *buffer_it++ =
static_cast<Character
>(
' ');
111 *buffer_it++ =
static_cast<Character
>(
'\n');
112 *buffer_it++ =
static_cast<Character
>(
'\0');
119 size_t const size_in_chars,
120 tm const*
const tm_value
123 return common_asctime_s(
buffer, size_in_chars, tm_value);
128 size_t const size_in_chars,
129 tm const*
const tm_value
132 return common_asctime_s(
buffer, size_in_chars, tm_value);
149 return &
ptd->_asctime_buffer;
158 return &
ptd->_wasctime_buffer;
165template <
typename Character>
173 if (ptd_buffer_address !=
nullptr && *ptd_buffer_address ==
nullptr)
175 *ptd_buffer_address = _calloc_crt_t(Character,
_ASCBUFSIZE).detach();
178 Character*
const buffer = ptd_buffer_address !=
nullptr && *ptd_buffer_address !=
nullptr
179 ? *ptd_buffer_address
191 return common_asctime<char>(tm_value);
196 return common_asctime<wchar_t>(tm_value);
tm const *const tm_value throw()
errno_t __cdecl _wasctime_s(wchar_t *const buffer, size_t const size_in_chars, tm const *const tm_value)
errno_t __cdecl asctime_s(char *const buffer, size_t const size_in_chars, tm const *const tm_value)
wchar_t *__cdecl _wasctime(tm const *const tm_value)
char *__cdecl asctime(tm const *const tm_value)
static char ** common_asctime_get_ptd_buffer(char)
static Character *__cdecl common_asctime_s_write_value(_Out_writes_(2) Character *p, int const value, bool const zero_fill)
__acrt_ptd *__cdecl __acrt_getptd_noexit(void)
#define _RESET_STRING(_String, _Size)
bool __cdecl __crt_time_is_day_valid(int const yr, int const mo, int const dy)
int __crt_get_century(int const year)
int __crt_get_2digit_year(int const year)
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
#define _VALIDATE_RETURN_ERRCODE(expr, errorcode)
#define _Out_writes_z_(s)
#define _Post_readable_size_(s)
#define _Ret_writes_z_(s)