libstdc++
GNU C++ library
Loading...
Searching...
No Matches
time_members.h
Go to the documentation of this file.
1// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2
3// Copyright (C) 2001-2026 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/** @file bits/time_members.h
26 * This is an internal header file, included by other library headers.
27 * Do not attempt to use it directly. @headername{locale}
28 */
29
30//
31// ISO C++ 14882: 22.2.5.1.2 - time_get functions
32// ISO C++ 14882: 22.2.5.3.2 - time_put functions
33//
34
35// Written by Benjamin Kosnik <bkoz@redhat.com>
36
37namespace std _GLIBCXX_VISIBILITY(default)
38{
40
41 template<typename _CharT>
46
47 template<typename _CharT>
52
53 template<typename _CharT>
55 size_t __refs)
56 : facet(__refs), _M_data(0), _M_c_locale_timepunct(0),
58 {
59 if (__builtin_strcmp(__s, _S_get_c_name()) != 0)
60 {
61 const size_t __len = __builtin_strlen(__s) + 1;
62 char* __tmp = new char[__len];
63 __builtin_memcpy(__tmp, __s, __len);
64 _M_name_timepunct = __tmp;
65 }
66 else
68
69 __try
70 { _M_initialize_timepunct(__cloc); }
71 __catch(...)
72 {
74 delete [] _M_name_timepunct;
76 }
77 }
78
79 template<typename _CharT>
87
89} // namespace
#define __try
#define __throw_exception_again
#define __catch(X)
#define _GLIBCXX_VISIBILITY(V)
#define _GLIBCXX_END_NAMESPACE_VERSION
#define _GLIBCXX_BEGIN_NAMESPACE_VERSION
__locale_t __c_locale
Definition c++locale.h:62
ISO C++ entities toplevel namespace is std.
facet(size_t __refs=0)
Facet constructor.
static void _S_destroy_c_locale(__c_locale &__cloc)
static const char * _S_get_c_name()
__c_locale _M_c_locale_timepunct
__timepunct(size_t __refs=0)
const char * _M_name_timepunct
virtual ~__timepunct()
void _M_initialize_timepunct(__c_locale __cloc=0)
__timepunct_cache< _CharT > __cache_type