| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | namespace std _GLIBCXX_VISIBILITY(default) |
| 38 | { |
| 39 | _GLIBCXX_BEGIN_NAMESPACE_VERSION |
| 40 | |
| 41 | template<typename _CharT> |
| 42 | __timepunct<_CharT>::__timepunct(size_t __refs) |
| 43 | : facet(__refs), _M_data(0), _M_c_locale_timepunct(0), |
| 44 | _M_name_timepunct(_S_get_c_name()) |
| 45 | { _M_initialize_timepunct(); } |
| 46 | |
| 47 | template<typename _CharT> |
| 48 | __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) |
| 49 | : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(0), |
| 50 | _M_name_timepunct(_S_get_c_name()) |
| 51 | { _M_initialize_timepunct(); } |
| 52 | |
| 53 | template<typename _CharT> |
| 54 | __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, |
| 55 | size_t __refs) |
| 56 | : facet(__refs), _M_data(0), _M_c_locale_timepunct(0), |
| 57 | _M_name_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 |
| 67 | _M_name_timepunct = _S_get_c_name(); |
| 68 | |
| 69 | __try |
| 70 | { _M_initialize_timepunct(__cloc); } |
| 71 | __catch(...) |
| 72 | { |
| 73 | if (_M_name_timepunct != _S_get_c_name()) |
| 74 | delete [] _M_name_timepunct; |
| 75 | __throw_exception_again; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | template<typename _CharT> |
| 80 | __timepunct<_CharT>::~__timepunct() |
| 81 | { |
| 82 | if (_M_name_timepunct != _S_get_c_name()) |
| 83 | delete [] _M_name_timepunct; |
| 84 | delete _M_data; |
| 85 | _S_destroy_c_locale(_M_c_locale_timepunct); |
| 86 | } |
| 87 | |
| 88 | _GLIBCXX_END_NAMESPACE_VERSION |
| 89 | } |
| 90 | |