/src/llvm-project-18.1.8.build/include/c++/v1/locale
Line | Count | Source (jump to first uncovered line) |
1 | | // -*- C++ -*- |
2 | | //===----------------------------------------------------------------------===// |
3 | | // |
4 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
5 | | // See https://llvm.org/LICENSE.txt for license information. |
6 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
7 | | // |
8 | | //===----------------------------------------------------------------------===// |
9 | | |
10 | | #ifndef _LIBCPP_LOCALE |
11 | | #define _LIBCPP_LOCALE |
12 | | |
13 | | /* |
14 | | locale synopsis |
15 | | |
16 | | namespace std |
17 | | { |
18 | | |
19 | | class locale |
20 | | { |
21 | | public: |
22 | | // types: |
23 | | class facet; |
24 | | class id; |
25 | | |
26 | | typedef int category; |
27 | | static const category // values assigned here are for exposition only |
28 | | none = 0x000, |
29 | | collate = 0x010, |
30 | | ctype = 0x020, |
31 | | monetary = 0x040, |
32 | | numeric = 0x080, |
33 | | time = 0x100, |
34 | | messages = 0x200, |
35 | | all = collate | ctype | monetary | numeric | time | messages; |
36 | | |
37 | | // construct/copy/destroy: |
38 | | locale() noexcept; |
39 | | locale(const locale& other) noexcept; |
40 | | explicit locale(const char* std_name); |
41 | | explicit locale(const string& std_name); |
42 | | locale(const locale& other, const char* std_name, category); |
43 | | locale(const locale& other, const string& std_name, category); |
44 | | template <class Facet> locale(const locale& other, Facet* f); |
45 | | locale(const locale& other, const locale& one, category); |
46 | | |
47 | | ~locale(); // not virtual |
48 | | |
49 | | const locale& operator=(const locale& other) noexcept; |
50 | | |
51 | | template <class Facet> locale combine(const locale& other) const; |
52 | | |
53 | | // locale operations: |
54 | | basic_string<char> name() const; |
55 | | bool operator==(const locale& other) const; |
56 | | bool operator!=(const locale& other) const; // removed C++20 |
57 | | template <class charT, class Traits, class Allocator> |
58 | | bool operator()(const basic_string<charT,Traits,Allocator>& s1, |
59 | | const basic_string<charT,Traits,Allocator>& s2) const; |
60 | | |
61 | | // global locale objects: |
62 | | static locale global(const locale&); |
63 | | static const locale& classic(); |
64 | | }; |
65 | | |
66 | | template <class Facet> const Facet& use_facet(const locale&); |
67 | | template <class Facet> bool has_facet(const locale&) noexcept; |
68 | | |
69 | | // 22.3.3, convenience interfaces: |
70 | | template <class charT> bool isspace (charT c, const locale& loc); |
71 | | template <class charT> bool isprint (charT c, const locale& loc); |
72 | | template <class charT> bool iscntrl (charT c, const locale& loc); |
73 | | template <class charT> bool isupper (charT c, const locale& loc); |
74 | | template <class charT> bool islower (charT c, const locale& loc); |
75 | | template <class charT> bool isalpha (charT c, const locale& loc); |
76 | | template <class charT> bool isdigit (charT c, const locale& loc); |
77 | | template <class charT> bool ispunct (charT c, const locale& loc); |
78 | | template <class charT> bool isxdigit(charT c, const locale& loc); |
79 | | template <class charT> bool isalnum (charT c, const locale& loc); |
80 | | template <class charT> bool isgraph (charT c, const locale& loc); |
81 | | template <class charT> charT toupper(charT c, const locale& loc); |
82 | | template <class charT> charT tolower(charT c, const locale& loc); |
83 | | |
84 | | template<class Codecvt, class Elem = wchar_t, |
85 | | class Wide_alloc = allocator<Elem>, |
86 | | class Byte_alloc = allocator<char>> |
87 | | class wstring_convert |
88 | | { |
89 | | public: |
90 | | typedef basic_string<char, char_traits<char>, Byte_alloc> byte_string; |
91 | | typedef basic_string<Elem, char_traits<Elem>, Wide_alloc> wide_string; |
92 | | typedef typename Codecvt::state_type state_type; |
93 | | typedef typename wide_string::traits_type::int_type int_type; |
94 | | |
95 | | wstring_convert(Codecvt* pcvt = new Codecvt); // before C++14 |
96 | | explicit wstring_convert(Codecvt* pcvt = new Codecvt); // before C++20 |
97 | | wstring_convert() : wstring_convert(new Codecvt) {} // C++20 |
98 | | explicit wstring_convert(Codecvt* pcvt); // C++20 |
99 | | |
100 | | wstring_convert(Codecvt* pcvt, state_type state); |
101 | | explicit wstring_convert(const byte_string& byte_err, // explicit in C++14 |
102 | | const wide_string& wide_err = wide_string()); |
103 | | wstring_convert(const wstring_convert&) = delete; // C++14 |
104 | | wstring_convert & operator=(const wstring_convert &) = delete; // C++14 |
105 | | ~wstring_convert(); |
106 | | |
107 | | wide_string from_bytes(char byte); |
108 | | wide_string from_bytes(const char* ptr); |
109 | | wide_string from_bytes(const byte_string& str); |
110 | | wide_string from_bytes(const char* first, const char* last); |
111 | | |
112 | | byte_string to_bytes(Elem wchar); |
113 | | byte_string to_bytes(const Elem* wptr); |
114 | | byte_string to_bytes(const wide_string& wstr); |
115 | | byte_string to_bytes(const Elem* first, const Elem* last); |
116 | | |
117 | | size_t converted() const; // noexcept in C++14 |
118 | | state_type state() const; |
119 | | }; |
120 | | |
121 | | template <class Codecvt, class Elem = wchar_t, class Tr = char_traits<Elem>> |
122 | | class wbuffer_convert |
123 | | : public basic_streambuf<Elem, Tr> |
124 | | { |
125 | | public: |
126 | | typedef typename Tr::state_type state_type; |
127 | | |
128 | | wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt, |
129 | | state_type state = state_type()); // before C++14 |
130 | | explicit wbuffer_convert(streambuf* bytebuf = nullptr, Codecvt* pcvt = new Codecvt, |
131 | | state_type state = state_type()); // before C++20 |
132 | | wbuffer_convert() : wbuffer_convert(nullptr) {} // C++20 |
133 | | explicit wbuffer_convert(streambuf* bytebuf, Codecvt* pcvt = new Codecvt, |
134 | | state_type state = state_type()); // C++20 |
135 | | |
136 | | wbuffer_convert(const wbuffer_convert&) = delete; // C++14 |
137 | | wbuffer_convert & operator=(const wbuffer_convert &) = delete; // C++14 |
138 | | ~wbuffer_convert(); // C++14 |
139 | | |
140 | | streambuf* rdbuf() const; |
141 | | streambuf* rdbuf(streambuf* bytebuf); |
142 | | |
143 | | state_type state() const; |
144 | | }; |
145 | | |
146 | | // 22.4.1 and 22.4.1.3, ctype: |
147 | | class ctype_base; |
148 | | template <class charT> class ctype; |
149 | | template <> class ctype<char>; // specialization |
150 | | template <class charT> class ctype_byname; |
151 | | template <> class ctype_byname<char>; // specialization |
152 | | |
153 | | class codecvt_base; |
154 | | template <class internT, class externT, class stateT> class codecvt; |
155 | | template <class internT, class externT, class stateT> class codecvt_byname; |
156 | | |
157 | | // 22.4.2 and 22.4.3, numeric: |
158 | | template <class charT, class InputIterator> class num_get; |
159 | | template <class charT, class OutputIterator> class num_put; |
160 | | template <class charT> class numpunct; |
161 | | template <class charT> class numpunct_byname; |
162 | | |
163 | | // 22.4.4, col lation: |
164 | | template <class charT> class collate; |
165 | | template <class charT> class collate_byname; |
166 | | |
167 | | // 22.4.5, date and time: |
168 | | class time_base; |
169 | | template <class charT, class InputIterator> class time_get; |
170 | | template <class charT, class InputIterator> class time_get_byname; |
171 | | template <class charT, class OutputIterator> class time_put; |
172 | | template <class charT, class OutputIterator> class time_put_byname; |
173 | | |
174 | | // 22.4.6, money: |
175 | | class money_base; |
176 | | template <class charT, class InputIterator> class money_get; |
177 | | template <class charT, class OutputIterator> class money_put; |
178 | | template <class charT, bool Intl> class moneypunct; |
179 | | template <class charT, bool Intl> class moneypunct_byname; |
180 | | |
181 | | // 22.4.7, message retrieval: |
182 | | class messages_base; |
183 | | template <class charT> class messages; |
184 | | template <class charT> class messages_byname; |
185 | | |
186 | | } // std |
187 | | |
188 | | */ |
189 | | |
190 | | #include <__algorithm/copy.h> |
191 | | #include <__algorithm/equal.h> |
192 | | #include <__algorithm/find.h> |
193 | | #include <__algorithm/max.h> |
194 | | #include <__algorithm/reverse.h> |
195 | | #include <__algorithm/unwrap_iter.h> |
196 | | #include <__assert> // all public C++ headers provide the assertion handler |
197 | | #include <__config> |
198 | | #include <__iterator/access.h> |
199 | | #include <__iterator/back_insert_iterator.h> |
200 | | #include <__iterator/istreambuf_iterator.h> |
201 | | #include <__iterator/ostreambuf_iterator.h> |
202 | | #include <__locale> |
203 | | #include <__memory/unique_ptr.h> |
204 | | #include <__type_traits/make_unsigned.h> |
205 | | #include <cerrno> |
206 | | #include <cstdio> |
207 | | #include <cstdlib> |
208 | | #include <ctime> |
209 | | #include <ios> |
210 | | #include <limits> |
211 | | #include <new> |
212 | | #include <streambuf> |
213 | | #include <version> |
214 | | |
215 | | // TODO: Fix __bsd_locale_defaults.h |
216 | | // NOLINTBEGIN(libcpp-robust-against-adl) |
217 | | |
218 | | #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) |
219 | | // Most unix variants have catopen. These are the specific ones that don't. |
220 | | # if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__) |
221 | | # define _LIBCPP_HAS_CATOPEN 1 |
222 | | # include <nl_types.h> |
223 | | # endif |
224 | | #endif |
225 | | |
226 | | #ifdef _LIBCPP_LOCALE__L_EXTENSIONS |
227 | | # include <__locale_dir/locale_base_api/bsd_locale_defaults.h> |
228 | | #else |
229 | | # include <__locale_dir/locale_base_api/bsd_locale_fallbacks.h> |
230 | | #endif |
231 | | |
232 | | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
233 | | # pragma GCC system_header |
234 | | #endif |
235 | | |
236 | | _LIBCPP_PUSH_MACROS |
237 | | #include <__undef_macros> |
238 | | |
239 | | _LIBCPP_BEGIN_NAMESPACE_STD |
240 | | |
241 | | #if defined(__APPLE__) || defined(__FreeBSD__) |
242 | | # define _LIBCPP_GET_C_LOCALE 0 |
243 | | #elif defined(__NetBSD__) |
244 | | # define _LIBCPP_GET_C_LOCALE LC_C_LOCALE |
245 | | #else |
246 | 7.98k | # define _LIBCPP_GET_C_LOCALE __cloc() |
247 | | // Get the C locale object |
248 | | _LIBCPP_EXPORTED_FROM_ABI locale_t __cloc(); |
249 | | # define __cloc_defined |
250 | | #endif |
251 | | |
252 | | // __scan_keyword |
253 | | // Scans [__b, __e) until a match is found in the basic_strings range |
254 | | // [__kb, __ke) or until it can be shown that there is no match in [__kb, __ke). |
255 | | // __b will be incremented (visibly), consuming CharT until a match is found |
256 | | // or proved to not exist. A keyword may be "", in which will match anything. |
257 | | // If one keyword is a prefix of another, and the next CharT in the input |
258 | | // might match another keyword, the algorithm will attempt to find the longest |
259 | | // matching keyword. If the longer matching keyword ends up not matching, then |
260 | | // no keyword match is found. If no keyword match is found, __ke is returned |
261 | | // and failbit is set in __err. |
262 | | // Else an iterator pointing to the matching keyword is found. If more than |
263 | | // one keyword matches, an iterator to the first matching keyword is returned. |
264 | | // If on exit __b == __e, eofbit is set in __err. If __case_sensitive is false, |
265 | | // __ct is used to force to lower case before comparing characters. |
266 | | // Examples: |
267 | | // Keywords: "a", "abb" |
268 | | // If the input is "a", the first keyword matches and eofbit is set. |
269 | | // If the input is "abc", no match is found and "ab" are consumed. |
270 | | template <class _InputIterator, class _ForwardIterator, class _Ctype> |
271 | | _LIBCPP_HIDE_FROM_ABI _ForwardIterator __scan_keyword( |
272 | | _InputIterator& __b, |
273 | | _InputIterator __e, |
274 | | _ForwardIterator __kb, |
275 | | _ForwardIterator __ke, |
276 | | const _Ctype& __ct, |
277 | | ios_base::iostate& __err, |
278 | 0 | bool __case_sensitive = true) { |
279 | 0 | typedef typename iterator_traits<_InputIterator>::value_type _CharT; |
280 | 0 | size_t __nkw = static_cast<size_t>(std::distance(__kb, __ke)); |
281 | 0 | const unsigned char __doesnt_match = '\0'; |
282 | 0 | const unsigned char __might_match = '\1'; |
283 | 0 | const unsigned char __does_match = '\2'; |
284 | 0 | unsigned char __statbuf[100]; |
285 | 0 | unsigned char* __status = __statbuf; |
286 | 0 | unique_ptr<unsigned char, void (*)(void*)> __stat_hold(nullptr, free); |
287 | 0 | if (__nkw > sizeof(__statbuf)) { |
288 | 0 | __status = (unsigned char*)malloc(__nkw); |
289 | 0 | if (__status == nullptr) |
290 | 0 | __throw_bad_alloc(); |
291 | 0 | __stat_hold.reset(__status); |
292 | 0 | } |
293 | 0 | size_t __n_might_match = __nkw; // At this point, any keyword might match |
294 | 0 | size_t __n_does_match = 0; // but none of them definitely do |
295 | | // Initialize all statuses to __might_match, except for "" keywords are __does_match |
296 | 0 | unsigned char* __st = __status; |
297 | 0 | for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, (void)++__st) { |
298 | 0 | if (!__ky->empty()) |
299 | 0 | *__st = __might_match; |
300 | 0 | else { |
301 | 0 | *__st = __does_match; |
302 | 0 | --__n_might_match; |
303 | 0 | ++__n_does_match; |
304 | 0 | } |
305 | 0 | } |
306 | | // While there might be a match, test keywords against the next CharT |
307 | 0 | for (size_t __indx = 0; __b != __e && __n_might_match > 0; ++__indx) { |
308 | | // Peek at the next CharT but don't consume it |
309 | 0 | _CharT __c = *__b; |
310 | 0 | if (!__case_sensitive) |
311 | 0 | __c = __ct.toupper(__c); |
312 | 0 | bool __consume = false; |
313 | | // For each keyword which might match, see if the __indx character is __c |
314 | | // If a match if found, consume __c |
315 | | // If a match is found, and that is the last character in the keyword, |
316 | | // then that keyword matches. |
317 | | // If the keyword doesn't match this character, then change the keyword |
318 | | // to doesn't match |
319 | 0 | __st = __status; |
320 | 0 | for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, (void)++__st) { |
321 | 0 | if (*__st == __might_match) { |
322 | 0 | _CharT __kc = (*__ky)[__indx]; |
323 | 0 | if (!__case_sensitive) |
324 | 0 | __kc = __ct.toupper(__kc); |
325 | 0 | if (__c == __kc) { |
326 | 0 | __consume = true; |
327 | 0 | if (__ky->size() == __indx + 1) { |
328 | 0 | *__st = __does_match; |
329 | 0 | --__n_might_match; |
330 | 0 | ++__n_does_match; |
331 | 0 | } |
332 | 0 | } else { |
333 | 0 | *__st = __doesnt_match; |
334 | 0 | --__n_might_match; |
335 | 0 | } |
336 | 0 | } |
337 | 0 | } |
338 | | // consume if we matched a character |
339 | 0 | if (__consume) { |
340 | 0 | ++__b; |
341 | | // If we consumed a character and there might be a matched keyword that |
342 | | // was marked matched on a previous iteration, then such keywords |
343 | | // which are now marked as not matching. |
344 | 0 | if (__n_might_match + __n_does_match > 1) { |
345 | 0 | __st = __status; |
346 | 0 | for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, (void)++__st) { |
347 | 0 | if (*__st == __does_match && __ky->size() != __indx + 1) { |
348 | 0 | *__st = __doesnt_match; |
349 | 0 | --__n_does_match; |
350 | 0 | } |
351 | 0 | } |
352 | 0 | } |
353 | 0 | } |
354 | 0 | } |
355 | | // We've exited the loop because we hit eof and/or we have no more "might matches". |
356 | 0 | if (__b == __e) |
357 | 0 | __err |= ios_base::eofbit; |
358 | | // Return the first matching result |
359 | 0 | for (__st = __status; __kb != __ke; ++__kb, (void)++__st) |
360 | 0 | if (*__st == __does_match) |
361 | 0 | break; |
362 | 0 | if (__kb == __ke) |
363 | 0 | __err |= ios_base::failbit; |
364 | 0 | return __kb; |
365 | 0 | } Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* std::__1::__scan_keyword[abi:ne180100]<char*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::ctype<char> >(char*&, char*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::ctype<char> const&, unsigned int&, bool) Unexecuted instantiation: std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >* std::__1::__scan_keyword[abi:ne180100]<wchar_t*, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >*, std::__1::ctype<wchar_t> >(wchar_t*&, wchar_t*, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >*, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >*, std::__1::ctype<wchar_t> const&, unsigned int&, bool) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* std::__1::__scan_keyword[abi:ne180100]<std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, std::__1::ctype<char> >(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, std::__1::ctype<char> const&, unsigned int&, bool) Unexecuted instantiation: std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const* std::__1::__scan_keyword[abi:ne180100]<std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const*, std::__1::ctype<wchar_t> >(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const*, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const*, std::__1::ctype<wchar_t> const&, unsigned int&, bool) |
366 | | |
367 | | struct _LIBCPP_EXPORTED_FROM_ABI __num_get_base { |
368 | | static const int __num_get_buf_sz = 40; |
369 | | |
370 | | static int __get_base(ios_base&); |
371 | | static const char __src[33]; |
372 | | }; |
373 | | |
374 | | _LIBCPP_EXPORTED_FROM_ABI void |
375 | | __check_grouping(const string& __grouping, unsigned* __g, unsigned* __g_end, ios_base::iostate& __err); |
376 | | |
377 | | template <class _CharT> |
378 | | struct __num_get : protected __num_get_base { |
379 | | static string __stage2_float_prep(ios_base& __iob, _CharT* __atoms, _CharT& __decimal_point, _CharT& __thousands_sep); |
380 | | |
381 | | static int __stage2_float_loop( |
382 | | _CharT __ct, |
383 | | bool& __in_units, |
384 | | char& __exp, |
385 | | char* __a, |
386 | | char*& __a_end, |
387 | | _CharT __decimal_point, |
388 | | _CharT __thousands_sep, |
389 | | const string& __grouping, |
390 | | unsigned* __g, |
391 | | unsigned*& __g_end, |
392 | | unsigned& __dc, |
393 | | _CharT* __atoms); |
394 | | #ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET |
395 | | static string __stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep); |
396 | | static int __stage2_int_loop( |
397 | | _CharT __ct, |
398 | | int __base, |
399 | | char* __a, |
400 | | char*& __a_end, |
401 | | unsigned& __dc, |
402 | | _CharT __thousands_sep, |
403 | | const string& __grouping, |
404 | | unsigned* __g, |
405 | | unsigned*& __g_end, |
406 | | _CharT* __atoms); |
407 | | |
408 | | #else |
409 | | static string __stage2_int_prep(ios_base& __iob, _CharT& __thousands_sep) { |
410 | | locale __loc = __iob.getloc(); |
411 | | const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc); |
412 | | __thousands_sep = __np.thousands_sep(); |
413 | | return __np.grouping(); |
414 | | } |
415 | | |
416 | | const _CharT* __do_widen(ios_base& __iob, _CharT* __atoms) const { return __do_widen_p(__iob, __atoms); } |
417 | | |
418 | | static int __stage2_int_loop( |
419 | | _CharT __ct, |
420 | | int __base, |
421 | | char* __a, |
422 | | char*& __a_end, |
423 | | unsigned& __dc, |
424 | | _CharT __thousands_sep, |
425 | | const string& __grouping, |
426 | | unsigned* __g, |
427 | | unsigned*& __g_end, |
428 | | const _CharT* __atoms); |
429 | | |
430 | | private: |
431 | | template <typename _Tp> |
432 | | const _Tp* __do_widen_p(ios_base& __iob, _Tp* __atoms) const { |
433 | | locale __loc = __iob.getloc(); |
434 | | use_facet<ctype<_Tp> >(__loc).widen(__src, __src + 26, __atoms); |
435 | | return __atoms; |
436 | | } |
437 | | |
438 | | const char* __do_widen_p(ios_base& __iob, char* __atoms) const { |
439 | | (void)__iob; |
440 | | (void)__atoms; |
441 | | return __src; |
442 | | } |
443 | | #endif |
444 | | }; |
445 | | |
446 | | #ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET |
447 | | template <class _CharT> |
448 | 3.73k | string __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep) { |
449 | 3.73k | locale __loc = __iob.getloc(); |
450 | 3.73k | std::use_facet<ctype<_CharT> >(__loc).widen(__src, __src + 26, __atoms); |
451 | 3.73k | const numpunct<_CharT>& __np = std::use_facet<numpunct<_CharT> >(__loc); |
452 | 3.73k | __thousands_sep = __np.thousands_sep(); |
453 | 3.73k | return __np.grouping(); |
454 | 3.73k | } std::__1::__num_get<char>::__stage2_int_prep(std::__1::ios_base&, char*, char&) Line | Count | Source | 448 | 3.73k | string __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep) { | 449 | 3.73k | locale __loc = __iob.getloc(); | 450 | 3.73k | std::use_facet<ctype<_CharT> >(__loc).widen(__src, __src + 26, __atoms); | 451 | 3.73k | const numpunct<_CharT>& __np = std::use_facet<numpunct<_CharT> >(__loc); | 452 | 3.73k | __thousands_sep = __np.thousands_sep(); | 453 | 3.73k | return __np.grouping(); | 454 | 3.73k | } |
Unexecuted instantiation: std::__1::__num_get<wchar_t>::__stage2_int_prep(std::__1::ios_base&, wchar_t*, wchar_t&) |
455 | | #endif |
456 | | |
457 | | template <class _CharT> |
458 | | string __num_get<_CharT>::__stage2_float_prep( |
459 | 0 | ios_base& __iob, _CharT* __atoms, _CharT& __decimal_point, _CharT& __thousands_sep) { |
460 | 0 | locale __loc = __iob.getloc(); |
461 | 0 | std::use_facet<ctype<_CharT> >(__loc).widen(__src, __src + 32, __atoms); |
462 | 0 | const numpunct<_CharT>& __np = std::use_facet<numpunct<_CharT> >(__loc); |
463 | 0 | __decimal_point = __np.decimal_point(); |
464 | 0 | __thousands_sep = __np.thousands_sep(); |
465 | 0 | return __np.grouping(); |
466 | 0 | } Unexecuted instantiation: std::__1::__num_get<char>::__stage2_float_prep(std::__1::ios_base&, char*, char&, char&) Unexecuted instantiation: std::__1::__num_get<wchar_t>::__stage2_float_prep(std::__1::ios_base&, wchar_t*, wchar_t&, wchar_t&) |
467 | | |
468 | | template <class _CharT> |
469 | | int |
470 | | #ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET |
471 | | __num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end, |
472 | | unsigned& __dc, _CharT __thousands_sep, const string& __grouping, |
473 | | unsigned* __g, unsigned*& __g_end, _CharT* __atoms) |
474 | | #else |
475 | | __num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end, |
476 | | unsigned& __dc, _CharT __thousands_sep, const string& __grouping, |
477 | | unsigned* __g, unsigned*& __g_end, const _CharT* __atoms) |
478 | | |
479 | | #endif |
480 | 7.00M | { |
481 | 7.00M | if (__a_end == __a && (__ct == __atoms[24] || __ct == __atoms[25])) { |
482 | 1.98k | *__a_end++ = __ct == __atoms[24] ? '+' : '-'; |
483 | 1.98k | __dc = 0; |
484 | 1.98k | return 0; |
485 | 1.98k | } |
486 | 7.00M | if (__grouping.size() != 0 && __ct == __thousands_sep) { |
487 | 0 | if (__g_end - __g < __num_get_buf_sz) { |
488 | 0 | *__g_end++ = __dc; |
489 | 0 | __dc = 0; |
490 | 0 | } |
491 | 0 | return 0; |
492 | 0 | } |
493 | 7.00M | ptrdiff_t __f = std::find(__atoms, __atoms + 26, __ct) - __atoms; |
494 | 7.00M | if (__f >= 24) |
495 | 2.80k | return -1; |
496 | 7.00M | switch (__base) { |
497 | 0 | case 8: |
498 | 7.00M | case 10: |
499 | 7.00M | if (__f >= __base) |
500 | 98 | return -1; |
501 | 7.00M | break; |
502 | 7.00M | case 16: |
503 | 0 | if (__f < 22) |
504 | 0 | break; |
505 | 0 | if (__a_end != __a && __a_end - __a <= 2 && __a_end[-1] == '0') { |
506 | 0 | __dc = 0; |
507 | 0 | *__a_end++ = __src[__f]; |
508 | 0 | return 0; |
509 | 0 | } |
510 | 0 | return -1; |
511 | 7.00M | } |
512 | 7.00M | *__a_end++ = __src[__f]; |
513 | 7.00M | ++__dc; |
514 | 7.00M | return 0; |
515 | 7.00M | } std::__1::__num_get<char>::__stage2_int_loop(char, int, char*, char*&, unsigned int&, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int*, unsigned int*&, char*) Line | Count | Source | 480 | 7.00M | { | 481 | 7.00M | if (__a_end == __a && (__ct == __atoms[24] || __ct == __atoms[25])) { | 482 | 1.98k | *__a_end++ = __ct == __atoms[24] ? '+' : '-'; | 483 | 1.98k | __dc = 0; | 484 | 1.98k | return 0; | 485 | 1.98k | } | 486 | 7.00M | if (__grouping.size() != 0 && __ct == __thousands_sep) { | 487 | 0 | if (__g_end - __g < __num_get_buf_sz) { | 488 | 0 | *__g_end++ = __dc; | 489 | 0 | __dc = 0; | 490 | 0 | } | 491 | 0 | return 0; | 492 | 0 | } | 493 | 7.00M | ptrdiff_t __f = std::find(__atoms, __atoms + 26, __ct) - __atoms; | 494 | 7.00M | if (__f >= 24) | 495 | 2.80k | return -1; | 496 | 7.00M | switch (__base) { | 497 | 0 | case 8: | 498 | 7.00M | case 10: | 499 | 7.00M | if (__f >= __base) | 500 | 98 | return -1; | 501 | 7.00M | break; | 502 | 7.00M | case 16: | 503 | 0 | if (__f < 22) | 504 | 0 | break; | 505 | 0 | if (__a_end != __a && __a_end - __a <= 2 && __a_end[-1] == '0') { | 506 | 0 | __dc = 0; | 507 | 0 | *__a_end++ = __src[__f]; | 508 | 0 | return 0; | 509 | 0 | } | 510 | 0 | return -1; | 511 | 7.00M | } | 512 | 7.00M | *__a_end++ = __src[__f]; | 513 | 7.00M | ++__dc; | 514 | 7.00M | return 0; | 515 | 7.00M | } |
Unexecuted instantiation: std::__1::__num_get<wchar_t>::__stage2_int_loop(wchar_t, int, char*, char*&, unsigned int&, wchar_t, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int*, unsigned int*&, wchar_t*) |
516 | | |
517 | | template <class _CharT> |
518 | | int __num_get<_CharT>::__stage2_float_loop( |
519 | | _CharT __ct, |
520 | | bool& __in_units, |
521 | | char& __exp, |
522 | | char* __a, |
523 | | char*& __a_end, |
524 | | _CharT __decimal_point, |
525 | | _CharT __thousands_sep, |
526 | | const string& __grouping, |
527 | | unsigned* __g, |
528 | | unsigned*& __g_end, |
529 | | unsigned& __dc, |
530 | 0 | _CharT* __atoms) { |
531 | 0 | if (__ct == __decimal_point) { |
532 | 0 | if (!__in_units) |
533 | 0 | return -1; |
534 | 0 | __in_units = false; |
535 | 0 | *__a_end++ = '.'; |
536 | 0 | if (__grouping.size() != 0 && __g_end - __g < __num_get_buf_sz) |
537 | 0 | *__g_end++ = __dc; |
538 | 0 | return 0; |
539 | 0 | } |
540 | 0 | if (__ct == __thousands_sep && __grouping.size() != 0) { |
541 | 0 | if (!__in_units) |
542 | 0 | return -1; |
543 | 0 | if (__g_end - __g < __num_get_buf_sz) { |
544 | 0 | *__g_end++ = __dc; |
545 | 0 | __dc = 0; |
546 | 0 | } |
547 | 0 | return 0; |
548 | 0 | } |
549 | 0 | ptrdiff_t __f = std::find(__atoms, __atoms + 32, __ct) - __atoms; |
550 | 0 | if (__f >= 32) |
551 | 0 | return -1; |
552 | 0 | char __x = __src[__f]; |
553 | 0 | if (__x == '-' || __x == '+') { |
554 | 0 | if (__a_end == __a || (std::toupper(__a_end[-1]) == std::toupper(__exp))) { |
555 | 0 | *__a_end++ = __x; |
556 | 0 | return 0; |
557 | 0 | } |
558 | 0 | return -1; |
559 | 0 | } |
560 | 0 | if (__x == 'x' || __x == 'X') |
561 | 0 | __exp = 'P'; |
562 | 0 | else if (std::toupper(__x) == __exp) { |
563 | 0 | __exp = std::tolower(__exp); |
564 | 0 | if (__in_units) { |
565 | 0 | __in_units = false; |
566 | 0 | if (__grouping.size() != 0 && __g_end - __g < __num_get_buf_sz) |
567 | 0 | *__g_end++ = __dc; |
568 | 0 | } |
569 | 0 | } |
570 | 0 | *__a_end++ = __x; |
571 | 0 | if (__f >= 22) |
572 | 0 | return 0; |
573 | 0 | ++__dc; |
574 | 0 | return 0; |
575 | 0 | } Unexecuted instantiation: std::__1::__num_get<char>::__stage2_float_loop(char, bool&, char&, char*, char*&, char, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int*, unsigned int*&, unsigned int&, char*) Unexecuted instantiation: std::__1::__num_get<wchar_t>::__stage2_float_loop(wchar_t, bool&, char&, char*, char*&, wchar_t, wchar_t, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int*, unsigned int*&, unsigned int&, wchar_t*) |
576 | | |
577 | | extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>; |
578 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
579 | | extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>; |
580 | | #endif |
581 | | |
582 | | template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> > |
583 | | class _LIBCPP_TEMPLATE_VIS num_get : public locale::facet, private __num_get<_CharT> { |
584 | | public: |
585 | | typedef _CharT char_type; |
586 | | typedef _InputIterator iter_type; |
587 | | |
588 | 12 | _LIBCPP_HIDE_FROM_ABI explicit num_get(size_t __refs = 0) : locale::facet(__refs) {} std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::num_get[abi:ne180100](unsigned long) Line | Count | Source | 588 | 6 | _LIBCPP_HIDE_FROM_ABI explicit num_get(size_t __refs = 0) : locale::facet(__refs) {} |
std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::num_get[abi:ne180100](unsigned long) Line | Count | Source | 588 | 6 | _LIBCPP_HIDE_FROM_ABI explicit num_get(size_t __refs = 0) : locale::facet(__refs) {} |
|
589 | | |
590 | | _LIBCPP_HIDE_FROM_ABI iter_type |
591 | 0 | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, bool& __v) const { |
592 | 0 | return do_get(__b, __e, __iob, __err, __v); |
593 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, bool&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, bool&) const |
594 | | |
595 | | _LIBCPP_HIDE_FROM_ABI iter_type |
596 | 0 | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long& __v) const { |
597 | 0 | return do_get(__b, __e, __iob, __err, __v); |
598 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, long&) const |
599 | | |
600 | | _LIBCPP_HIDE_FROM_ABI iter_type |
601 | 0 | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long long& __v) const { |
602 | 0 | return do_get(__b, __e, __iob, __err, __v); |
603 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long long&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, long long&) const |
604 | | |
605 | | _LIBCPP_HIDE_FROM_ABI iter_type |
606 | 0 | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned short& __v) const { |
607 | 0 | return do_get(__b, __e, __iob, __err, __v); |
608 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned short&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned short&) const |
609 | | |
610 | | _LIBCPP_HIDE_FROM_ABI iter_type |
611 | 3.73k | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned int& __v) const { |
612 | 3.73k | return do_get(__b, __e, __iob, __err, __v); |
613 | 3.73k | } std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned int&) const Line | Count | Source | 611 | 3.73k | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned int& __v) const { | 612 | 3.73k | return do_get(__b, __e, __iob, __err, __v); | 613 | 3.73k | } |
Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned int&) const |
614 | | |
615 | | _LIBCPP_HIDE_FROM_ABI iter_type |
616 | 0 | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned long& __v) const { |
617 | 0 | return do_get(__b, __e, __iob, __err, __v); |
618 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned long&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned long&) const |
619 | | |
620 | | _LIBCPP_HIDE_FROM_ABI iter_type |
621 | 0 | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned long long& __v) const { |
622 | 0 | return do_get(__b, __e, __iob, __err, __v); |
623 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned long long&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned long long&) const |
624 | | |
625 | | _LIBCPP_HIDE_FROM_ABI iter_type |
626 | 0 | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, float& __v) const { |
627 | 0 | return do_get(__b, __e, __iob, __err, __v); |
628 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, float&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, float&) const |
629 | | |
630 | | _LIBCPP_HIDE_FROM_ABI iter_type |
631 | 0 | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, double& __v) const { |
632 | 0 | return do_get(__b, __e, __iob, __err, __v); |
633 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, double&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, double&) const |
634 | | |
635 | | _LIBCPP_HIDE_FROM_ABI iter_type |
636 | 0 | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long double& __v) const { |
637 | 0 | return do_get(__b, __e, __iob, __err, __v); |
638 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long double&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, long double&) const |
639 | | |
640 | | _LIBCPP_HIDE_FROM_ABI iter_type |
641 | 0 | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, void*& __v) const { |
642 | 0 | return do_get(__b, __e, __iob, __err, __v); |
643 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get[abi:ne180100](std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, void*&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get[abi:ne180100](std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, void*&) const |
644 | | |
645 | | static locale::id id; |
646 | | |
647 | | protected: |
648 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~num_get() override {} |
649 | | |
650 | | template <class _Fp> |
651 | | _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS iter_type |
652 | | __do_get_floating_point(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Fp& __v) const; |
653 | | |
654 | | template <class _Signed> |
655 | | _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS iter_type |
656 | | __do_get_signed(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Signed& __v) const; |
657 | | |
658 | | template <class _Unsigned> |
659 | | _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS iter_type |
660 | | __do_get_unsigned(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Unsigned& __v) const; |
661 | | |
662 | | virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, bool& __v) const; |
663 | | |
664 | 0 | virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long& __v) const { |
665 | 0 | return this->__do_get_signed(__b, __e, __iob, __err, __v); |
666 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, long&) const |
667 | | |
668 | | virtual iter_type |
669 | 0 | do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long long& __v) const { |
670 | 0 | return this->__do_get_signed(__b, __e, __iob, __err, __v); |
671 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long long&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, long long&) const |
672 | | |
673 | | virtual iter_type |
674 | 0 | do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned short& __v) const { |
675 | 0 | return this->__do_get_unsigned(__b, __e, __iob, __err, __v); |
676 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned short&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned short&) const |
677 | | |
678 | | virtual iter_type |
679 | 3.73k | do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned int& __v) const { |
680 | 3.73k | return this->__do_get_unsigned(__b, __e, __iob, __err, __v); |
681 | 3.73k | } std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned int&) const Line | Count | Source | 679 | 3.73k | do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned int& __v) const { | 680 | 3.73k | return this->__do_get_unsigned(__b, __e, __iob, __err, __v); | 681 | 3.73k | } |
Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned int&) const |
682 | | |
683 | | virtual iter_type |
684 | 0 | do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned long& __v) const { |
685 | 0 | return this->__do_get_unsigned(__b, __e, __iob, __err, __v); |
686 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned long&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned long&) const |
687 | | |
688 | | virtual iter_type |
689 | 0 | do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned long long& __v) const { |
690 | 0 | return this->__do_get_unsigned(__b, __e, __iob, __err, __v); |
691 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned long long&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned long long&) const |
692 | | |
693 | 0 | virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, float& __v) const { |
694 | 0 | return this->__do_get_floating_point(__b, __e, __iob, __err, __v); |
695 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, float&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, float&) const |
696 | | |
697 | 0 | virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, double& __v) const { |
698 | 0 | return this->__do_get_floating_point(__b, __e, __iob, __err, __v); |
699 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, double&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, double&) const |
700 | | |
701 | | virtual iter_type |
702 | 0 | do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long double& __v) const { |
703 | 0 | return this->__do_get_floating_point(__b, __e, __iob, __err, __v); |
704 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long double&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, long double&) const |
705 | | |
706 | | virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, void*& __v) const; |
707 | | }; |
708 | | |
709 | | template <class _CharT, class _InputIterator> |
710 | | locale::id num_get<_CharT, _InputIterator>::id; |
711 | | |
712 | | template <class _Tp> |
713 | | _LIBCPP_HIDE_FROM_ABI _Tp |
714 | 0 | __num_get_signed_integral(const char* __a, const char* __a_end, ios_base::iostate& __err, int __base) { |
715 | 0 | if (__a != __a_end) { |
716 | 0 | __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno; |
717 | 0 | errno = 0; |
718 | 0 | char* __p2; |
719 | 0 | long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); |
720 | 0 | __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno; |
721 | 0 | if (__current_errno == 0) |
722 | 0 | errno = __save_errno; |
723 | 0 | if (__p2 != __a_end) { |
724 | 0 | __err = ios_base::failbit; |
725 | 0 | return 0; |
726 | 0 | } else if (__current_errno == ERANGE || __ll < numeric_limits<_Tp>::min() || numeric_limits<_Tp>::max() < __ll) { |
727 | 0 | __err = ios_base::failbit; |
728 | 0 | if (__ll > 0) |
729 | 0 | return numeric_limits<_Tp>::max(); |
730 | 0 | else |
731 | 0 | return numeric_limits<_Tp>::min(); |
732 | 0 | } |
733 | 0 | return static_cast<_Tp>(__ll); |
734 | 0 | } |
735 | 0 | __err = ios_base::failbit; |
736 | 0 | return 0; |
737 | 0 | } Unexecuted instantiation: long std::__1::__num_get_signed_integral[abi:ne180100]<long>(char const*, char const*, unsigned int&, int) Unexecuted instantiation: long long std::__1::__num_get_signed_integral[abi:ne180100]<long long>(char const*, char const*, unsigned int&, int) |
738 | | |
739 | | template <class _Tp> |
740 | | _LIBCPP_HIDE_FROM_ABI _Tp |
741 | 3.73k | __num_get_unsigned_integral(const char* __a, const char* __a_end, ios_base::iostate& __err, int __base) { |
742 | 3.73k | if (__a != __a_end) { |
743 | 3.38k | const bool __negate = *__a == '-'; |
744 | 3.38k | if (__negate && ++__a == __a_end) { |
745 | 13 | __err = ios_base::failbit; |
746 | 13 | return 0; |
747 | 13 | } |
748 | 3.36k | __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno; |
749 | 3.36k | errno = 0; |
750 | 3.36k | char* __p2; |
751 | 3.36k | unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); |
752 | 3.36k | __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno; |
753 | 3.36k | if (__current_errno == 0) |
754 | 3.21k | errno = __save_errno; |
755 | 3.36k | if (__p2 != __a_end) { |
756 | 10 | __err = ios_base::failbit; |
757 | 10 | return 0; |
758 | 3.35k | } else if (__current_errno == ERANGE || numeric_limits<_Tp>::max() < __ll) { |
759 | 433 | __err = ios_base::failbit; |
760 | 433 | return numeric_limits<_Tp>::max(); |
761 | 433 | } |
762 | 2.92k | _Tp __res = static_cast<_Tp>(__ll); |
763 | 2.92k | if (__negate) |
764 | 1.59k | __res = -__res; |
765 | 2.92k | return __res; |
766 | 3.36k | } |
767 | 350 | __err = ios_base::failbit; |
768 | 350 | return 0; |
769 | 3.73k | } Unexecuted instantiation: unsigned short std::__1::__num_get_unsigned_integral[abi:ne180100]<unsigned short>(char const*, char const*, unsigned int&, int) unsigned int std::__1::__num_get_unsigned_integral[abi:ne180100]<unsigned int>(char const*, char const*, unsigned int&, int) Line | Count | Source | 741 | 3.73k | __num_get_unsigned_integral(const char* __a, const char* __a_end, ios_base::iostate& __err, int __base) { | 742 | 3.73k | if (__a != __a_end) { | 743 | 3.38k | const bool __negate = *__a == '-'; | 744 | 3.38k | if (__negate && ++__a == __a_end) { | 745 | 13 | __err = ios_base::failbit; | 746 | 13 | return 0; | 747 | 13 | } | 748 | 3.36k | __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno; | 749 | 3.36k | errno = 0; | 750 | 3.36k | char* __p2; | 751 | 3.36k | unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); | 752 | 3.36k | __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno; | 753 | 3.36k | if (__current_errno == 0) | 754 | 3.21k | errno = __save_errno; | 755 | 3.36k | if (__p2 != __a_end) { | 756 | 10 | __err = ios_base::failbit; | 757 | 10 | return 0; | 758 | 3.35k | } else if (__current_errno == ERANGE || numeric_limits<_Tp>::max() < __ll) { | 759 | 433 | __err = ios_base::failbit; | 760 | 433 | return numeric_limits<_Tp>::max(); | 761 | 433 | } | 762 | 2.92k | _Tp __res = static_cast<_Tp>(__ll); | 763 | 2.92k | if (__negate) | 764 | 1.59k | __res = -__res; | 765 | 2.92k | return __res; | 766 | 3.36k | } | 767 | 350 | __err = ios_base::failbit; | 768 | 350 | return 0; | 769 | 3.73k | } |
Unexecuted instantiation: unsigned long std::__1::__num_get_unsigned_integral[abi:ne180100]<unsigned long>(char const*, char const*, unsigned int&, int) Unexecuted instantiation: unsigned long long std::__1::__num_get_unsigned_integral[abi:ne180100]<unsigned long long>(char const*, char const*, unsigned int&, int) |
770 | | |
771 | | template <class _Tp> |
772 | | _LIBCPP_HIDE_FROM_ABI _Tp __do_strtod(const char* __a, char** __p2); |
773 | | |
774 | | template <> |
775 | 0 | inline _LIBCPP_HIDE_FROM_ABI float __do_strtod<float>(const char* __a, char** __p2) { |
776 | 0 | return strtof_l(__a, __p2, _LIBCPP_GET_C_LOCALE); |
777 | 0 | } Unexecuted instantiation: float std::__1::__do_strtod[abi:ne180100]<float>(char const*, char**) Unexecuted instantiation: float std::__1::__do_strtod[abi:ne180100]<float>(char const*, char**) |
778 | | |
779 | | template <> |
780 | 0 | inline _LIBCPP_HIDE_FROM_ABI double __do_strtod<double>(const char* __a, char** __p2) { |
781 | 0 | return strtod_l(__a, __p2, _LIBCPP_GET_C_LOCALE); |
782 | 0 | } Unexecuted instantiation: double std::__1::__do_strtod[abi:ne180100]<double>(char const*, char**) Unexecuted instantiation: double std::__1::__do_strtod[abi:ne180100]<double>(char const*, char**) |
783 | | |
784 | | template <> |
785 | 0 | inline _LIBCPP_HIDE_FROM_ABI long double __do_strtod<long double>(const char* __a, char** __p2) { |
786 | 0 | return strtold_l(__a, __p2, _LIBCPP_GET_C_LOCALE); |
787 | 0 | } Unexecuted instantiation: long double std::__1::__do_strtod[abi:ne180100]<long double>(char const*, char**) Unexecuted instantiation: long double std::__1::__do_strtod[abi:ne180100]<long double>(char const*, char**) |
788 | | |
789 | | template <class _Tp> |
790 | 0 | _LIBCPP_HIDE_FROM_ABI _Tp __num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err) { |
791 | 0 | if (__a != __a_end) { |
792 | 0 | __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno; |
793 | 0 | errno = 0; |
794 | 0 | char* __p2; |
795 | 0 | _Tp __ld = std::__do_strtod<_Tp>(__a, &__p2); |
796 | 0 | __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno; |
797 | 0 | if (__current_errno == 0) |
798 | 0 | errno = __save_errno; |
799 | 0 | if (__p2 != __a_end) { |
800 | 0 | __err = ios_base::failbit; |
801 | 0 | return 0; |
802 | 0 | } else if (__current_errno == ERANGE) |
803 | 0 | __err = ios_base::failbit; |
804 | 0 | return __ld; |
805 | 0 | } |
806 | 0 | __err = ios_base::failbit; |
807 | 0 | return 0; |
808 | 0 | } Unexecuted instantiation: float std::__1::__num_get_float[abi:ne180100]<float>(char const*, char const*, unsigned int&) Unexecuted instantiation: double std::__1::__num_get_float[abi:ne180100]<double>(char const*, char const*, unsigned int&) Unexecuted instantiation: long double std::__1::__num_get_float[abi:ne180100]<long double>(char const*, char const*, unsigned int&) |
809 | | |
810 | | template <class _CharT, class _InputIterator> |
811 | | _InputIterator num_get<_CharT, _InputIterator>::do_get( |
812 | 0 | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, bool& __v) const { |
813 | 0 | if ((__iob.flags() & ios_base::boolalpha) == 0) { |
814 | 0 | long __lv = -1; |
815 | 0 | __b = do_get(__b, __e, __iob, __err, __lv); |
816 | 0 | switch (__lv) { |
817 | 0 | case 0: |
818 | 0 | __v = false; |
819 | 0 | break; |
820 | 0 | case 1: |
821 | 0 | __v = true; |
822 | 0 | break; |
823 | 0 | default: |
824 | 0 | __v = true; |
825 | 0 | __err = ios_base::failbit; |
826 | 0 | break; |
827 | 0 | } |
828 | 0 | return __b; |
829 | 0 | } |
830 | 0 | const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__iob.getloc()); |
831 | 0 | const numpunct<_CharT>& __np = std::use_facet<numpunct<_CharT> >(__iob.getloc()); |
832 | 0 | typedef typename numpunct<_CharT>::string_type string_type; |
833 | 0 | const string_type __names[2] = {__np.truename(), __np.falsename()}; |
834 | 0 | const string_type* __i = std::__scan_keyword(__b, __e, __names, __names + 2, __ct, __err); |
835 | 0 | __v = __i == __names; |
836 | 0 | return __b; |
837 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, bool&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, bool&) const |
838 | | |
839 | | // signed |
840 | | |
841 | | template <class _CharT, class _InputIterator> |
842 | | template <class _Signed> |
843 | | _InputIterator num_get<_CharT, _InputIterator>::__do_get_signed( |
844 | 0 | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Signed& __v) const { |
845 | | // Stage 1 |
846 | 0 | int __base = this->__get_base(__iob); |
847 | | // Stage 2 |
848 | 0 | char_type __thousands_sep; |
849 | 0 | const int __atoms_size = 26; |
850 | | #ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET |
851 | | char_type __atoms1[__atoms_size]; |
852 | | const char_type* __atoms = this->__do_widen(__iob, __atoms1); |
853 | | string __grouping = this->__stage2_int_prep(__iob, __thousands_sep); |
854 | | #else |
855 | 0 | char_type __atoms[__atoms_size]; |
856 | 0 | string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep); |
857 | 0 | #endif |
858 | 0 | string __buf; |
859 | 0 | __buf.resize(__buf.capacity()); |
860 | 0 | char* __a = &__buf[0]; |
861 | 0 | char* __a_end = __a; |
862 | 0 | unsigned __g[__num_get_base::__num_get_buf_sz]; |
863 | 0 | unsigned* __g_end = __g; |
864 | 0 | unsigned __dc = 0; |
865 | 0 | for (; __b != __e; ++__b) { |
866 | 0 | if (__a_end == __a + __buf.size()) { |
867 | 0 | size_t __tmp = __buf.size(); |
868 | 0 | __buf.resize(2 * __buf.size()); |
869 | 0 | __buf.resize(__buf.capacity()); |
870 | 0 | __a = &__buf[0]; |
871 | 0 | __a_end = __a + __tmp; |
872 | 0 | } |
873 | 0 | if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc, __thousands_sep, __grouping, __g, __g_end, __atoms)) |
874 | 0 | break; |
875 | 0 | } |
876 | 0 | if (__grouping.size() != 0 && __g_end - __g < __num_get_base::__num_get_buf_sz) |
877 | 0 | *__g_end++ = __dc; |
878 | | // Stage 3 |
879 | 0 | __v = std::__num_get_signed_integral<_Signed>(__a, __a_end, __err, __base); |
880 | | // Digit grouping checked |
881 | 0 | __check_grouping(__grouping, __g, __g_end, __err); |
882 | | // EOF checked |
883 | 0 | if (__b == __e) |
884 | 0 | __err |= ios_base::eofbit; |
885 | 0 | return __b; |
886 | 0 | } Unexecuted instantiation: std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_signed<long>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long&) const Unexecuted instantiation: std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_signed<long long>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long long&) const Unexecuted instantiation: std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_get_signed<long>(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, long&) const Unexecuted instantiation: std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_get_signed<long long>(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, long long&) const |
887 | | |
888 | | // unsigned |
889 | | |
890 | | template <class _CharT, class _InputIterator> |
891 | | template <class _Unsigned> |
892 | | _InputIterator num_get<_CharT, _InputIterator>::__do_get_unsigned( |
893 | 3.73k | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Unsigned& __v) const { |
894 | | // Stage 1 |
895 | 3.73k | int __base = this->__get_base(__iob); |
896 | | // Stage 2 |
897 | 3.73k | char_type __thousands_sep; |
898 | 3.73k | const int __atoms_size = 26; |
899 | | #ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET |
900 | | char_type __atoms1[__atoms_size]; |
901 | | const char_type* __atoms = this->__do_widen(__iob, __atoms1); |
902 | | string __grouping = this->__stage2_int_prep(__iob, __thousands_sep); |
903 | | #else |
904 | 3.73k | char_type __atoms[__atoms_size]; |
905 | 3.73k | string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep); |
906 | 3.73k | #endif |
907 | 3.73k | string __buf; |
908 | 3.73k | __buf.resize(__buf.capacity()); |
909 | 3.73k | char* __a = &__buf[0]; |
910 | 3.73k | char* __a_end = __a; |
911 | 3.73k | unsigned __g[__num_get_base::__num_get_buf_sz]; |
912 | 3.73k | unsigned* __g_end = __g; |
913 | 3.73k | unsigned __dc = 0; |
914 | 7.00M | for (; __b != __e; ++__b) { |
915 | 7.00M | if (__a_end == __a + __buf.size()) { |
916 | 2.18k | size_t __tmp = __buf.size(); |
917 | 2.18k | __buf.resize(2 * __buf.size()); |
918 | 2.18k | __buf.resize(__buf.capacity()); |
919 | 2.18k | __a = &__buf[0]; |
920 | 2.18k | __a_end = __a + __tmp; |
921 | 2.18k | } |
922 | 7.00M | if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc, __thousands_sep, __grouping, __g, __g_end, __atoms)) |
923 | 2.90k | break; |
924 | 7.00M | } |
925 | 3.73k | if (__grouping.size() != 0 && __g_end - __g < __num_get_base::__num_get_buf_sz) |
926 | 0 | *__g_end++ = __dc; |
927 | | // Stage 3 |
928 | 3.73k | __v = std::__num_get_unsigned_integral<_Unsigned>(__a, __a_end, __err, __base); |
929 | | // Digit grouping checked |
930 | 3.73k | __check_grouping(__grouping, __g, __g_end, __err); |
931 | | // EOF checked |
932 | 3.73k | if (__b == __e) |
933 | 830 | __err |= ios_base::eofbit; |
934 | 3.73k | return __b; |
935 | 3.73k | } Unexecuted instantiation: std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_unsigned<unsigned short>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned short&) const std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_unsigned<unsigned int>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned int&) const Line | Count | Source | 893 | 3.73k | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Unsigned& __v) const { | 894 | | // Stage 1 | 895 | 3.73k | int __base = this->__get_base(__iob); | 896 | | // Stage 2 | 897 | 3.73k | char_type __thousands_sep; | 898 | 3.73k | const int __atoms_size = 26; | 899 | | #ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET | 900 | | char_type __atoms1[__atoms_size]; | 901 | | const char_type* __atoms = this->__do_widen(__iob, __atoms1); | 902 | | string __grouping = this->__stage2_int_prep(__iob, __thousands_sep); | 903 | | #else | 904 | 3.73k | char_type __atoms[__atoms_size]; | 905 | 3.73k | string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep); | 906 | 3.73k | #endif | 907 | 3.73k | string __buf; | 908 | 3.73k | __buf.resize(__buf.capacity()); | 909 | 3.73k | char* __a = &__buf[0]; | 910 | 3.73k | char* __a_end = __a; | 911 | 3.73k | unsigned __g[__num_get_base::__num_get_buf_sz]; | 912 | 3.73k | unsigned* __g_end = __g; | 913 | 3.73k | unsigned __dc = 0; | 914 | 7.00M | for (; __b != __e; ++__b) { | 915 | 7.00M | if (__a_end == __a + __buf.size()) { | 916 | 2.18k | size_t __tmp = __buf.size(); | 917 | 2.18k | __buf.resize(2 * __buf.size()); | 918 | 2.18k | __buf.resize(__buf.capacity()); | 919 | 2.18k | __a = &__buf[0]; | 920 | 2.18k | __a_end = __a + __tmp; | 921 | 2.18k | } | 922 | 7.00M | if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc, __thousands_sep, __grouping, __g, __g_end, __atoms)) | 923 | 2.90k | break; | 924 | 7.00M | } | 925 | 3.73k | if (__grouping.size() != 0 && __g_end - __g < __num_get_base::__num_get_buf_sz) | 926 | 0 | *__g_end++ = __dc; | 927 | | // Stage 3 | 928 | 3.73k | __v = std::__num_get_unsigned_integral<_Unsigned>(__a, __a_end, __err, __base); | 929 | | // Digit grouping checked | 930 | 3.73k | __check_grouping(__grouping, __g, __g_end, __err); | 931 | | // EOF checked | 932 | 3.73k | if (__b == __e) | 933 | 830 | __err |= ios_base::eofbit; | 934 | 3.73k | return __b; | 935 | 3.73k | } |
Unexecuted instantiation: std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_unsigned<unsigned long>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned long&) const Unexecuted instantiation: std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_unsigned<unsigned long long>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned long long&) const Unexecuted instantiation: std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_get_unsigned<unsigned short>(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned short&) const Unexecuted instantiation: std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_get_unsigned<unsigned int>(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned int&) const Unexecuted instantiation: std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_get_unsigned<unsigned long>(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned long&) const Unexecuted instantiation: std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_get_unsigned<unsigned long long>(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, unsigned long long&) const |
936 | | |
937 | | // floating point |
938 | | |
939 | | template <class _CharT, class _InputIterator> |
940 | | template <class _Fp> |
941 | | _InputIterator num_get<_CharT, _InputIterator>::__do_get_floating_point( |
942 | 0 | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Fp& __v) const { |
943 | | // Stage 1, nothing to do |
944 | | // Stage 2 |
945 | 0 | char_type __atoms[32]; |
946 | 0 | char_type __decimal_point; |
947 | 0 | char_type __thousands_sep; |
948 | 0 | string __grouping = this->__stage2_float_prep(__iob, __atoms, __decimal_point, __thousands_sep); |
949 | 0 | string __buf; |
950 | 0 | __buf.resize(__buf.capacity()); |
951 | 0 | char* __a = &__buf[0]; |
952 | 0 | char* __a_end = __a; |
953 | 0 | unsigned __g[__num_get_base::__num_get_buf_sz]; |
954 | 0 | unsigned* __g_end = __g; |
955 | 0 | unsigned __dc = 0; |
956 | 0 | bool __in_units = true; |
957 | 0 | char __exp = 'E'; |
958 | 0 | for (; __b != __e; ++__b) { |
959 | 0 | if (__a_end == __a + __buf.size()) { |
960 | 0 | size_t __tmp = __buf.size(); |
961 | 0 | __buf.resize(2 * __buf.size()); |
962 | 0 | __buf.resize(__buf.capacity()); |
963 | 0 | __a = &__buf[0]; |
964 | 0 | __a_end = __a + __tmp; |
965 | 0 | } |
966 | 0 | if (this->__stage2_float_loop( |
967 | 0 | *__b, |
968 | 0 | __in_units, |
969 | 0 | __exp, |
970 | 0 | __a, |
971 | 0 | __a_end, |
972 | 0 | __decimal_point, |
973 | 0 | __thousands_sep, |
974 | 0 | __grouping, |
975 | 0 | __g, |
976 | 0 | __g_end, |
977 | 0 | __dc, |
978 | 0 | __atoms)) |
979 | 0 | break; |
980 | 0 | } |
981 | 0 | if (__grouping.size() != 0 && __in_units && __g_end - __g < __num_get_base::__num_get_buf_sz) |
982 | 0 | *__g_end++ = __dc; |
983 | | // Stage 3 |
984 | 0 | __v = std::__num_get_float<_Fp>(__a, __a_end, __err); |
985 | | // Digit grouping checked |
986 | 0 | __check_grouping(__grouping, __g, __g_end, __err); |
987 | | // EOF checked |
988 | 0 | if (__b == __e) |
989 | 0 | __err |= ios_base::eofbit; |
990 | 0 | return __b; |
991 | 0 | } Unexecuted instantiation: std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_floating_point<float>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, float&) const Unexecuted instantiation: std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_floating_point<double>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, double&) const Unexecuted instantiation: std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_floating_point<long double>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long double&) const Unexecuted instantiation: std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_get_floating_point<float>(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, float&) const Unexecuted instantiation: std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_get_floating_point<double>(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, double&) const Unexecuted instantiation: std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_get_floating_point<long double>(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, long double&) const |
992 | | |
993 | | template <class _CharT, class _InputIterator> |
994 | | _InputIterator num_get<_CharT, _InputIterator>::do_get( |
995 | 0 | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, void*& __v) const { |
996 | | // Stage 1 |
997 | 0 | int __base = 16; |
998 | | // Stage 2 |
999 | 0 | char_type __atoms[26]; |
1000 | 0 | char_type __thousands_sep = char_type(); |
1001 | 0 | string __grouping; |
1002 | 0 | std::use_facet<ctype<_CharT> >(__iob.getloc()).widen(__num_get_base::__src, __num_get_base::__src + 26, __atoms); |
1003 | 0 | string __buf; |
1004 | 0 | __buf.resize(__buf.capacity()); |
1005 | 0 | char* __a = &__buf[0]; |
1006 | 0 | char* __a_end = __a; |
1007 | 0 | unsigned __g[__num_get_base::__num_get_buf_sz]; |
1008 | 0 | unsigned* __g_end = __g; |
1009 | 0 | unsigned __dc = 0; |
1010 | 0 | for (; __b != __e; ++__b) { |
1011 | 0 | if (__a_end == __a + __buf.size()) { |
1012 | 0 | size_t __tmp = __buf.size(); |
1013 | 0 | __buf.resize(2 * __buf.size()); |
1014 | 0 | __buf.resize(__buf.capacity()); |
1015 | 0 | __a = &__buf[0]; |
1016 | 0 | __a_end = __a + __tmp; |
1017 | 0 | } |
1018 | 0 | if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc, __thousands_sep, __grouping, __g, __g_end, __atoms)) |
1019 | 0 | break; |
1020 | 0 | } |
1021 | | // Stage 3 |
1022 | 0 | __buf.resize(__a_end - __a); |
1023 | 0 | if (__libcpp_sscanf_l(__buf.c_str(), _LIBCPP_GET_C_LOCALE, "%p", &__v) != 1) |
1024 | 0 | __err = ios_base::failbit; |
1025 | | // EOF checked |
1026 | 0 | if (__b == __e) |
1027 | 0 | __err |= ios_base::eofbit; |
1028 | 0 | return __b; |
1029 | 0 | } Unexecuted instantiation: std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, void*&) const Unexecuted instantiation: std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, void*&) const |
1030 | | |
1031 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>; |
1032 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
1033 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>; |
1034 | | #endif |
1035 | | |
1036 | | struct _LIBCPP_EXPORTED_FROM_ABI __num_put_base { |
1037 | | protected: |
1038 | | static void __format_int(char* __fmt, const char* __len, bool __signd, ios_base::fmtflags __flags); |
1039 | | static bool __format_float(char* __fmt, const char* __len, ios_base::fmtflags __flags); |
1040 | | static char* __identify_padding(char* __nb, char* __ne, const ios_base& __iob); |
1041 | | }; |
1042 | | |
1043 | | template <class _CharT> |
1044 | | struct __num_put : protected __num_put_base { |
1045 | | static void __widen_and_group_int( |
1046 | | char* __nb, char* __np, char* __ne, _CharT* __ob, _CharT*& __op, _CharT*& __oe, const locale& __loc); |
1047 | | static void __widen_and_group_float( |
1048 | | char* __nb, char* __np, char* __ne, _CharT* __ob, _CharT*& __op, _CharT*& __oe, const locale& __loc); |
1049 | | }; |
1050 | | |
1051 | | template <class _CharT> |
1052 | | void __num_put<_CharT>::__widen_and_group_int( |
1053 | 4.59k | char* __nb, char* __np, char* __ne, _CharT* __ob, _CharT*& __op, _CharT*& __oe, const locale& __loc) { |
1054 | 4.59k | const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__loc); |
1055 | 4.59k | const numpunct<_CharT>& __npt = std::use_facet<numpunct<_CharT> >(__loc); |
1056 | 4.59k | string __grouping = __npt.grouping(); |
1057 | 4.59k | if (__grouping.empty()) { |
1058 | 4.59k | __ct.widen(__nb, __ne, __ob); |
1059 | 4.59k | __oe = __ob + (__ne - __nb); |
1060 | 4.59k | } else { |
1061 | 0 | __oe = __ob; |
1062 | 0 | char* __nf = __nb; |
1063 | 0 | if (*__nf == '-' || *__nf == '+') |
1064 | 0 | *__oe++ = __ct.widen(*__nf++); |
1065 | 0 | if (__ne - __nf >= 2 && __nf[0] == '0' && (__nf[1] == 'x' || __nf[1] == 'X')) { |
1066 | 0 | *__oe++ = __ct.widen(*__nf++); |
1067 | 0 | *__oe++ = __ct.widen(*__nf++); |
1068 | 0 | } |
1069 | 0 | std::reverse(__nf, __ne); |
1070 | 0 | _CharT __thousands_sep = __npt.thousands_sep(); |
1071 | 0 | unsigned __dc = 0; |
1072 | 0 | unsigned __dg = 0; |
1073 | 0 | for (char* __p = __nf; __p < __ne; ++__p) { |
1074 | 0 | if (static_cast<unsigned>(__grouping[__dg]) > 0 && __dc == static_cast<unsigned>(__grouping[__dg])) { |
1075 | 0 | *__oe++ = __thousands_sep; |
1076 | 0 | __dc = 0; |
1077 | 0 | if (__dg < __grouping.size() - 1) |
1078 | 0 | ++__dg; |
1079 | 0 | } |
1080 | 0 | *__oe++ = __ct.widen(*__p); |
1081 | 0 | ++__dc; |
1082 | 0 | } |
1083 | 0 | std::reverse(__ob + (__nf - __nb), __oe); |
1084 | 0 | } |
1085 | 4.59k | if (__np == __ne) |
1086 | 0 | __op = __oe; |
1087 | 4.59k | else |
1088 | 4.59k | __op = __ob + (__np - __nb); |
1089 | 4.59k | } std::__1::__num_put<char>::__widen_and_group_int(char*, char*, char*, char*, char*&, char*&, std::__1::locale const&) Line | Count | Source | 1053 | 4.59k | char* __nb, char* __np, char* __ne, _CharT* __ob, _CharT*& __op, _CharT*& __oe, const locale& __loc) { | 1054 | 4.59k | const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__loc); | 1055 | 4.59k | const numpunct<_CharT>& __npt = std::use_facet<numpunct<_CharT> >(__loc); | 1056 | 4.59k | string __grouping = __npt.grouping(); | 1057 | 4.59k | if (__grouping.empty()) { | 1058 | 4.59k | __ct.widen(__nb, __ne, __ob); | 1059 | 4.59k | __oe = __ob + (__ne - __nb); | 1060 | 4.59k | } else { | 1061 | 0 | __oe = __ob; | 1062 | 0 | char* __nf = __nb; | 1063 | 0 | if (*__nf == '-' || *__nf == '+') | 1064 | 0 | *__oe++ = __ct.widen(*__nf++); | 1065 | 0 | if (__ne - __nf >= 2 && __nf[0] == '0' && (__nf[1] == 'x' || __nf[1] == 'X')) { | 1066 | 0 | *__oe++ = __ct.widen(*__nf++); | 1067 | 0 | *__oe++ = __ct.widen(*__nf++); | 1068 | 0 | } | 1069 | 0 | std::reverse(__nf, __ne); | 1070 | 0 | _CharT __thousands_sep = __npt.thousands_sep(); | 1071 | 0 | unsigned __dc = 0; | 1072 | 0 | unsigned __dg = 0; | 1073 | 0 | for (char* __p = __nf; __p < __ne; ++__p) { | 1074 | 0 | if (static_cast<unsigned>(__grouping[__dg]) > 0 && __dc == static_cast<unsigned>(__grouping[__dg])) { | 1075 | 0 | *__oe++ = __thousands_sep; | 1076 | 0 | __dc = 0; | 1077 | 0 | if (__dg < __grouping.size() - 1) | 1078 | 0 | ++__dg; | 1079 | 0 | } | 1080 | 0 | *__oe++ = __ct.widen(*__p); | 1081 | 0 | ++__dc; | 1082 | 0 | } | 1083 | 0 | std::reverse(__ob + (__nf - __nb), __oe); | 1084 | 0 | } | 1085 | 4.59k | if (__np == __ne) | 1086 | 0 | __op = __oe; | 1087 | 4.59k | else | 1088 | 4.59k | __op = __ob + (__np - __nb); | 1089 | 4.59k | } |
Unexecuted instantiation: std::__1::__num_put<wchar_t>::__widen_and_group_int(char*, char*, char*, wchar_t*, wchar_t*&, wchar_t*&, std::__1::locale const&) |
1090 | | |
1091 | | template <class _CharT> |
1092 | | void __num_put<_CharT>::__widen_and_group_float( |
1093 | 0 | char* __nb, char* __np, char* __ne, _CharT* __ob, _CharT*& __op, _CharT*& __oe, const locale& __loc) { |
1094 | 0 | const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__loc); |
1095 | 0 | const numpunct<_CharT>& __npt = std::use_facet<numpunct<_CharT> >(__loc); |
1096 | 0 | string __grouping = __npt.grouping(); |
1097 | 0 | __oe = __ob; |
1098 | 0 | char* __nf = __nb; |
1099 | 0 | if (*__nf == '-' || *__nf == '+') |
1100 | 0 | *__oe++ = __ct.widen(*__nf++); |
1101 | 0 | char* __ns; |
1102 | 0 | if (__ne - __nf >= 2 && __nf[0] == '0' && (__nf[1] == 'x' || __nf[1] == 'X')) { |
1103 | 0 | *__oe++ = __ct.widen(*__nf++); |
1104 | 0 | *__oe++ = __ct.widen(*__nf++); |
1105 | 0 | for (__ns = __nf; __ns < __ne; ++__ns) |
1106 | 0 | if (!isxdigit_l(*__ns, _LIBCPP_GET_C_LOCALE)) |
1107 | 0 | break; |
1108 | 0 | } else { |
1109 | 0 | for (__ns = __nf; __ns < __ne; ++__ns) |
1110 | 0 | if (!isdigit_l(*__ns, _LIBCPP_GET_C_LOCALE)) |
1111 | 0 | break; |
1112 | 0 | } |
1113 | 0 | if (__grouping.empty()) { |
1114 | 0 | __ct.widen(__nf, __ns, __oe); |
1115 | 0 | __oe += __ns - __nf; |
1116 | 0 | } else { |
1117 | 0 | std::reverse(__nf, __ns); |
1118 | 0 | _CharT __thousands_sep = __npt.thousands_sep(); |
1119 | 0 | unsigned __dc = 0; |
1120 | 0 | unsigned __dg = 0; |
1121 | 0 | for (char* __p = __nf; __p < __ns; ++__p) { |
1122 | 0 | if (__grouping[__dg] > 0 && __dc == static_cast<unsigned>(__grouping[__dg])) { |
1123 | 0 | *__oe++ = __thousands_sep; |
1124 | 0 | __dc = 0; |
1125 | 0 | if (__dg < __grouping.size() - 1) |
1126 | 0 | ++__dg; |
1127 | 0 | } |
1128 | 0 | *__oe++ = __ct.widen(*__p); |
1129 | 0 | ++__dc; |
1130 | 0 | } |
1131 | 0 | std::reverse(__ob + (__nf - __nb), __oe); |
1132 | 0 | } |
1133 | 0 | for (__nf = __ns; __nf < __ne; ++__nf) { |
1134 | 0 | if (*__nf == '.') { |
1135 | 0 | *__oe++ = __npt.decimal_point(); |
1136 | 0 | ++__nf; |
1137 | 0 | break; |
1138 | 0 | } else |
1139 | 0 | *__oe++ = __ct.widen(*__nf); |
1140 | 0 | } |
1141 | 0 | __ct.widen(__nf, __ne, __oe); |
1142 | 0 | __oe += __ne - __nf; |
1143 | 0 | if (__np == __ne) |
1144 | 0 | __op = __oe; |
1145 | 0 | else |
1146 | 0 | __op = __ob + (__np - __nb); |
1147 | 0 | } Unexecuted instantiation: std::__1::__num_put<char>::__widen_and_group_float(char*, char*, char*, char*, char*&, char*&, std::__1::locale const&) Unexecuted instantiation: std::__1::__num_put<wchar_t>::__widen_and_group_float(char*, char*, char*, wchar_t*, wchar_t*&, wchar_t*&, std::__1::locale const&) |
1148 | | |
1149 | | extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>; |
1150 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
1151 | | extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>; |
1152 | | #endif |
1153 | | |
1154 | | template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> > |
1155 | | class _LIBCPP_TEMPLATE_VIS num_put : public locale::facet, private __num_put<_CharT> { |
1156 | | public: |
1157 | | typedef _CharT char_type; |
1158 | | typedef _OutputIterator iter_type; |
1159 | | |
1160 | 12 | _LIBCPP_HIDE_FROM_ABI explicit num_put(size_t __refs = 0) : locale::facet(__refs) {} std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::num_put[abi:ne180100](unsigned long) Line | Count | Source | 1160 | 6 | _LIBCPP_HIDE_FROM_ABI explicit num_put(size_t __refs = 0) : locale::facet(__refs) {} |
std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::num_put[abi:ne180100](unsigned long) Line | Count | Source | 1160 | 6 | _LIBCPP_HIDE_FROM_ABI explicit num_put(size_t __refs = 0) : locale::facet(__refs) {} |
|
1161 | | |
1162 | 0 | _LIBCPP_HIDE_FROM_ABI iter_type put(iter_type __s, ios_base& __iob, char_type __fl, bool __v) const { |
1163 | 0 | return do_put(__s, __iob, __fl, __v); |
1164 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, bool) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, bool) const |
1165 | | |
1166 | 0 | _LIBCPP_HIDE_FROM_ABI iter_type put(iter_type __s, ios_base& __iob, char_type __fl, long __v) const { |
1167 | 0 | return do_put(__s, __iob, __fl, __v); |
1168 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, long) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, long) const |
1169 | | |
1170 | 0 | _LIBCPP_HIDE_FROM_ABI iter_type put(iter_type __s, ios_base& __iob, char_type __fl, long long __v) const { |
1171 | 0 | return do_put(__s, __iob, __fl, __v); |
1172 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, long long) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, long long) const |
1173 | | |
1174 | 4.59k | _LIBCPP_HIDE_FROM_ABI iter_type put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long __v) const { |
1175 | 4.59k | return do_put(__s, __iob, __fl, __v); |
1176 | 4.59k | } std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, unsigned long) const Line | Count | Source | 1174 | 4.59k | _LIBCPP_HIDE_FROM_ABI iter_type put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long __v) const { | 1175 | 4.59k | return do_put(__s, __iob, __fl, __v); | 1176 | 4.59k | } |
Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, unsigned long) const |
1177 | | |
1178 | 0 | _LIBCPP_HIDE_FROM_ABI iter_type put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long long __v) const { |
1179 | 0 | return do_put(__s, __iob, __fl, __v); |
1180 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, unsigned long long) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, unsigned long long) const |
1181 | | |
1182 | 0 | _LIBCPP_HIDE_FROM_ABI iter_type put(iter_type __s, ios_base& __iob, char_type __fl, double __v) const { |
1183 | 0 | return do_put(__s, __iob, __fl, __v); |
1184 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, double) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, double) const |
1185 | | |
1186 | 0 | _LIBCPP_HIDE_FROM_ABI iter_type put(iter_type __s, ios_base& __iob, char_type __fl, long double __v) const { |
1187 | 0 | return do_put(__s, __iob, __fl, __v); |
1188 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, long double) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, long double) const |
1189 | | |
1190 | 0 | _LIBCPP_HIDE_FROM_ABI iter_type put(iter_type __s, ios_base& __iob, char_type __fl, const void* __v) const { |
1191 | 0 | return do_put(__s, __iob, __fl, __v); |
1192 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, void const*) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::put[abi:ne180100](std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, void const*) const |
1193 | | |
1194 | | static locale::id id; |
1195 | | |
1196 | | protected: |
1197 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~num_put() override {} |
1198 | | |
1199 | | virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl, bool __v) const; |
1200 | | virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl, long __v) const; |
1201 | | virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl, long long __v) const; |
1202 | | virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long) const; |
1203 | | virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long long) const; |
1204 | | virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl, double __v) const; |
1205 | | virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl, long double __v) const; |
1206 | | virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl, const void* __v) const; |
1207 | | |
1208 | | template <class _Integral> |
1209 | | _LIBCPP_HIDE_FROM_ABI inline _OutputIterator |
1210 | | __do_put_integral(iter_type __s, ios_base& __iob, char_type __fl, _Integral __v, char const* __len) const; |
1211 | | |
1212 | | template <class _Float> |
1213 | | _LIBCPP_HIDE_FROM_ABI inline _OutputIterator |
1214 | | __do_put_floating_point(iter_type __s, ios_base& __iob, char_type __fl, _Float __v, char const* __len) const; |
1215 | | }; |
1216 | | |
1217 | | template <class _CharT, class _OutputIterator> |
1218 | | locale::id num_put<_CharT, _OutputIterator>::id; |
1219 | | |
1220 | | template <class _CharT, class _OutputIterator> |
1221 | | _LIBCPP_HIDE_FROM_ABI _OutputIterator __pad_and_output( |
1222 | | _OutputIterator __s, const _CharT* __ob, const _CharT* __op, const _CharT* __oe, ios_base& __iob, _CharT __fl) { |
1223 | | streamsize __sz = __oe - __ob; |
1224 | | streamsize __ns = __iob.width(); |
1225 | | if (__ns > __sz) |
1226 | | __ns -= __sz; |
1227 | | else |
1228 | | __ns = 0; |
1229 | | for (; __ob < __op; ++__ob, ++__s) |
1230 | | *__s = *__ob; |
1231 | | for (; __ns; --__ns, ++__s) |
1232 | | *__s = __fl; |
1233 | | for (; __ob < __oe; ++__ob, ++__s) |
1234 | | *__s = *__ob; |
1235 | | __iob.width(0); |
1236 | | return __s; |
1237 | | } |
1238 | | |
1239 | | template <class _CharT, class _Traits> |
1240 | | _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_CharT, _Traits> __pad_and_output( |
1241 | | ostreambuf_iterator<_CharT, _Traits> __s, |
1242 | | const _CharT* __ob, |
1243 | | const _CharT* __op, |
1244 | | const _CharT* __oe, |
1245 | | ios_base& __iob, |
1246 | 11.5k | _CharT __fl) { |
1247 | 11.5k | if (__s.__sbuf_ == nullptr) |
1248 | 0 | return __s; |
1249 | 11.5k | streamsize __sz = __oe - __ob; |
1250 | 11.5k | streamsize __ns = __iob.width(); |
1251 | 11.5k | if (__ns > __sz) |
1252 | 0 | __ns -= __sz; |
1253 | 11.5k | else |
1254 | 11.5k | __ns = 0; |
1255 | 11.5k | streamsize __np = __op - __ob; |
1256 | 11.5k | if (__np > 0) { |
1257 | 0 | if (__s.__sbuf_->sputn(__ob, __np) != __np) { |
1258 | 0 | __s.__sbuf_ = nullptr; |
1259 | 0 | return __s; |
1260 | 0 | } |
1261 | 0 | } |
1262 | 11.5k | if (__ns > 0) { |
1263 | 0 | basic_string<_CharT, _Traits> __sp(__ns, __fl); |
1264 | 0 | if (__s.__sbuf_->sputn(__sp.data(), __ns) != __ns) { |
1265 | 0 | __s.__sbuf_ = nullptr; |
1266 | 0 | return __s; |
1267 | 0 | } |
1268 | 0 | } |
1269 | 11.5k | __np = __oe - __op; |
1270 | 11.5k | if (__np > 0) { |
1271 | 11.5k | if (__s.__sbuf_->sputn(__op, __np) != __np) { |
1272 | 0 | __s.__sbuf_ = nullptr; |
1273 | 0 | return __s; |
1274 | 0 | } |
1275 | 11.5k | } |
1276 | 11.5k | __iob.width(0); |
1277 | 11.5k | return __s; |
1278 | 11.5k | } std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output[abi:ne180100]<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) Line | Count | Source | 1246 | 11.5k | _CharT __fl) { | 1247 | 11.5k | if (__s.__sbuf_ == nullptr) | 1248 | 0 | return __s; | 1249 | 11.5k | streamsize __sz = __oe - __ob; | 1250 | 11.5k | streamsize __ns = __iob.width(); | 1251 | 11.5k | if (__ns > __sz) | 1252 | 0 | __ns -= __sz; | 1253 | 11.5k | else | 1254 | 11.5k | __ns = 0; | 1255 | 11.5k | streamsize __np = __op - __ob; | 1256 | 11.5k | if (__np > 0) { | 1257 | 0 | if (__s.__sbuf_->sputn(__ob, __np) != __np) { | 1258 | 0 | __s.__sbuf_ = nullptr; | 1259 | 0 | return __s; | 1260 | 0 | } | 1261 | 0 | } | 1262 | 11.5k | if (__ns > 0) { | 1263 | 0 | basic_string<_CharT, _Traits> __sp(__ns, __fl); | 1264 | 0 | if (__s.__sbuf_->sputn(__sp.data(), __ns) != __ns) { | 1265 | 0 | __s.__sbuf_ = nullptr; | 1266 | 0 | return __s; | 1267 | 0 | } | 1268 | 0 | } | 1269 | 11.5k | __np = __oe - __op; | 1270 | 11.5k | if (__np > 0) { | 1271 | 11.5k | if (__s.__sbuf_->sputn(__op, __np) != __np) { | 1272 | 0 | __s.__sbuf_ = nullptr; | 1273 | 0 | return __s; | 1274 | 0 | } | 1275 | 11.5k | } | 1276 | 11.5k | __iob.width(0); | 1277 | 11.5k | return __s; | 1278 | 11.5k | } |
Unexecuted instantiation: std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::__pad_and_output[abi:ne180100]<wchar_t, std::__1::char_traits<wchar_t> >(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, wchar_t const*, wchar_t const*, wchar_t const*, std::__1::ios_base&, wchar_t) |
1279 | | |
1280 | | template <class _CharT, class _OutputIterator> |
1281 | | _OutputIterator |
1282 | 0 | num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_type __fl, bool __v) const { |
1283 | 0 | if ((__iob.flags() & ios_base::boolalpha) == 0) |
1284 | 0 | return do_put(__s, __iob, __fl, (unsigned long)__v); |
1285 | 0 | const numpunct<char_type>& __np = std::use_facet<numpunct<char_type> >(__iob.getloc()); |
1286 | 0 | typedef typename numpunct<char_type>::string_type string_type; |
1287 | 0 | string_type __nm = __v ? __np.truename() : __np.falsename(); |
1288 | 0 | for (typename string_type::iterator __i = __nm.begin(); __i != __nm.end(); ++__i, ++__s) |
1289 | 0 | *__s = *__i; |
1290 | 0 | return __s; |
1291 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, bool) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, bool) const |
1292 | | |
1293 | | template <class _CharT, class _OutputIterator> |
1294 | | template <class _Integral> |
1295 | | _LIBCPP_HIDE_FROM_ABI inline _OutputIterator num_put<_CharT, _OutputIterator>::__do_put_integral( |
1296 | 4.59k | iter_type __s, ios_base& __iob, char_type __fl, _Integral __v, char const* __len) const { |
1297 | | // Stage 1 - Get number in narrow char |
1298 | 4.59k | char __fmt[8] = {'%', 0}; |
1299 | 4.59k | this->__format_int(__fmt + 1, __len, is_signed<_Integral>::value, __iob.flags()); |
1300 | | // Worst case is octal, with showbase enabled. Note that octal is always |
1301 | | // printed as an unsigned value. |
1302 | 4.59k | using _Unsigned = typename make_unsigned<_Integral>::type; |
1303 | 4.59k | _LIBCPP_CONSTEXPR const unsigned __nbuf = |
1304 | 4.59k | (numeric_limits<_Unsigned>::digits / 3) // 1 char per 3 bits |
1305 | 4.59k | + ((numeric_limits<_Unsigned>::digits % 3) != 0) // round up |
1306 | 4.59k | + 2; // base prefix + terminating null character |
1307 | 4.59k | char __nar[__nbuf]; |
1308 | 4.59k | _LIBCPP_DIAGNOSTIC_PUSH |
1309 | 4.59k | _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") |
1310 | 4.59k | _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") |
1311 | 4.59k | int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); |
1312 | 4.59k | _LIBCPP_DIAGNOSTIC_POP |
1313 | 4.59k | char* __ne = __nar + __nc; |
1314 | 4.59k | char* __np = this->__identify_padding(__nar, __ne, __iob); |
1315 | | // Stage 2 - Widen __nar while adding thousands separators |
1316 | 4.59k | char_type __o[2 * (__nbuf - 1) - 1]; |
1317 | 4.59k | char_type* __op; // pad here |
1318 | 4.59k | char_type* __oe; // end of output |
1319 | 4.59k | this->__widen_and_group_int(__nar, __np, __ne, __o, __op, __oe, __iob.getloc()); |
1320 | | // [__o, __oe) contains thousands_sep'd wide number |
1321 | | // Stage 3 & 4 |
1322 | 4.59k | return std::__pad_and_output(__s, __o, __op, __oe, __iob, __fl); |
1323 | 4.59k | } Unexecuted instantiation: std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::__do_put_integral[abi:ne180100]<long>(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, long, char const*) const Unexecuted instantiation: std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::__do_put_integral[abi:ne180100]<long long>(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, long long, char const*) const std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::__do_put_integral[abi:ne180100]<unsigned long>(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, unsigned long, char const*) const Line | Count | Source | 1296 | 4.59k | iter_type __s, ios_base& __iob, char_type __fl, _Integral __v, char const* __len) const { | 1297 | | // Stage 1 - Get number in narrow char | 1298 | 4.59k | char __fmt[8] = {'%', 0}; | 1299 | 4.59k | this->__format_int(__fmt + 1, __len, is_signed<_Integral>::value, __iob.flags()); | 1300 | | // Worst case is octal, with showbase enabled. Note that octal is always | 1301 | | // printed as an unsigned value. | 1302 | 4.59k | using _Unsigned = typename make_unsigned<_Integral>::type; | 1303 | 4.59k | _LIBCPP_CONSTEXPR const unsigned __nbuf = | 1304 | 4.59k | (numeric_limits<_Unsigned>::digits / 3) // 1 char per 3 bits | 1305 | 4.59k | + ((numeric_limits<_Unsigned>::digits % 3) != 0) // round up | 1306 | 4.59k | + 2; // base prefix + terminating null character | 1307 | 4.59k | char __nar[__nbuf]; | 1308 | 4.59k | _LIBCPP_DIAGNOSTIC_PUSH | 1309 | 4.59k | _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") | 1310 | 4.59k | _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") | 1311 | 4.59k | int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); | 1312 | 4.59k | _LIBCPP_DIAGNOSTIC_POP | 1313 | 4.59k | char* __ne = __nar + __nc; | 1314 | 4.59k | char* __np = this->__identify_padding(__nar, __ne, __iob); | 1315 | | // Stage 2 - Widen __nar while adding thousands separators | 1316 | 4.59k | char_type __o[2 * (__nbuf - 1) - 1]; | 1317 | 4.59k | char_type* __op; // pad here | 1318 | 4.59k | char_type* __oe; // end of output | 1319 | 4.59k | this->__widen_and_group_int(__nar, __np, __ne, __o, __op, __oe, __iob.getloc()); | 1320 | | // [__o, __oe) contains thousands_sep'd wide number | 1321 | | // Stage 3 & 4 | 1322 | 4.59k | return std::__pad_and_output(__s, __o, __op, __oe, __iob, __fl); | 1323 | 4.59k | } |
Unexecuted instantiation: std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::__do_put_integral[abi:ne180100]<unsigned long long>(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, unsigned long long, char const*) const Unexecuted instantiation: std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_put_integral[abi:ne180100]<long>(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, long, char const*) const Unexecuted instantiation: std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_put_integral[abi:ne180100]<long long>(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, long long, char const*) const Unexecuted instantiation: std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_put_integral[abi:ne180100]<unsigned long>(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, unsigned long, char const*) const Unexecuted instantiation: std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_put_integral[abi:ne180100]<unsigned long long>(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, unsigned long long, char const*) const |
1324 | | |
1325 | | template <class _CharT, class _OutputIterator> |
1326 | | _OutputIterator |
1327 | 0 | num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_type __fl, long __v) const { |
1328 | 0 | return this->__do_put_integral(__s, __iob, __fl, __v, "l"); |
1329 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, long) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, long) const |
1330 | | |
1331 | | template <class _CharT, class _OutputIterator> |
1332 | | _OutputIterator |
1333 | 0 | num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_type __fl, long long __v) const { |
1334 | 0 | return this->__do_put_integral(__s, __iob, __fl, __v, "ll"); |
1335 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, long long) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, long long) const |
1336 | | |
1337 | | template <class _CharT, class _OutputIterator> |
1338 | | _OutputIterator |
1339 | 4.59k | num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long __v) const { |
1340 | 4.59k | return this->__do_put_integral(__s, __iob, __fl, __v, "l"); |
1341 | 4.59k | } std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, unsigned long) const Line | Count | Source | 1339 | 4.59k | num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long __v) const { | 1340 | 4.59k | return this->__do_put_integral(__s, __iob, __fl, __v, "l"); | 1341 | 4.59k | } |
Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, unsigned long) const |
1342 | | |
1343 | | template <class _CharT, class _OutputIterator> |
1344 | | _OutputIterator |
1345 | 0 | num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long long __v) const { |
1346 | 0 | return this->__do_put_integral(__s, __iob, __fl, __v, "ll"); |
1347 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, unsigned long long) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, unsigned long long) const |
1348 | | |
1349 | | template <class _CharT, class _OutputIterator> |
1350 | | template <class _Float> |
1351 | | _LIBCPP_HIDE_FROM_ABI inline _OutputIterator num_put<_CharT, _OutputIterator>::__do_put_floating_point( |
1352 | 0 | iter_type __s, ios_base& __iob, char_type __fl, _Float __v, char const* __len) const { |
1353 | | // Stage 1 - Get number in narrow char |
1354 | 0 | char __fmt[8] = {'%', 0}; |
1355 | 0 | bool __specify_precision = this->__format_float(__fmt + 1, __len, __iob.flags()); |
1356 | 0 | const unsigned __nbuf = 30; |
1357 | 0 | char __nar[__nbuf]; |
1358 | 0 | char* __nb = __nar; |
1359 | 0 | int __nc; |
1360 | 0 | _LIBCPP_DIAGNOSTIC_PUSH |
1361 | 0 | _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") |
1362 | 0 | _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") |
1363 | 0 | if (__specify_precision) |
1364 | 0 | __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); |
1365 | 0 | else |
1366 | 0 | __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v); |
1367 | 0 | unique_ptr<char, void (*)(void*)> __nbh(nullptr, free); |
1368 | 0 | if (__nc > static_cast<int>(__nbuf - 1)) { |
1369 | 0 | if (__specify_precision) |
1370 | 0 | __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); |
1371 | 0 | else |
1372 | 0 | __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v); |
1373 | 0 | if (__nc == -1) |
1374 | 0 | __throw_bad_alloc(); |
1375 | 0 | __nbh.reset(__nb); |
1376 | 0 | } |
1377 | 0 | _LIBCPP_DIAGNOSTIC_POP |
1378 | 0 | char* __ne = __nb + __nc; |
1379 | 0 | char* __np = this->__identify_padding(__nb, __ne, __iob); |
1380 | | // Stage 2 - Widen __nar while adding thousands separators |
1381 | 0 | char_type __o[2 * (__nbuf - 1) - 1]; |
1382 | 0 | char_type* __ob = __o; |
1383 | 0 | unique_ptr<char_type, void (*)(void*)> __obh(0, free); |
1384 | 0 | if (__nb != __nar) { |
1385 | 0 | __ob = (char_type*)malloc(2 * static_cast<size_t>(__nc) * sizeof(char_type)); |
1386 | 0 | if (__ob == 0) |
1387 | 0 | __throw_bad_alloc(); |
1388 | 0 | __obh.reset(__ob); |
1389 | 0 | } |
1390 | 0 | char_type* __op; // pad here |
1391 | 0 | char_type* __oe; // end of output |
1392 | 0 | this->__widen_and_group_float(__nb, __np, __ne, __ob, __op, __oe, __iob.getloc()); |
1393 | | // [__o, __oe) contains thousands_sep'd wide number |
1394 | | // Stage 3 & 4 |
1395 | 0 | __s = std::__pad_and_output(__s, __ob, __op, __oe, __iob, __fl); |
1396 | 0 | return __s; |
1397 | 0 | } Unexecuted instantiation: std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::__do_put_floating_point[abi:ne180100]<double>(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, double, char const*) const Unexecuted instantiation: std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::__do_put_floating_point[abi:ne180100]<long double>(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, long double, char const*) const Unexecuted instantiation: std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_put_floating_point[abi:ne180100]<double>(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, double, char const*) const Unexecuted instantiation: std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_put_floating_point[abi:ne180100]<long double>(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, long double, char const*) const |
1398 | | |
1399 | | template <class _CharT, class _OutputIterator> |
1400 | | _OutputIterator |
1401 | 0 | num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_type __fl, double __v) const { |
1402 | 0 | return this->__do_put_floating_point(__s, __iob, __fl, __v, ""); |
1403 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, double) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, double) const |
1404 | | |
1405 | | template <class _CharT, class _OutputIterator> |
1406 | | _OutputIterator |
1407 | 0 | num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_type __fl, long double __v) const { |
1408 | 0 | return this->__do_put_floating_point(__s, __iob, __fl, __v, "L"); |
1409 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, long double) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, long double) const |
1410 | | |
1411 | | template <class _CharT, class _OutputIterator> |
1412 | | _OutputIterator |
1413 | 0 | num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_type __fl, const void* __v) const { |
1414 | | // Stage 1 - Get pointer in narrow char |
1415 | 0 | const unsigned __nbuf = 20; |
1416 | 0 | char __nar[__nbuf]; |
1417 | 0 | int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, "%p", __v); |
1418 | 0 | char* __ne = __nar + __nc; |
1419 | 0 | char* __np = this->__identify_padding(__nar, __ne, __iob); |
1420 | | // Stage 2 - Widen __nar |
1421 | 0 | char_type __o[2 * (__nbuf - 1) - 1]; |
1422 | 0 | char_type* __op; // pad here |
1423 | 0 | char_type* __oe; // end of output |
1424 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__iob.getloc()); |
1425 | 0 | __ct.widen(__nar, __ne, __o); |
1426 | 0 | __oe = __o + (__ne - __nar); |
1427 | 0 | if (__np == __ne) |
1428 | 0 | __op = __oe; |
1429 | 0 | else |
1430 | 0 | __op = __o + (__np - __nar); |
1431 | | // [__o, __oe) contains wide number |
1432 | | // Stage 3 & 4 |
1433 | 0 | return std::__pad_and_output(__s, __o, __op, __oe, __iob, __fl); |
1434 | 0 | } Unexecuted instantiation: std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, void const*) const Unexecuted instantiation: std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, void const*) const |
1435 | | |
1436 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>; |
1437 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
1438 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>; |
1439 | | #endif |
1440 | | |
1441 | | template <class _CharT, class _InputIterator> |
1442 | | _LIBCPP_HIDE_FROM_ABI int __get_up_to_n_digits( |
1443 | 0 | _InputIterator& __b, _InputIterator __e, ios_base::iostate& __err, const ctype<_CharT>& __ct, int __n) { |
1444 | | // Precondition: __n >= 1 |
1445 | 0 | if (__b == __e) { |
1446 | 0 | __err |= ios_base::eofbit | ios_base::failbit; |
1447 | 0 | return 0; |
1448 | 0 | } |
1449 | | // get first digit |
1450 | 0 | _CharT __c = *__b; |
1451 | 0 | if (!__ct.is(ctype_base::digit, __c)) { |
1452 | 0 | __err |= ios_base::failbit; |
1453 | 0 | return 0; |
1454 | 0 | } |
1455 | 0 | int __r = __ct.narrow(__c, 0) - '0'; |
1456 | 0 | for (++__b, (void)--__n; __b != __e && __n > 0; ++__b, (void)--__n) { |
1457 | | // get next digit |
1458 | 0 | __c = *__b; |
1459 | 0 | if (!__ct.is(ctype_base::digit, __c)) |
1460 | 0 | return __r; |
1461 | 0 | __r = __r * 10 + __ct.narrow(__c, 0) - '0'; |
1462 | 0 | } |
1463 | 0 | if (__b == __e) |
1464 | 0 | __err |= ios_base::eofbit; |
1465 | 0 | return __r; |
1466 | 0 | } Unexecuted instantiation: int std::__1::__get_up_to_n_digits[abi:ne180100]<char, char*>(char*&, char*, unsigned int&, std::__1::ctype<char> const&, int) Unexecuted instantiation: int std::__1::__get_up_to_n_digits[abi:ne180100]<wchar_t, wchar_t*>(wchar_t*&, wchar_t*, unsigned int&, std::__1::ctype<wchar_t> const&, int) Unexecuted instantiation: int std::__1::__get_up_to_n_digits[abi:ne180100]<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&, int) Unexecuted instantiation: int std::__1::__get_up_to_n_digits[abi:ne180100]<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&, int) |
1467 | | |
1468 | | class _LIBCPP_EXPORTED_FROM_ABI time_base { |
1469 | | public: |
1470 | | enum dateorder { no_order, dmy, mdy, ymd, ydm }; |
1471 | | }; |
1472 | | |
1473 | | template <class _CharT> |
1474 | | class _LIBCPP_TEMPLATE_VIS __time_get_c_storage { |
1475 | | protected: |
1476 | | typedef basic_string<_CharT> string_type; |
1477 | | |
1478 | | virtual const string_type* __weeks() const; |
1479 | | virtual const string_type* __months() const; |
1480 | | virtual const string_type* __am_pm() const; |
1481 | | virtual const string_type& __c() const; |
1482 | | virtual const string_type& __r() const; |
1483 | | virtual const string_type& __x() const; |
1484 | | virtual const string_type& __X() const; |
1485 | | |
1486 | 0 | _LIBCPP_HIDE_FROM_ABI ~__time_get_c_storage() {} Unexecuted instantiation: std::__1::__time_get_c_storage<char>::~__time_get_c_storage[abi:ne180100]() Unexecuted instantiation: std::__1::__time_get_c_storage<wchar_t>::~__time_get_c_storage[abi:ne180100]() |
1487 | | }; |
1488 | | |
1489 | | template <> |
1490 | | _LIBCPP_EXPORTED_FROM_ABI const string* __time_get_c_storage<char>::__weeks() const; |
1491 | | template <> |
1492 | | _LIBCPP_EXPORTED_FROM_ABI const string* __time_get_c_storage<char>::__months() const; |
1493 | | template <> |
1494 | | _LIBCPP_EXPORTED_FROM_ABI const string* __time_get_c_storage<char>::__am_pm() const; |
1495 | | template <> |
1496 | | _LIBCPP_EXPORTED_FROM_ABI const string& __time_get_c_storage<char>::__c() const; |
1497 | | template <> |
1498 | | _LIBCPP_EXPORTED_FROM_ABI const string& __time_get_c_storage<char>::__r() const; |
1499 | | template <> |
1500 | | _LIBCPP_EXPORTED_FROM_ABI const string& __time_get_c_storage<char>::__x() const; |
1501 | | template <> |
1502 | | _LIBCPP_EXPORTED_FROM_ABI const string& __time_get_c_storage<char>::__X() const; |
1503 | | |
1504 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
1505 | | template <> |
1506 | | _LIBCPP_EXPORTED_FROM_ABI const wstring* __time_get_c_storage<wchar_t>::__weeks() const; |
1507 | | template <> |
1508 | | _LIBCPP_EXPORTED_FROM_ABI const wstring* __time_get_c_storage<wchar_t>::__months() const; |
1509 | | template <> |
1510 | | _LIBCPP_EXPORTED_FROM_ABI const wstring* __time_get_c_storage<wchar_t>::__am_pm() const; |
1511 | | template <> |
1512 | | _LIBCPP_EXPORTED_FROM_ABI const wstring& __time_get_c_storage<wchar_t>::__c() const; |
1513 | | template <> |
1514 | | _LIBCPP_EXPORTED_FROM_ABI const wstring& __time_get_c_storage<wchar_t>::__r() const; |
1515 | | template <> |
1516 | | _LIBCPP_EXPORTED_FROM_ABI const wstring& __time_get_c_storage<wchar_t>::__x() const; |
1517 | | template <> |
1518 | | _LIBCPP_EXPORTED_FROM_ABI const wstring& __time_get_c_storage<wchar_t>::__X() const; |
1519 | | #endif |
1520 | | |
1521 | | template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> > |
1522 | | class _LIBCPP_TEMPLATE_VIS time_get : public locale::facet, public time_base, private __time_get_c_storage<_CharT> { |
1523 | | public: |
1524 | | typedef _CharT char_type; |
1525 | | typedef _InputIterator iter_type; |
1526 | | typedef time_base::dateorder dateorder; |
1527 | | typedef basic_string<char_type> string_type; |
1528 | | |
1529 | 12 | _LIBCPP_HIDE_FROM_ABI explicit time_get(size_t __refs = 0) : locale::facet(__refs) {} std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::time_get[abi:ne180100](unsigned long) Line | Count | Source | 1529 | 6 | _LIBCPP_HIDE_FROM_ABI explicit time_get(size_t __refs = 0) : locale::facet(__refs) {} |
std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::time_get[abi:ne180100](unsigned long) Line | Count | Source | 1529 | 6 | _LIBCPP_HIDE_FROM_ABI explicit time_get(size_t __refs = 0) : locale::facet(__refs) {} |
|
1530 | | |
1531 | | _LIBCPP_HIDE_FROM_ABI dateorder date_order() const { return this->do_date_order(); } |
1532 | | |
1533 | | _LIBCPP_HIDE_FROM_ABI iter_type |
1534 | | get_time(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { |
1535 | | return do_get_time(__b, __e, __iob, __err, __tm); |
1536 | | } |
1537 | | |
1538 | | _LIBCPP_HIDE_FROM_ABI iter_type |
1539 | | get_date(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { |
1540 | | return do_get_date(__b, __e, __iob, __err, __tm); |
1541 | | } |
1542 | | |
1543 | | _LIBCPP_HIDE_FROM_ABI iter_type |
1544 | | get_weekday(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { |
1545 | | return do_get_weekday(__b, __e, __iob, __err, __tm); |
1546 | | } |
1547 | | |
1548 | | _LIBCPP_HIDE_FROM_ABI iter_type |
1549 | | get_monthname(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { |
1550 | | return do_get_monthname(__b, __e, __iob, __err, __tm); |
1551 | | } |
1552 | | |
1553 | | _LIBCPP_HIDE_FROM_ABI iter_type |
1554 | | get_year(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { |
1555 | | return do_get_year(__b, __e, __iob, __err, __tm); |
1556 | | } |
1557 | | |
1558 | | _LIBCPP_HIDE_FROM_ABI iter_type |
1559 | | get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm, char __fmt, char __mod = 0) |
1560 | | const { |
1561 | | return do_get(__b, __e, __iob, __err, __tm, __fmt, __mod); |
1562 | | } |
1563 | | |
1564 | | iter_type |
1565 | | get(iter_type __b, |
1566 | | iter_type __e, |
1567 | | ios_base& __iob, |
1568 | | ios_base::iostate& __err, |
1569 | | tm* __tm, |
1570 | | const char_type* __fmtb, |
1571 | | const char_type* __fmte) const; |
1572 | | |
1573 | | static locale::id id; |
1574 | | |
1575 | | protected: |
1576 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~time_get() override {} Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::~time_get() Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::~time_get() |
1577 | | |
1578 | | virtual dateorder do_date_order() const; |
1579 | | virtual iter_type |
1580 | | do_get_time(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const; |
1581 | | virtual iter_type |
1582 | | do_get_date(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const; |
1583 | | virtual iter_type |
1584 | | do_get_weekday(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const; |
1585 | | virtual iter_type |
1586 | | do_get_monthname(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const; |
1587 | | virtual iter_type |
1588 | | do_get_year(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const; |
1589 | | virtual iter_type do_get( |
1590 | | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm, char __fmt, char __mod) const; |
1591 | | |
1592 | | private: |
1593 | | void __get_white_space(iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1594 | | void __get_percent(iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1595 | | |
1596 | | void __get_weekdayname( |
1597 | | int& __m, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1598 | | void __get_monthname( |
1599 | | int& __m, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1600 | | void __get_day(int& __d, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1601 | | void |
1602 | | __get_month(int& __m, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1603 | | void |
1604 | | __get_year(int& __y, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1605 | | void |
1606 | | __get_year4(int& __y, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1607 | | void |
1608 | | __get_hour(int& __d, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1609 | | void |
1610 | | __get_12_hour(int& __h, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1611 | | void |
1612 | | __get_am_pm(int& __h, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1613 | | void |
1614 | | __get_minute(int& __m, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1615 | | void |
1616 | | __get_second(int& __s, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1617 | | void |
1618 | | __get_weekday(int& __w, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1619 | | void __get_day_year_num( |
1620 | | int& __w, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const; |
1621 | | }; |
1622 | | |
1623 | | template <class _CharT, class _InputIterator> |
1624 | | locale::id time_get<_CharT, _InputIterator>::id; |
1625 | | |
1626 | | // time_get primitives |
1627 | | |
1628 | | template <class _CharT, class _InputIterator> |
1629 | | void time_get<_CharT, _InputIterator>::__get_weekdayname( |
1630 | 0 | int& __w, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1631 | | // Note: ignoring case comes from the POSIX strptime spec |
1632 | 0 | const string_type* __wk = this->__weeks(); |
1633 | 0 | ptrdiff_t __i = std::__scan_keyword(__b, __e, __wk, __wk + 14, __ct, __err, false) - __wk; |
1634 | 0 | if (__i < 14) |
1635 | 0 | __w = __i % 7; |
1636 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_weekdayname(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_weekdayname(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1637 | | |
1638 | | template <class _CharT, class _InputIterator> |
1639 | | void time_get<_CharT, _InputIterator>::__get_monthname( |
1640 | 0 | int& __m, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1641 | | // Note: ignoring case comes from the POSIX strptime spec |
1642 | 0 | const string_type* __month = this->__months(); |
1643 | 0 | ptrdiff_t __i = std::__scan_keyword(__b, __e, __month, __month + 24, __ct, __err, false) - __month; |
1644 | 0 | if (__i < 24) |
1645 | 0 | __m = __i % 12; |
1646 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_monthname(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_monthname(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1647 | | |
1648 | | template <class _CharT, class _InputIterator> |
1649 | | void time_get<_CharT, _InputIterator>::__get_day( |
1650 | 0 | int& __d, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1651 | 0 | int __t = std::__get_up_to_n_digits(__b, __e, __err, __ct, 2); |
1652 | 0 | if (!(__err & ios_base::failbit) && 1 <= __t && __t <= 31) |
1653 | 0 | __d = __t; |
1654 | 0 | else |
1655 | 0 | __err |= ios_base::failbit; |
1656 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_day(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_day(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1657 | | |
1658 | | template <class _CharT, class _InputIterator> |
1659 | | void time_get<_CharT, _InputIterator>::__get_month( |
1660 | 0 | int& __m, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1661 | 0 | int __t = std::__get_up_to_n_digits(__b, __e, __err, __ct, 2) - 1; |
1662 | 0 | if (!(__err & ios_base::failbit) && 0 <= __t && __t <= 11) |
1663 | 0 | __m = __t; |
1664 | 0 | else |
1665 | 0 | __err |= ios_base::failbit; |
1666 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_month(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_month(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1667 | | |
1668 | | template <class _CharT, class _InputIterator> |
1669 | | void time_get<_CharT, _InputIterator>::__get_year( |
1670 | 0 | int& __y, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1671 | 0 | int __t = std::__get_up_to_n_digits(__b, __e, __err, __ct, 4); |
1672 | 0 | if (!(__err & ios_base::failbit)) { |
1673 | 0 | if (__t < 69) |
1674 | 0 | __t += 2000; |
1675 | 0 | else if (69 <= __t && __t <= 99) |
1676 | 0 | __t += 1900; |
1677 | 0 | __y = __t - 1900; |
1678 | 0 | } |
1679 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_year(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_year(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1680 | | |
1681 | | template <class _CharT, class _InputIterator> |
1682 | | void time_get<_CharT, _InputIterator>::__get_year4( |
1683 | 0 | int& __y, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1684 | 0 | int __t = std::__get_up_to_n_digits(__b, __e, __err, __ct, 4); |
1685 | 0 | if (!(__err & ios_base::failbit)) |
1686 | 0 | __y = __t - 1900; |
1687 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_year4(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_year4(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1688 | | |
1689 | | template <class _CharT, class _InputIterator> |
1690 | | void time_get<_CharT, _InputIterator>::__get_hour( |
1691 | 0 | int& __h, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1692 | 0 | int __t = std::__get_up_to_n_digits(__b, __e, __err, __ct, 2); |
1693 | 0 | if (!(__err & ios_base::failbit) && __t <= 23) |
1694 | 0 | __h = __t; |
1695 | 0 | else |
1696 | 0 | __err |= ios_base::failbit; |
1697 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_hour(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_hour(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1698 | | |
1699 | | template <class _CharT, class _InputIterator> |
1700 | | void time_get<_CharT, _InputIterator>::__get_12_hour( |
1701 | 0 | int& __h, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1702 | 0 | int __t = std::__get_up_to_n_digits(__b, __e, __err, __ct, 2); |
1703 | 0 | if (!(__err & ios_base::failbit) && 1 <= __t && __t <= 12) |
1704 | 0 | __h = __t; |
1705 | 0 | else |
1706 | 0 | __err |= ios_base::failbit; |
1707 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_12_hour(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_12_hour(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1708 | | |
1709 | | template <class _CharT, class _InputIterator> |
1710 | | void time_get<_CharT, _InputIterator>::__get_minute( |
1711 | 0 | int& __m, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1712 | 0 | int __t = std::__get_up_to_n_digits(__b, __e, __err, __ct, 2); |
1713 | 0 | if (!(__err & ios_base::failbit) && __t <= 59) |
1714 | 0 | __m = __t; |
1715 | 0 | else |
1716 | 0 | __err |= ios_base::failbit; |
1717 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_minute(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_minute(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1718 | | |
1719 | | template <class _CharT, class _InputIterator> |
1720 | | void time_get<_CharT, _InputIterator>::__get_second( |
1721 | 0 | int& __s, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1722 | 0 | int __t = std::__get_up_to_n_digits(__b, __e, __err, __ct, 2); |
1723 | 0 | if (!(__err & ios_base::failbit) && __t <= 60) |
1724 | 0 | __s = __t; |
1725 | 0 | else |
1726 | 0 | __err |= ios_base::failbit; |
1727 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_second(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_second(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1728 | | |
1729 | | template <class _CharT, class _InputIterator> |
1730 | | void time_get<_CharT, _InputIterator>::__get_weekday( |
1731 | 0 | int& __w, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1732 | 0 | int __t = std::__get_up_to_n_digits(__b, __e, __err, __ct, 1); |
1733 | 0 | if (!(__err & ios_base::failbit) && __t <= 6) |
1734 | 0 | __w = __t; |
1735 | 0 | else |
1736 | 0 | __err |= ios_base::failbit; |
1737 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_weekday(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_weekday(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1738 | | |
1739 | | template <class _CharT, class _InputIterator> |
1740 | | void time_get<_CharT, _InputIterator>::__get_day_year_num( |
1741 | 0 | int& __d, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1742 | 0 | int __t = std::__get_up_to_n_digits(__b, __e, __err, __ct, 3); |
1743 | 0 | if (!(__err & ios_base::failbit) && __t <= 365) |
1744 | 0 | __d = __t; |
1745 | 0 | else |
1746 | 0 | __err |= ios_base::failbit; |
1747 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_day_year_num(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_day_year_num(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1748 | | |
1749 | | template <class _CharT, class _InputIterator> |
1750 | | void time_get<_CharT, _InputIterator>::__get_white_space( |
1751 | 0 | iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1752 | 0 | for (; __b != __e && __ct.is(ctype_base::space, *__b); ++__b) |
1753 | 0 | ; |
1754 | 0 | if (__b == __e) |
1755 | 0 | __err |= ios_base::eofbit; |
1756 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_white_space(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_white_space(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1757 | | |
1758 | | template <class _CharT, class _InputIterator> |
1759 | | void time_get<_CharT, _InputIterator>::__get_am_pm( |
1760 | 0 | int& __h, iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1761 | 0 | const string_type* __ap = this->__am_pm(); |
1762 | 0 | if (__ap[0].size() + __ap[1].size() == 0) { |
1763 | 0 | __err |= ios_base::failbit; |
1764 | 0 | return; |
1765 | 0 | } |
1766 | 0 | ptrdiff_t __i = std::__scan_keyword(__b, __e, __ap, __ap + 2, __ct, __err, false) - __ap; |
1767 | 0 | if (__i == 0 && __h == 12) |
1768 | 0 | __h = 0; |
1769 | 0 | else if (__i == 1 && __h < 12) |
1770 | 0 | __h += 12; |
1771 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_am_pm(int&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_am_pm(int&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1772 | | |
1773 | | template <class _CharT, class _InputIterator> |
1774 | | void time_get<_CharT, _InputIterator>::__get_percent( |
1775 | 0 | iter_type& __b, iter_type __e, ios_base::iostate& __err, const ctype<char_type>& __ct) const { |
1776 | 0 | if (__b == __e) { |
1777 | 0 | __err |= ios_base::eofbit | ios_base::failbit; |
1778 | 0 | return; |
1779 | 0 | } |
1780 | 0 | if (__ct.narrow(*__b, 0) != '%') |
1781 | 0 | __err |= ios_base::failbit; |
1782 | 0 | else if (++__b == __e) |
1783 | 0 | __err |= ios_base::eofbit; |
1784 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__get_percent(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, unsigned int&, std::__1::ctype<char> const&) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__get_percent(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, unsigned int&, std::__1::ctype<wchar_t> const&) const |
1785 | | |
1786 | | // time_get end primitives |
1787 | | |
1788 | | template <class _CharT, class _InputIterator> |
1789 | | _InputIterator time_get<_CharT, _InputIterator>::get( |
1790 | | iter_type __b, |
1791 | | iter_type __e, |
1792 | | ios_base& __iob, |
1793 | | ios_base::iostate& __err, |
1794 | | tm* __tm, |
1795 | | const char_type* __fmtb, |
1796 | 0 | const char_type* __fmte) const { |
1797 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__iob.getloc()); |
1798 | 0 | __err = ios_base::goodbit; |
1799 | 0 | while (__fmtb != __fmte && __err == ios_base::goodbit) { |
1800 | 0 | if (__b == __e) { |
1801 | 0 | __err = ios_base::failbit; |
1802 | 0 | break; |
1803 | 0 | } |
1804 | 0 | if (__ct.narrow(*__fmtb, 0) == '%') { |
1805 | 0 | if (++__fmtb == __fmte) { |
1806 | 0 | __err = ios_base::failbit; |
1807 | 0 | break; |
1808 | 0 | } |
1809 | 0 | char __cmd = __ct.narrow(*__fmtb, 0); |
1810 | 0 | char __opt = '\0'; |
1811 | 0 | if (__cmd == 'E' || __cmd == '0') { |
1812 | 0 | if (++__fmtb == __fmte) { |
1813 | 0 | __err = ios_base::failbit; |
1814 | 0 | break; |
1815 | 0 | } |
1816 | 0 | __opt = __cmd; |
1817 | 0 | __cmd = __ct.narrow(*__fmtb, 0); |
1818 | 0 | } |
1819 | 0 | __b = do_get(__b, __e, __iob, __err, __tm, __cmd, __opt); |
1820 | 0 | ++__fmtb; |
1821 | 0 | } else if (__ct.is(ctype_base::space, *__fmtb)) { |
1822 | 0 | for (++__fmtb; __fmtb != __fmte && __ct.is(ctype_base::space, *__fmtb); ++__fmtb) |
1823 | 0 | ; |
1824 | 0 | for (; __b != __e && __ct.is(ctype_base::space, *__b); ++__b) |
1825 | 0 | ; |
1826 | 0 | } else if (__ct.toupper(*__b) == __ct.toupper(*__fmtb)) { |
1827 | 0 | ++__b; |
1828 | 0 | ++__fmtb; |
1829 | 0 | } else |
1830 | 0 | __err = ios_base::failbit; |
1831 | 0 | } |
1832 | 0 | if (__b == __e) |
1833 | 0 | __err |= ios_base::eofbit; |
1834 | 0 | return __b; |
1835 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, tm*, char const*, char const*) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, tm*, wchar_t const*, wchar_t const*) const |
1836 | | |
1837 | | template <class _CharT, class _InputIterator> |
1838 | 0 | typename time_get<_CharT, _InputIterator>::dateorder time_get<_CharT, _InputIterator>::do_date_order() const { |
1839 | 0 | return mdy; |
1840 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_date_order() const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_date_order() const |
1841 | | |
1842 | | template <class _CharT, class _InputIterator> |
1843 | | _InputIterator time_get<_CharT, _InputIterator>::do_get_time( |
1844 | 0 | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { |
1845 | 0 | const char_type __fmt[] = {'%', 'H', ':', '%', 'M', ':', '%', 'S'}; |
1846 | 0 | return get(__b, __e, __iob, __err, __tm, __fmt, __fmt + sizeof(__fmt) / sizeof(__fmt[0])); |
1847 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get_time(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, tm*) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get_time(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, tm*) const |
1848 | | |
1849 | | template <class _CharT, class _InputIterator> |
1850 | | _InputIterator time_get<_CharT, _InputIterator>::do_get_date( |
1851 | 0 | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { |
1852 | 0 | const string_type& __fmt = this->__x(); |
1853 | 0 | return get(__b, __e, __iob, __err, __tm, __fmt.data(), __fmt.data() + __fmt.size()); |
1854 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get_date(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, tm*) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get_date(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, tm*) const |
1855 | | |
1856 | | template <class _CharT, class _InputIterator> |
1857 | | _InputIterator time_get<_CharT, _InputIterator>::do_get_weekday( |
1858 | 0 | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { |
1859 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__iob.getloc()); |
1860 | 0 | __get_weekdayname(__tm->tm_wday, __b, __e, __err, __ct); |
1861 | 0 | return __b; |
1862 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get_weekday(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, tm*) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get_weekday(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, tm*) const |
1863 | | |
1864 | | template <class _CharT, class _InputIterator> |
1865 | | _InputIterator time_get<_CharT, _InputIterator>::do_get_monthname( |
1866 | 0 | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { |
1867 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__iob.getloc()); |
1868 | 0 | __get_monthname(__tm->tm_mon, __b, __e, __err, __ct); |
1869 | 0 | return __b; |
1870 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get_monthname(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, tm*) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get_monthname(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, tm*) const |
1871 | | |
1872 | | template <class _CharT, class _InputIterator> |
1873 | | _InputIterator time_get<_CharT, _InputIterator>::do_get_year( |
1874 | 0 | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { |
1875 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__iob.getloc()); |
1876 | 0 | __get_year(__tm->tm_year, __b, __e, __err, __ct); |
1877 | 0 | return __b; |
1878 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get_year(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, tm*) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get_year(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, tm*) const |
1879 | | |
1880 | | template <class _CharT, class _InputIterator> |
1881 | | _InputIterator time_get<_CharT, _InputIterator>::do_get( |
1882 | 0 | iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm, char __fmt, char) const { |
1883 | 0 | __err = ios_base::goodbit; |
1884 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__iob.getloc()); |
1885 | 0 | switch (__fmt) { |
1886 | 0 | case 'a': |
1887 | 0 | case 'A': |
1888 | 0 | __get_weekdayname(__tm->tm_wday, __b, __e, __err, __ct); |
1889 | 0 | break; |
1890 | 0 | case 'b': |
1891 | 0 | case 'B': |
1892 | 0 | case 'h': |
1893 | 0 | __get_monthname(__tm->tm_mon, __b, __e, __err, __ct); |
1894 | 0 | break; |
1895 | 0 | case 'c': { |
1896 | 0 | const string_type& __fm = this->__c(); |
1897 | 0 | __b = get(__b, __e, __iob, __err, __tm, __fm.data(), __fm.data() + __fm.size()); |
1898 | 0 | } break; |
1899 | 0 | case 'd': |
1900 | 0 | case 'e': |
1901 | 0 | __get_day(__tm->tm_mday, __b, __e, __err, __ct); |
1902 | 0 | break; |
1903 | 0 | case 'D': { |
1904 | 0 | const char_type __fm[] = {'%', 'm', '/', '%', 'd', '/', '%', 'y'}; |
1905 | 0 | __b = get(__b, __e, __iob, __err, __tm, __fm, __fm + sizeof(__fm) / sizeof(__fm[0])); |
1906 | 0 | } break; |
1907 | 0 | case 'F': { |
1908 | 0 | const char_type __fm[] = {'%', 'Y', '-', '%', 'm', '-', '%', 'd'}; |
1909 | 0 | __b = get(__b, __e, __iob, __err, __tm, __fm, __fm + sizeof(__fm) / sizeof(__fm[0])); |
1910 | 0 | } break; |
1911 | 0 | case 'H': |
1912 | 0 | __get_hour(__tm->tm_hour, __b, __e, __err, __ct); |
1913 | 0 | break; |
1914 | 0 | case 'I': |
1915 | 0 | __get_12_hour(__tm->tm_hour, __b, __e, __err, __ct); |
1916 | 0 | break; |
1917 | 0 | case 'j': |
1918 | 0 | __get_day_year_num(__tm->tm_yday, __b, __e, __err, __ct); |
1919 | 0 | break; |
1920 | 0 | case 'm': |
1921 | 0 | __get_month(__tm->tm_mon, __b, __e, __err, __ct); |
1922 | 0 | break; |
1923 | 0 | case 'M': |
1924 | 0 | __get_minute(__tm->tm_min, __b, __e, __err, __ct); |
1925 | 0 | break; |
1926 | 0 | case 'n': |
1927 | 0 | case 't': |
1928 | 0 | __get_white_space(__b, __e, __err, __ct); |
1929 | 0 | break; |
1930 | 0 | case 'p': |
1931 | 0 | __get_am_pm(__tm->tm_hour, __b, __e, __err, __ct); |
1932 | 0 | break; |
1933 | 0 | case 'r': { |
1934 | 0 | const char_type __fm[] = {'%', 'I', ':', '%', 'M', ':', '%', 'S', ' ', '%', 'p'}; |
1935 | 0 | __b = get(__b, __e, __iob, __err, __tm, __fm, __fm + sizeof(__fm) / sizeof(__fm[0])); |
1936 | 0 | } break; |
1937 | 0 | case 'R': { |
1938 | 0 | const char_type __fm[] = {'%', 'H', ':', '%', 'M'}; |
1939 | 0 | __b = get(__b, __e, __iob, __err, __tm, __fm, __fm + sizeof(__fm) / sizeof(__fm[0])); |
1940 | 0 | } break; |
1941 | 0 | case 'S': |
1942 | 0 | __get_second(__tm->tm_sec, __b, __e, __err, __ct); |
1943 | 0 | break; |
1944 | 0 | case 'T': { |
1945 | 0 | const char_type __fm[] = {'%', 'H', ':', '%', 'M', ':', '%', 'S'}; |
1946 | 0 | __b = get(__b, __e, __iob, __err, __tm, __fm, __fm + sizeof(__fm) / sizeof(__fm[0])); |
1947 | 0 | } break; |
1948 | 0 | case 'w': |
1949 | 0 | __get_weekday(__tm->tm_wday, __b, __e, __err, __ct); |
1950 | 0 | break; |
1951 | 0 | case 'x': |
1952 | 0 | return do_get_date(__b, __e, __iob, __err, __tm); |
1953 | 0 | case 'X': { |
1954 | 0 | const string_type& __fm = this->__X(); |
1955 | 0 | __b = get(__b, __e, __iob, __err, __tm, __fm.data(), __fm.data() + __fm.size()); |
1956 | 0 | } break; |
1957 | 0 | case 'y': |
1958 | 0 | __get_year(__tm->tm_year, __b, __e, __err, __ct); |
1959 | 0 | break; |
1960 | 0 | case 'Y': |
1961 | 0 | __get_year4(__tm->tm_year, __b, __e, __err, __ct); |
1962 | 0 | break; |
1963 | 0 | case '%': |
1964 | 0 | __get_percent(__b, __e, __err, __ct); |
1965 | 0 | break; |
1966 | 0 | default: |
1967 | 0 | __err |= ios_base::failbit; |
1968 | 0 | } |
1969 | 0 | return __b; |
1970 | 0 | } Unexecuted instantiation: std::__1::time_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, tm*, char, char) const Unexecuted instantiation: std::__1::time_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, tm*, char, char) const |
1971 | | |
1972 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>; |
1973 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
1974 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>; |
1975 | | #endif |
1976 | | |
1977 | | class _LIBCPP_EXPORTED_FROM_ABI __time_get { |
1978 | | protected: |
1979 | | locale_t __loc_; |
1980 | | |
1981 | | __time_get(const char* __nm); |
1982 | | __time_get(const string& __nm); |
1983 | | ~__time_get(); |
1984 | | }; |
1985 | | |
1986 | | template <class _CharT> |
1987 | | class _LIBCPP_TEMPLATE_VIS __time_get_storage : public __time_get { |
1988 | | protected: |
1989 | | typedef basic_string<_CharT> string_type; |
1990 | | |
1991 | | string_type __weeks_[14]; |
1992 | | string_type __months_[24]; |
1993 | | string_type __am_pm_[2]; |
1994 | | string_type __c_; |
1995 | | string_type __r_; |
1996 | | string_type __x_; |
1997 | | string_type __X_; |
1998 | | |
1999 | | explicit __time_get_storage(const char* __nm); |
2000 | | explicit __time_get_storage(const string& __nm); |
2001 | | |
2002 | 0 | _LIBCPP_HIDE_FROM_ABI ~__time_get_storage() {} Unexecuted instantiation: std::__1::__time_get_storage<char>::~__time_get_storage[abi:ne180100]() Unexecuted instantiation: std::__1::__time_get_storage<wchar_t>::~__time_get_storage[abi:ne180100]() |
2003 | | |
2004 | | time_base::dateorder __do_date_order() const; |
2005 | | |
2006 | | private: |
2007 | | void init(const ctype<_CharT>&); |
2008 | | string_type __analyze(char __fmt, const ctype<_CharT>&); |
2009 | | }; |
2010 | | |
2011 | | #define _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(_CharT) \ |
2012 | | template <> \ |
2013 | | _LIBCPP_EXPORTED_FROM_ABI time_base::dateorder __time_get_storage<_CharT>::__do_date_order() const; \ |
2014 | | template <> \ |
2015 | | _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const char*); \ |
2016 | | template <> \ |
2017 | | _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const string&); \ |
2018 | | template <> \ |
2019 | | _LIBCPP_EXPORTED_FROM_ABI void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \ |
2020 | | template <> \ |
2021 | | _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze( \ |
2022 | | char, const ctype<_CharT>&); \ |
2023 | | extern template _LIBCPP_EXPORTED_FROM_ABI time_base::dateorder __time_get_storage<_CharT>::__do_date_order() const; \ |
2024 | | extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const char*); \ |
2025 | | extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::__time_get_storage(const string&); \ |
2026 | | extern template _LIBCPP_EXPORTED_FROM_ABI void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \ |
2027 | | extern template _LIBCPP_EXPORTED_FROM_ABI __time_get_storage<_CharT>::string_type \ |
2028 | | __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&); \ |
2029 | | /**/ |
2030 | | |
2031 | | _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(char) |
2032 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
2033 | | _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(wchar_t) |
2034 | | #endif |
2035 | | #undef _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION |
2036 | | |
2037 | | template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> > |
2038 | | class _LIBCPP_TEMPLATE_VIS time_get_byname |
2039 | | : public time_get<_CharT, _InputIterator>, |
2040 | | private __time_get_storage<_CharT> { |
2041 | | public: |
2042 | | typedef time_base::dateorder dateorder; |
2043 | | typedef _InputIterator iter_type; |
2044 | | typedef _CharT char_type; |
2045 | | typedef basic_string<char_type> string_type; |
2046 | | |
2047 | | _LIBCPP_HIDE_FROM_ABI explicit time_get_byname(const char* __nm, size_t __refs = 0) |
2048 | | : time_get<_CharT, _InputIterator>(__refs), __time_get_storage<_CharT>(__nm) {} |
2049 | | _LIBCPP_HIDE_FROM_ABI explicit time_get_byname(const string& __nm, size_t __refs = 0) |
2050 | 0 | : time_get<_CharT, _InputIterator>(__refs), __time_get_storage<_CharT>(__nm) {} Unexecuted instantiation: std::__1::time_get_byname<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::time_get_byname[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) Unexecuted instantiation: std::__1::time_get_byname<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::time_get_byname[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) |
2051 | | |
2052 | | protected: |
2053 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~time_get_byname() override {} Unexecuted instantiation: std::__1::time_get_byname<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::~time_get_byname() Unexecuted instantiation: std::__1::time_get_byname<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::~time_get_byname() |
2054 | | |
2055 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL dateorder do_date_order() const override { return this->__do_date_order(); } Unexecuted instantiation: std::__1::time_get_byname<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_date_order() const Unexecuted instantiation: std::__1::time_get_byname<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_date_order() const |
2056 | | |
2057 | | private: |
2058 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL const string_type* __weeks() const override { return this->__weeks_; } Unexecuted instantiation: std::__1::time_get_byname<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__weeks() const Unexecuted instantiation: std::__1::time_get_byname<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__weeks() const |
2059 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL const string_type* __months() const override { return this->__months_; } Unexecuted instantiation: std::__1::time_get_byname<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__months() const Unexecuted instantiation: std::__1::time_get_byname<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__months() const |
2060 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL const string_type* __am_pm() const override { return this->__am_pm_; } Unexecuted instantiation: std::__1::time_get_byname<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__am_pm() const Unexecuted instantiation: std::__1::time_get_byname<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__am_pm() const |
2061 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL const string_type& __c() const override { return this->__c_; } Unexecuted instantiation: std::__1::time_get_byname<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__c() const Unexecuted instantiation: std::__1::time_get_byname<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__c() const |
2062 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL const string_type& __r() const override { return this->__r_; } Unexecuted instantiation: std::__1::time_get_byname<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__r() const Unexecuted instantiation: std::__1::time_get_byname<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__r() const |
2063 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL const string_type& __x() const override { return this->__x_; } Unexecuted instantiation: std::__1::time_get_byname<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__x() const Unexecuted instantiation: std::__1::time_get_byname<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__x() const |
2064 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL const string_type& __X() const override { return this->__X_; } Unexecuted instantiation: std::__1::time_get_byname<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__X() const Unexecuted instantiation: std::__1::time_get_byname<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__X() const |
2065 | | }; |
2066 | | |
2067 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>; |
2068 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
2069 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>; |
2070 | | #endif |
2071 | | |
2072 | | class _LIBCPP_EXPORTED_FROM_ABI __time_put { |
2073 | | locale_t __loc_; |
2074 | | |
2075 | | protected: |
2076 | 12 | _LIBCPP_HIDE_FROM_ABI __time_put() : __loc_(_LIBCPP_GET_C_LOCALE) {} |
2077 | | __time_put(const char* __nm); |
2078 | | __time_put(const string& __nm); |
2079 | | ~__time_put(); |
2080 | | void __do_put(char* __nb, char*& __ne, const tm* __tm, char __fmt, char __mod) const; |
2081 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
2082 | | void __do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm, char __fmt, char __mod) const; |
2083 | | #endif |
2084 | | }; |
2085 | | |
2086 | | template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> > |
2087 | | class _LIBCPP_TEMPLATE_VIS time_put : public locale::facet, private __time_put { |
2088 | | public: |
2089 | | typedef _CharT char_type; |
2090 | | typedef _OutputIterator iter_type; |
2091 | | |
2092 | 12 | _LIBCPP_HIDE_FROM_ABI explicit time_put(size_t __refs = 0) : locale::facet(__refs) {} std::__1::time_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::time_put[abi:ne180100](unsigned long) Line | Count | Source | 2092 | 6 | _LIBCPP_HIDE_FROM_ABI explicit time_put(size_t __refs = 0) : locale::facet(__refs) {} |
std::__1::time_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::time_put[abi:ne180100](unsigned long) Line | Count | Source | 2092 | 6 | _LIBCPP_HIDE_FROM_ABI explicit time_put(size_t __refs = 0) : locale::facet(__refs) {} |
|
2093 | | |
2094 | | iter_type |
2095 | | put(iter_type __s, ios_base& __iob, char_type __fl, const tm* __tm, const char_type* __pb, const char_type* __pe) |
2096 | | const; |
2097 | | |
2098 | | _LIBCPP_HIDE_FROM_ABI iter_type |
2099 | | put(iter_type __s, ios_base& __iob, char_type __fl, const tm* __tm, char __fmt, char __mod = 0) const { |
2100 | | return do_put(__s, __iob, __fl, __tm, __fmt, __mod); |
2101 | | } |
2102 | | |
2103 | | static locale::id id; |
2104 | | |
2105 | | protected: |
2106 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~time_put() override {} Unexecuted instantiation: std::__1::time_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::~time_put() Unexecuted instantiation: std::__1::time_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::~time_put() |
2107 | | virtual iter_type do_put(iter_type __s, ios_base&, char_type, const tm* __tm, char __fmt, char __mod) const; |
2108 | | |
2109 | | _LIBCPP_HIDE_FROM_ABI explicit time_put(const char* __nm, size_t __refs) : locale::facet(__refs), __time_put(__nm) {} |
2110 | | _LIBCPP_HIDE_FROM_ABI explicit time_put(const string& __nm, size_t __refs) |
2111 | 0 | : locale::facet(__refs), __time_put(__nm) {} Unexecuted instantiation: std::__1::time_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::time_put[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) Unexecuted instantiation: std::__1::time_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::time_put[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) |
2112 | | }; |
2113 | | |
2114 | | template <class _CharT, class _OutputIterator> |
2115 | | locale::id time_put<_CharT, _OutputIterator>::id; |
2116 | | |
2117 | | template <class _CharT, class _OutputIterator> |
2118 | | _OutputIterator time_put<_CharT, _OutputIterator>::put( |
2119 | | iter_type __s, ios_base& __iob, char_type __fl, const tm* __tm, const char_type* __pb, const char_type* __pe) |
2120 | 0 | const { |
2121 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__iob.getloc()); |
2122 | 0 | for (; __pb != __pe; ++__pb) { |
2123 | 0 | if (__ct.narrow(*__pb, 0) == '%') { |
2124 | 0 | if (++__pb == __pe) { |
2125 | 0 | *__s++ = __pb[-1]; |
2126 | 0 | break; |
2127 | 0 | } |
2128 | 0 | char __mod = 0; |
2129 | 0 | char __fmt = __ct.narrow(*__pb, 0); |
2130 | 0 | if (__fmt == 'E' || __fmt == 'O') { |
2131 | 0 | if (++__pb == __pe) { |
2132 | 0 | *__s++ = __pb[-2]; |
2133 | 0 | *__s++ = __pb[-1]; |
2134 | 0 | break; |
2135 | 0 | } |
2136 | 0 | __mod = __fmt; |
2137 | 0 | __fmt = __ct.narrow(*__pb, 0); |
2138 | 0 | } |
2139 | 0 | __s = do_put(__s, __iob, __fl, __tm, __fmt, __mod); |
2140 | 0 | } else |
2141 | 0 | *__s++ = *__pb; |
2142 | 0 | } |
2143 | 0 | return __s; |
2144 | 0 | } Unexecuted instantiation: std::__1::time_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, tm const*, char const*, char const*) const Unexecuted instantiation: std::__1::time_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, tm const*, wchar_t const*, wchar_t const*) const |
2145 | | |
2146 | | template <class _CharT, class _OutputIterator> |
2147 | | _OutputIterator time_put<_CharT, _OutputIterator>::do_put( |
2148 | 0 | iter_type __s, ios_base&, char_type, const tm* __tm, char __fmt, char __mod) const { |
2149 | 0 | char_type __nar[100]; |
2150 | 0 | char_type* __nb = __nar; |
2151 | 0 | char_type* __ne = __nb + 100; |
2152 | 0 | __do_put(__nb, __ne, __tm, __fmt, __mod); |
2153 | 0 | return std::copy(__nb, __ne, __s); |
2154 | 0 | } Unexecuted instantiation: std::__1::time_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, tm const*, char, char) const Unexecuted instantiation: std::__1::time_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, wchar_t, tm const*, char, char) const |
2155 | | |
2156 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<char>; |
2157 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
2158 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>; |
2159 | | #endif |
2160 | | |
2161 | | template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> > |
2162 | | class _LIBCPP_TEMPLATE_VIS time_put_byname : public time_put<_CharT, _OutputIterator> { |
2163 | | public: |
2164 | | _LIBCPP_HIDE_FROM_ABI explicit time_put_byname(const char* __nm, size_t __refs = 0) |
2165 | | : time_put<_CharT, _OutputIterator>(__nm, __refs) {} |
2166 | | |
2167 | | _LIBCPP_HIDE_FROM_ABI explicit time_put_byname(const string& __nm, size_t __refs = 0) |
2168 | 0 | : time_put<_CharT, _OutputIterator>(__nm, __refs) {} Unexecuted instantiation: std::__1::time_put_byname<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::time_put_byname[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) Unexecuted instantiation: std::__1::time_put_byname<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::time_put_byname[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) |
2169 | | |
2170 | | protected: |
2171 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~time_put_byname() override {} |
2172 | | }; |
2173 | | |
2174 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>; |
2175 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
2176 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>; |
2177 | | #endif |
2178 | | |
2179 | | // money_base |
2180 | | |
2181 | | class _LIBCPP_EXPORTED_FROM_ABI money_base { |
2182 | | public: |
2183 | | enum part { none, space, symbol, sign, value }; |
2184 | | struct pattern { |
2185 | | char field[4]; |
2186 | | }; |
2187 | | |
2188 | 24 | _LIBCPP_HIDE_FROM_ABI money_base() {} |
2189 | | }; |
2190 | | |
2191 | | // moneypunct |
2192 | | |
2193 | | template <class _CharT, bool _International = false> |
2194 | | class _LIBCPP_TEMPLATE_VIS moneypunct : public locale::facet, public money_base { |
2195 | | public: |
2196 | | typedef _CharT char_type; |
2197 | | typedef basic_string<char_type> string_type; |
2198 | | |
2199 | 24 | _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {} std::__1::moneypunct<char, false>::moneypunct[abi:ne180100](unsigned long) Line | Count | Source | 2199 | 6 | _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {} |
std::__1::moneypunct<char, true>::moneypunct[abi:ne180100](unsigned long) Line | Count | Source | 2199 | 6 | _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {} |
std::__1::moneypunct<wchar_t, false>::moneypunct[abi:ne180100](unsigned long) Line | Count | Source | 2199 | 6 | _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {} |
std::__1::moneypunct<wchar_t, true>::moneypunct[abi:ne180100](unsigned long) Line | Count | Source | 2199 | 6 | _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {} |
|
2200 | | |
2201 | 0 | _LIBCPP_HIDE_FROM_ABI char_type decimal_point() const { return do_decimal_point(); } Unexecuted instantiation: std::__1::moneypunct<char, true>::decimal_point[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<char, false>::decimal_point[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::decimal_point[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::decimal_point[abi:ne180100]() const |
2202 | 0 | _LIBCPP_HIDE_FROM_ABI char_type thousands_sep() const { return do_thousands_sep(); } Unexecuted instantiation: std::__1::moneypunct<char, true>::thousands_sep[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<char, false>::thousands_sep[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::thousands_sep[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::thousands_sep[abi:ne180100]() const |
2203 | 0 | _LIBCPP_HIDE_FROM_ABI string grouping() const { return do_grouping(); } Unexecuted instantiation: std::__1::moneypunct<char, true>::grouping[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<char, false>::grouping[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::grouping[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::grouping[abi:ne180100]() const |
2204 | 0 | _LIBCPP_HIDE_FROM_ABI string_type curr_symbol() const { return do_curr_symbol(); } Unexecuted instantiation: std::__1::moneypunct<char, true>::curr_symbol[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<char, false>::curr_symbol[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::curr_symbol[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::curr_symbol[abi:ne180100]() const |
2205 | 0 | _LIBCPP_HIDE_FROM_ABI string_type positive_sign() const { return do_positive_sign(); } Unexecuted instantiation: std::__1::moneypunct<char, true>::positive_sign[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<char, false>::positive_sign[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::positive_sign[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::positive_sign[abi:ne180100]() const |
2206 | 0 | _LIBCPP_HIDE_FROM_ABI string_type negative_sign() const { return do_negative_sign(); } Unexecuted instantiation: std::__1::moneypunct<char, true>::negative_sign[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<char, false>::negative_sign[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::negative_sign[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::negative_sign[abi:ne180100]() const |
2207 | 0 | _LIBCPP_HIDE_FROM_ABI int frac_digits() const { return do_frac_digits(); } Unexecuted instantiation: std::__1::moneypunct<char, true>::frac_digits[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<char, false>::frac_digits[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::frac_digits[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::frac_digits[abi:ne180100]() const |
2208 | 0 | _LIBCPP_HIDE_FROM_ABI pattern pos_format() const { return do_pos_format(); } Unexecuted instantiation: std::__1::moneypunct<char, true>::pos_format[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<char, false>::pos_format[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::pos_format[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::pos_format[abi:ne180100]() const |
2209 | 0 | _LIBCPP_HIDE_FROM_ABI pattern neg_format() const { return do_neg_format(); } Unexecuted instantiation: std::__1::moneypunct<char, true>::neg_format[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<char, false>::neg_format[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::neg_format[abi:ne180100]() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::neg_format[abi:ne180100]() const |
2210 | | |
2211 | | static locale::id id; |
2212 | | static const bool intl = _International; |
2213 | | |
2214 | | protected: |
2215 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~moneypunct() override {} |
2216 | | |
2217 | 0 | virtual char_type do_decimal_point() const { return numeric_limits<char_type>::max(); } Unexecuted instantiation: std::__1::moneypunct<char, false>::do_decimal_point() const Unexecuted instantiation: std::__1::moneypunct<char, true>::do_decimal_point() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::do_decimal_point() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::do_decimal_point() const |
2218 | 0 | virtual char_type do_thousands_sep() const { return numeric_limits<char_type>::max(); } Unexecuted instantiation: std::__1::moneypunct<char, false>::do_thousands_sep() const Unexecuted instantiation: std::__1::moneypunct<char, true>::do_thousands_sep() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::do_thousands_sep() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::do_thousands_sep() const |
2219 | 0 | virtual string do_grouping() const { return string(); } Unexecuted instantiation: std::__1::moneypunct<char, false>::do_grouping() const Unexecuted instantiation: std::__1::moneypunct<char, true>::do_grouping() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::do_grouping() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::do_grouping() const |
2220 | 0 | virtual string_type do_curr_symbol() const { return string_type(); } Unexecuted instantiation: std::__1::moneypunct<char, false>::do_curr_symbol() const Unexecuted instantiation: std::__1::moneypunct<char, true>::do_curr_symbol() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::do_curr_symbol() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::do_curr_symbol() const |
2221 | 0 | virtual string_type do_positive_sign() const { return string_type(); } Unexecuted instantiation: std::__1::moneypunct<char, false>::do_positive_sign() const Unexecuted instantiation: std::__1::moneypunct<char, true>::do_positive_sign() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::do_positive_sign() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::do_positive_sign() const |
2222 | 0 | virtual string_type do_negative_sign() const { return string_type(1, '-'); } Unexecuted instantiation: std::__1::moneypunct<char, false>::do_negative_sign() const Unexecuted instantiation: std::__1::moneypunct<char, true>::do_negative_sign() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::do_negative_sign() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::do_negative_sign() const |
2223 | 0 | virtual int do_frac_digits() const { return 0; } Unexecuted instantiation: std::__1::moneypunct<char, false>::do_frac_digits() const Unexecuted instantiation: std::__1::moneypunct<char, true>::do_frac_digits() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::do_frac_digits() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::do_frac_digits() const |
2224 | 0 | virtual pattern do_pos_format() const { |
2225 | 0 | pattern __p = {{symbol, sign, none, value}}; |
2226 | 0 | return __p; |
2227 | 0 | } Unexecuted instantiation: std::__1::moneypunct<char, false>::do_pos_format() const Unexecuted instantiation: std::__1::moneypunct<char, true>::do_pos_format() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::do_pos_format() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::do_pos_format() const |
2228 | 0 | virtual pattern do_neg_format() const { |
2229 | 0 | pattern __p = {{symbol, sign, none, value}}; |
2230 | 0 | return __p; |
2231 | 0 | } Unexecuted instantiation: std::__1::moneypunct<char, false>::do_neg_format() const Unexecuted instantiation: std::__1::moneypunct<char, true>::do_neg_format() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, false>::do_neg_format() const Unexecuted instantiation: std::__1::moneypunct<wchar_t, true>::do_neg_format() const |
2232 | | }; |
2233 | | |
2234 | | template <class _CharT, bool _International> |
2235 | | locale::id moneypunct<_CharT, _International>::id; |
2236 | | |
2237 | | template <class _CharT, bool _International> |
2238 | | const bool moneypunct<_CharT, _International>::intl; |
2239 | | |
2240 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>; |
2241 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>; |
2242 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
2243 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>; |
2244 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>; |
2245 | | #endif |
2246 | | |
2247 | | // moneypunct_byname |
2248 | | |
2249 | | template <class _CharT, bool _International = false> |
2250 | | class _LIBCPP_TEMPLATE_VIS moneypunct_byname : public moneypunct<_CharT, _International> { |
2251 | | public: |
2252 | | typedef money_base::pattern pattern; |
2253 | | typedef _CharT char_type; |
2254 | | typedef basic_string<char_type> string_type; |
2255 | | |
2256 | | _LIBCPP_HIDE_FROM_ABI explicit moneypunct_byname(const char* __nm, size_t __refs = 0) |
2257 | | : moneypunct<_CharT, _International>(__refs) { |
2258 | | init(__nm); |
2259 | | } |
2260 | | |
2261 | | _LIBCPP_HIDE_FROM_ABI explicit moneypunct_byname(const string& __nm, size_t __refs = 0) |
2262 | 0 | : moneypunct<_CharT, _International>(__refs) { |
2263 | 0 | init(__nm.c_str()); |
2264 | 0 | } Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::moneypunct_byname[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::moneypunct_byname[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::moneypunct_byname[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::moneypunct_byname[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) |
2265 | | |
2266 | | protected: |
2267 | 0 | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~moneypunct_byname() override {} Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::~moneypunct_byname() Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::~moneypunct_byname() Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::~moneypunct_byname() Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::~moneypunct_byname() |
2268 | | |
2269 | 0 | char_type do_decimal_point() const override { return __decimal_point_; } Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::do_decimal_point() const Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::do_decimal_point() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::do_decimal_point() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::do_decimal_point() const |
2270 | 0 | char_type do_thousands_sep() const override { return __thousands_sep_; } Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::do_thousands_sep() const Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::do_thousands_sep() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::do_thousands_sep() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::do_thousands_sep() const |
2271 | 0 | string do_grouping() const override { return __grouping_; } Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::do_grouping() const Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::do_grouping() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::do_grouping() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::do_grouping() const |
2272 | 0 | string_type do_curr_symbol() const override { return __curr_symbol_; } Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::do_curr_symbol() const Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::do_curr_symbol() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::do_curr_symbol() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::do_curr_symbol() const |
2273 | 0 | string_type do_positive_sign() const override { return __positive_sign_; } Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::do_positive_sign() const Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::do_positive_sign() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::do_positive_sign() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::do_positive_sign() const |
2274 | 0 | string_type do_negative_sign() const override { return __negative_sign_; } Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::do_negative_sign() const Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::do_negative_sign() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::do_negative_sign() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::do_negative_sign() const |
2275 | 0 | int do_frac_digits() const override { return __frac_digits_; } Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::do_frac_digits() const Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::do_frac_digits() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::do_frac_digits() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::do_frac_digits() const |
2276 | 0 | pattern do_pos_format() const override { return __pos_format_; } Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::do_pos_format() const Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::do_pos_format() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::do_pos_format() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::do_pos_format() const |
2277 | 0 | pattern do_neg_format() const override { return __neg_format_; } Unexecuted instantiation: std::__1::moneypunct_byname<char, false>::do_neg_format() const Unexecuted instantiation: std::__1::moneypunct_byname<char, true>::do_neg_format() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, false>::do_neg_format() const Unexecuted instantiation: std::__1::moneypunct_byname<wchar_t, true>::do_neg_format() const |
2278 | | |
2279 | | private: |
2280 | | char_type __decimal_point_; |
2281 | | char_type __thousands_sep_; |
2282 | | string __grouping_; |
2283 | | string_type __curr_symbol_; |
2284 | | string_type __positive_sign_; |
2285 | | string_type __negative_sign_; |
2286 | | int __frac_digits_; |
2287 | | pattern __pos_format_; |
2288 | | pattern __neg_format_; |
2289 | | |
2290 | | void init(const char*); |
2291 | | }; |
2292 | | |
2293 | | template <> |
2294 | | _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname<char, false>::init(const char*); |
2295 | | template <> |
2296 | | _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname<char, true>::init(const char*); |
2297 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>; |
2298 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>; |
2299 | | |
2300 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
2301 | | template <> |
2302 | | _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname<wchar_t, false>::init(const char*); |
2303 | | template <> |
2304 | | _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname<wchar_t, true>::init(const char*); |
2305 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, false>; |
2306 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>; |
2307 | | #endif |
2308 | | |
2309 | | // money_get |
2310 | | |
2311 | | template <class _CharT> |
2312 | | class __money_get { |
2313 | | protected: |
2314 | | typedef _CharT char_type; |
2315 | | typedef basic_string<char_type> string_type; |
2316 | | |
2317 | 12 | _LIBCPP_HIDE_FROM_ABI __money_get() {} std::__1::__money_get<char>::__money_get[abi:ne180100]() Line | Count | Source | 2317 | 6 | _LIBCPP_HIDE_FROM_ABI __money_get() {} |
std::__1::__money_get<wchar_t>::__money_get[abi:ne180100]() Line | Count | Source | 2317 | 6 | _LIBCPP_HIDE_FROM_ABI __money_get() {} |
|
2318 | | |
2319 | | static void __gather_info( |
2320 | | bool __intl, |
2321 | | const locale& __loc, |
2322 | | money_base::pattern& __pat, |
2323 | | char_type& __dp, |
2324 | | char_type& __ts, |
2325 | | string& __grp, |
2326 | | string_type& __sym, |
2327 | | string_type& __psn, |
2328 | | string_type& __nsn, |
2329 | | int& __fd); |
2330 | | }; |
2331 | | |
2332 | | template <class _CharT> |
2333 | | void __money_get<_CharT>::__gather_info( |
2334 | | bool __intl, |
2335 | | const locale& __loc, |
2336 | | money_base::pattern& __pat, |
2337 | | char_type& __dp, |
2338 | | char_type& __ts, |
2339 | | string& __grp, |
2340 | | string_type& __sym, |
2341 | | string_type& __psn, |
2342 | | string_type& __nsn, |
2343 | 0 | int& __fd) { |
2344 | 0 | if (__intl) { |
2345 | 0 | const moneypunct<char_type, true>& __mp = std::use_facet<moneypunct<char_type, true> >(__loc); |
2346 | 0 | __pat = __mp.neg_format(); |
2347 | 0 | __nsn = __mp.negative_sign(); |
2348 | 0 | __psn = __mp.positive_sign(); |
2349 | 0 | __dp = __mp.decimal_point(); |
2350 | 0 | __ts = __mp.thousands_sep(); |
2351 | 0 | __grp = __mp.grouping(); |
2352 | 0 | __sym = __mp.curr_symbol(); |
2353 | 0 | __fd = __mp.frac_digits(); |
2354 | 0 | } else { |
2355 | 0 | const moneypunct<char_type, false>& __mp = std::use_facet<moneypunct<char_type, false> >(__loc); |
2356 | 0 | __pat = __mp.neg_format(); |
2357 | 0 | __nsn = __mp.negative_sign(); |
2358 | 0 | __psn = __mp.positive_sign(); |
2359 | 0 | __dp = __mp.decimal_point(); |
2360 | 0 | __ts = __mp.thousands_sep(); |
2361 | 0 | __grp = __mp.grouping(); |
2362 | 0 | __sym = __mp.curr_symbol(); |
2363 | 0 | __fd = __mp.frac_digits(); |
2364 | 0 | } |
2365 | 0 | } Unexecuted instantiation: std::__1::__money_get<char>::__gather_info(bool, std::__1::locale const&, std::__1::money_base::pattern&, char&, char&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, int&) Unexecuted instantiation: std::__1::__money_get<wchar_t>::__gather_info(bool, std::__1::locale const&, std::__1::money_base::pattern&, wchar_t&, wchar_t&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, int&) |
2366 | | |
2367 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>; |
2368 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
2369 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>; |
2370 | | #endif |
2371 | | |
2372 | | template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> > |
2373 | | class _LIBCPP_TEMPLATE_VIS money_get : public locale::facet, private __money_get<_CharT> { |
2374 | | public: |
2375 | | typedef _CharT char_type; |
2376 | | typedef _InputIterator iter_type; |
2377 | | typedef basic_string<char_type> string_type; |
2378 | | |
2379 | 12 | _LIBCPP_HIDE_FROM_ABI explicit money_get(size_t __refs = 0) : locale::facet(__refs) {} std::__1::money_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::money_get[abi:ne180100](unsigned long) Line | Count | Source | 2379 | 6 | _LIBCPP_HIDE_FROM_ABI explicit money_get(size_t __refs = 0) : locale::facet(__refs) {} |
std::__1::money_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::money_get[abi:ne180100](unsigned long) Line | Count | Source | 2379 | 6 | _LIBCPP_HIDE_FROM_ABI explicit money_get(size_t __refs = 0) : locale::facet(__refs) {} |
|
2380 | | |
2381 | | _LIBCPP_HIDE_FROM_ABI iter_type |
2382 | | get(iter_type __b, iter_type __e, bool __intl, ios_base& __iob, ios_base::iostate& __err, long double& __v) const { |
2383 | | return do_get(__b, __e, __intl, __iob, __err, __v); |
2384 | | } |
2385 | | |
2386 | | _LIBCPP_HIDE_FROM_ABI iter_type |
2387 | | get(iter_type __b, iter_type __e, bool __intl, ios_base& __iob, ios_base::iostate& __err, string_type& __v) const { |
2388 | | return do_get(__b, __e, __intl, __iob, __err, __v); |
2389 | | } |
2390 | | |
2391 | | static locale::id id; |
2392 | | |
2393 | | protected: |
2394 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~money_get() override {} |
2395 | | |
2396 | | virtual iter_type |
2397 | | do_get(iter_type __b, iter_type __e, bool __intl, ios_base& __iob, ios_base::iostate& __err, long double& __v) const; |
2398 | | virtual iter_type |
2399 | | do_get(iter_type __b, iter_type __e, bool __intl, ios_base& __iob, ios_base::iostate& __err, string_type& __v) const; |
2400 | | |
2401 | | private: |
2402 | | static bool __do_get( |
2403 | | iter_type& __b, |
2404 | | iter_type __e, |
2405 | | bool __intl, |
2406 | | const locale& __loc, |
2407 | | ios_base::fmtflags __flags, |
2408 | | ios_base::iostate& __err, |
2409 | | bool& __neg, |
2410 | | const ctype<char_type>& __ct, |
2411 | | unique_ptr<char_type, void (*)(void*)>& __wb, |
2412 | | char_type*& __wn, |
2413 | | char_type* __we); |
2414 | | }; |
2415 | | |
2416 | | template <class _CharT, class _InputIterator> |
2417 | | locale::id money_get<_CharT, _InputIterator>::id; |
2418 | | |
2419 | | _LIBCPP_EXPORTED_FROM_ABI void __do_nothing(void*); |
2420 | | |
2421 | | template <class _Tp> |
2422 | 0 | _LIBCPP_HIDE_FROM_ABI void __double_or_nothing(unique_ptr<_Tp, void (*)(void*)>& __b, _Tp*& __n, _Tp*& __e) { |
2423 | 0 | bool __owns = __b.get_deleter() != __do_nothing; |
2424 | 0 | size_t __cur_cap = static_cast<size_t>(__e - __b.get()) * sizeof(_Tp); |
2425 | 0 | size_t __new_cap = __cur_cap < numeric_limits<size_t>::max() / 2 ? 2 * __cur_cap : numeric_limits<size_t>::max(); |
2426 | 0 | if (__new_cap == 0) |
2427 | 0 | __new_cap = sizeof(_Tp); |
2428 | 0 | size_t __n_off = static_cast<size_t>(__n - __b.get()); |
2429 | 0 | _Tp* __t = (_Tp*)std::realloc(__owns ? __b.get() : 0, __new_cap); |
2430 | 0 | if (__t == 0) |
2431 | 0 | __throw_bad_alloc(); |
2432 | 0 | if (__owns) |
2433 | 0 | __b.release(); |
2434 | 0 | __b = unique_ptr<_Tp, void (*)(void*)>(__t, free); |
2435 | 0 | __new_cap /= sizeof(_Tp); |
2436 | 0 | __n = __b.get() + __n_off; |
2437 | 0 | __e = __b.get() + __new_cap; |
2438 | 0 | } Unexecuted instantiation: void std::__1::__double_or_nothing[abi:ne180100]<char>(std::__1::unique_ptr<char, void (*)(void*)>&, char*&, char*&) Unexecuted instantiation: void std::__1::__double_or_nothing[abi:ne180100]<unsigned int>(std::__1::unique_ptr<unsigned int, void (*)(void*)>&, unsigned int*&, unsigned int*&) Unexecuted instantiation: void std::__1::__double_or_nothing[abi:ne180100]<wchar_t>(std::__1::unique_ptr<wchar_t, void (*)(void*)>&, wchar_t*&, wchar_t*&) |
2439 | | |
2440 | | // true == success |
2441 | | template <class _CharT, class _InputIterator> |
2442 | | bool money_get<_CharT, _InputIterator>::__do_get( |
2443 | | iter_type& __b, |
2444 | | iter_type __e, |
2445 | | bool __intl, |
2446 | | const locale& __loc, |
2447 | | ios_base::fmtflags __flags, |
2448 | | ios_base::iostate& __err, |
2449 | | bool& __neg, |
2450 | | const ctype<char_type>& __ct, |
2451 | | unique_ptr<char_type, void (*)(void*)>& __wb, |
2452 | | char_type*& __wn, |
2453 | 0 | char_type* __we) { |
2454 | 0 | if (__b == __e) { |
2455 | 0 | __err |= ios_base::failbit; |
2456 | 0 | return false; |
2457 | 0 | } |
2458 | 0 | const unsigned __bz = 100; |
2459 | 0 | unsigned __gbuf[__bz]; |
2460 | 0 | unique_ptr<unsigned, void (*)(void*)> __gb(__gbuf, __do_nothing); |
2461 | 0 | unsigned* __gn = __gb.get(); |
2462 | 0 | unsigned* __ge = __gn + __bz; |
2463 | 0 | money_base::pattern __pat; |
2464 | 0 | char_type __dp; |
2465 | 0 | char_type __ts; |
2466 | 0 | string __grp; |
2467 | 0 | string_type __sym; |
2468 | 0 | string_type __psn; |
2469 | 0 | string_type __nsn; |
2470 | | // Capture the spaces read into money_base::{space,none} so they |
2471 | | // can be compared to initial spaces in __sym. |
2472 | 0 | string_type __spaces; |
2473 | 0 | int __fd; |
2474 | 0 | __money_get<_CharT>::__gather_info(__intl, __loc, __pat, __dp, __ts, __grp, __sym, __psn, __nsn, __fd); |
2475 | 0 | const string_type* __trailing_sign = 0; |
2476 | 0 | __wn = __wb.get(); |
2477 | 0 | for (unsigned __p = 0; __p < 4 && __b != __e; ++__p) { |
2478 | 0 | switch (__pat.field[__p]) { |
2479 | 0 | case money_base::space: |
2480 | 0 | if (__p != 3) { |
2481 | 0 | if (__ct.is(ctype_base::space, *__b)) |
2482 | 0 | __spaces.push_back(*__b++); |
2483 | 0 | else { |
2484 | 0 | __err |= ios_base::failbit; |
2485 | 0 | return false; |
2486 | 0 | } |
2487 | 0 | } |
2488 | 0 | _LIBCPP_FALLTHROUGH(); |
2489 | 0 | case money_base::none: |
2490 | 0 | if (__p != 3) { |
2491 | 0 | while (__b != __e && __ct.is(ctype_base::space, *__b)) |
2492 | 0 | __spaces.push_back(*__b++); |
2493 | 0 | } |
2494 | 0 | break; |
2495 | 0 | case money_base::sign: |
2496 | 0 | if (__psn.size() > 0 && *__b == __psn[0]) { |
2497 | 0 | ++__b; |
2498 | 0 | __neg = false; |
2499 | 0 | if (__psn.size() > 1) |
2500 | 0 | __trailing_sign = &__psn; |
2501 | 0 | break; |
2502 | 0 | } |
2503 | 0 | if (__nsn.size() > 0 && *__b == __nsn[0]) { |
2504 | 0 | ++__b; |
2505 | 0 | __neg = true; |
2506 | 0 | if (__nsn.size() > 1) |
2507 | 0 | __trailing_sign = &__nsn; |
2508 | 0 | break; |
2509 | 0 | } |
2510 | 0 | if (__psn.size() > 0 && __nsn.size() > 0) { // sign is required |
2511 | 0 | __err |= ios_base::failbit; |
2512 | 0 | return false; |
2513 | 0 | } |
2514 | 0 | if (__psn.size() == 0 && __nsn.size() == 0) |
2515 | | // locale has no way of specifying a sign. Use the initial value of __neg as a default |
2516 | 0 | break; |
2517 | 0 | __neg = (__nsn.size() == 0); |
2518 | 0 | break; |
2519 | 0 | case money_base::symbol: { |
2520 | 0 | bool __more_needed = |
2521 | 0 | __trailing_sign || (__p < 2) || (__p == 2 && __pat.field[3] != static_cast<char>(money_base::none)); |
2522 | 0 | bool __sb = (__flags & ios_base::showbase) != 0; |
2523 | 0 | if (__sb || __more_needed) { |
2524 | 0 | typename string_type::const_iterator __sym_space_end = __sym.begin(); |
2525 | 0 | if (__p > 0 && (__pat.field[__p - 1] == money_base::none || __pat.field[__p - 1] == money_base::space)) { |
2526 | | // Match spaces we've already read against spaces at |
2527 | | // the beginning of __sym. |
2528 | 0 | while (__sym_space_end != __sym.end() && __ct.is(ctype_base::space, *__sym_space_end)) |
2529 | 0 | ++__sym_space_end; |
2530 | 0 | const size_t __num_spaces = __sym_space_end - __sym.begin(); |
2531 | 0 | if (__num_spaces > __spaces.size() || |
2532 | 0 | !std::equal(__spaces.end() - __num_spaces, __spaces.end(), __sym.begin())) { |
2533 | | // No match. Put __sym_space_end back at the |
2534 | | // beginning of __sym, which will prevent a |
2535 | | // match in the next loop. |
2536 | 0 | __sym_space_end = __sym.begin(); |
2537 | 0 | } |
2538 | 0 | } |
2539 | 0 | typename string_type::const_iterator __sym_curr_char = __sym_space_end; |
2540 | 0 | while (__sym_curr_char != __sym.end() && __b != __e && *__b == *__sym_curr_char) { |
2541 | 0 | ++__b; |
2542 | 0 | ++__sym_curr_char; |
2543 | 0 | } |
2544 | 0 | if (__sb && __sym_curr_char != __sym.end()) { |
2545 | 0 | __err |= ios_base::failbit; |
2546 | 0 | return false; |
2547 | 0 | } |
2548 | 0 | } |
2549 | 0 | } break; |
2550 | 0 | case money_base::value: { |
2551 | 0 | unsigned __ng = 0; |
2552 | 0 | for (; __b != __e; ++__b) { |
2553 | 0 | char_type __c = *__b; |
2554 | 0 | if (__ct.is(ctype_base::digit, __c)) { |
2555 | 0 | if (__wn == __we) |
2556 | 0 | std::__double_or_nothing(__wb, __wn, __we); |
2557 | 0 | *__wn++ = __c; |
2558 | 0 | ++__ng; |
2559 | 0 | } else if (__grp.size() > 0 && __ng > 0 && __c == __ts) { |
2560 | 0 | if (__gn == __ge) |
2561 | 0 | std::__double_or_nothing(__gb, __gn, __ge); |
2562 | 0 | *__gn++ = __ng; |
2563 | 0 | __ng = 0; |
2564 | 0 | } else |
2565 | 0 | break; |
2566 | 0 | } |
2567 | 0 | if (__gb.get() != __gn && __ng > 0) { |
2568 | 0 | if (__gn == __ge) |
2569 | 0 | std::__double_or_nothing(__gb, __gn, __ge); |
2570 | 0 | *__gn++ = __ng; |
2571 | 0 | } |
2572 | 0 | if (__fd > 0) { |
2573 | 0 | if (__b == __e || *__b != __dp) { |
2574 | 0 | __err |= ios_base::failbit; |
2575 | 0 | return false; |
2576 | 0 | } |
2577 | 0 | for (++__b; __fd > 0; --__fd, ++__b) { |
2578 | 0 | if (__b == __e || !__ct.is(ctype_base::digit, *__b)) { |
2579 | 0 | __err |= ios_base::failbit; |
2580 | 0 | return false; |
2581 | 0 | } |
2582 | 0 | if (__wn == __we) |
2583 | 0 | std::__double_or_nothing(__wb, __wn, __we); |
2584 | 0 | *__wn++ = *__b; |
2585 | 0 | } |
2586 | 0 | } |
2587 | 0 | if (__wn == __wb.get()) { |
2588 | 0 | __err |= ios_base::failbit; |
2589 | 0 | return false; |
2590 | 0 | } |
2591 | 0 | } break; |
2592 | 0 | } |
2593 | 0 | } |
2594 | 0 | if (__trailing_sign) { |
2595 | 0 | for (unsigned __i = 1; __i < __trailing_sign->size(); ++__i, ++__b) { |
2596 | 0 | if (__b == __e || *__b != (*__trailing_sign)[__i]) { |
2597 | 0 | __err |= ios_base::failbit; |
2598 | 0 | return false; |
2599 | 0 | } |
2600 | 0 | } |
2601 | 0 | } |
2602 | 0 | if (__gb.get() != __gn) { |
2603 | 0 | ios_base::iostate __et = ios_base::goodbit; |
2604 | 0 | __check_grouping(__grp, __gb.get(), __gn, __et); |
2605 | 0 | if (__et) { |
2606 | 0 | __err |= ios_base::failbit; |
2607 | 0 | return false; |
2608 | 0 | } |
2609 | 0 | } |
2610 | 0 | return true; |
2611 | 0 | } Unexecuted instantiation: std::__1::money_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >&, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, bool, std::__1::locale const&, unsigned int, unsigned int&, bool&, std::__1::ctype<char> const&, std::__1::unique_ptr<char, void (*)(void*)>&, char*&, char*) Unexecuted instantiation: std::__1::money_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::__do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >&, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, bool, std::__1::locale const&, unsigned int, unsigned int&, bool&, std::__1::ctype<wchar_t> const&, std::__1::unique_ptr<wchar_t, void (*)(void*)>&, wchar_t*&, wchar_t*) |
2612 | | |
2613 | | template <class _CharT, class _InputIterator> |
2614 | | _InputIterator money_get<_CharT, _InputIterator>::do_get( |
2615 | 0 | iter_type __b, iter_type __e, bool __intl, ios_base& __iob, ios_base::iostate& __err, long double& __v) const { |
2616 | 0 | const int __bz = 100; |
2617 | 0 | char_type __wbuf[__bz]; |
2618 | 0 | unique_ptr<char_type, void (*)(void*)> __wb(__wbuf, __do_nothing); |
2619 | 0 | char_type* __wn; |
2620 | 0 | char_type* __we = __wbuf + __bz; |
2621 | 0 | locale __loc = __iob.getloc(); |
2622 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__loc); |
2623 | 0 | bool __neg = false; |
2624 | 0 | if (__do_get(__b, __e, __intl, __loc, __iob.flags(), __err, __neg, __ct, __wb, __wn, __we)) { |
2625 | 0 | const char __src[] = "0123456789"; |
2626 | 0 | char_type __atoms[sizeof(__src) - 1]; |
2627 | 0 | __ct.widen(__src, __src + (sizeof(__src) - 1), __atoms); |
2628 | 0 | char __nbuf[__bz]; |
2629 | 0 | char* __nc = __nbuf; |
2630 | 0 | unique_ptr<char, void (*)(void*)> __h(nullptr, free); |
2631 | 0 | if (__wn - __wb.get() > __bz - 2) { |
2632 | 0 | __h.reset((char*)malloc(static_cast<size_t>(__wn - __wb.get() + 2))); |
2633 | 0 | if (__h.get() == nullptr) |
2634 | 0 | __throw_bad_alloc(); |
2635 | 0 | __nc = __h.get(); |
2636 | 0 | } |
2637 | 0 | if (__neg) |
2638 | 0 | *__nc++ = '-'; |
2639 | 0 | for (const char_type* __w = __wb.get(); __w < __wn; ++__w, ++__nc) |
2640 | 0 | *__nc = __src[std::find(__atoms, std::end(__atoms), *__w) - __atoms]; |
2641 | 0 | *__nc = char(); |
2642 | 0 | if (sscanf(__nbuf, "%Lf", &__v) != 1) |
2643 | 0 | __throw_runtime_error("money_get error"); |
2644 | 0 | } |
2645 | 0 | if (__b == __e) |
2646 | 0 | __err |= ios_base::eofbit; |
2647 | 0 | return __b; |
2648 | 0 | } Unexecuted instantiation: std::__1::money_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, bool, std::__1::ios_base&, unsigned int&, long double&) const Unexecuted instantiation: std::__1::money_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, bool, std::__1::ios_base&, unsigned int&, long double&) const |
2649 | | |
2650 | | template <class _CharT, class _InputIterator> |
2651 | | _InputIterator money_get<_CharT, _InputIterator>::do_get( |
2652 | 0 | iter_type __b, iter_type __e, bool __intl, ios_base& __iob, ios_base::iostate& __err, string_type& __v) const { |
2653 | 0 | const int __bz = 100; |
2654 | 0 | char_type __wbuf[__bz]; |
2655 | 0 | unique_ptr<char_type, void (*)(void*)> __wb(__wbuf, __do_nothing); |
2656 | 0 | char_type* __wn; |
2657 | 0 | char_type* __we = __wbuf + __bz; |
2658 | 0 | locale __loc = __iob.getloc(); |
2659 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__loc); |
2660 | 0 | bool __neg = false; |
2661 | 0 | if (__do_get(__b, __e, __intl, __loc, __iob.flags(), __err, __neg, __ct, __wb, __wn, __we)) { |
2662 | 0 | __v.clear(); |
2663 | 0 | if (__neg) |
2664 | 0 | __v.push_back(__ct.widen('-')); |
2665 | 0 | char_type __z = __ct.widen('0'); |
2666 | 0 | char_type* __w; |
2667 | 0 | for (__w = __wb.get(); __w < __wn - 1; ++__w) |
2668 | 0 | if (*__w != __z) |
2669 | 0 | break; |
2670 | 0 | __v.append(__w, __wn); |
2671 | 0 | } |
2672 | 0 | if (__b == __e) |
2673 | 0 | __err |= ios_base::eofbit; |
2674 | 0 | return __b; |
2675 | 0 | } Unexecuted instantiation: std::__1::money_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, bool, std::__1::ios_base&, unsigned int&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) const Unexecuted instantiation: std::__1::money_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, bool, std::__1::ios_base&, unsigned int&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&) const |
2676 | | |
2677 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<char>; |
2678 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
2679 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>; |
2680 | | #endif |
2681 | | |
2682 | | // money_put |
2683 | | |
2684 | | template <class _CharT> |
2685 | | class __money_put { |
2686 | | protected: |
2687 | | typedef _CharT char_type; |
2688 | | typedef basic_string<char_type> string_type; |
2689 | | |
2690 | 12 | _LIBCPP_HIDE_FROM_ABI __money_put() {} std::__1::__money_put<char>::__money_put[abi:ne180100]() Line | Count | Source | 2690 | 6 | _LIBCPP_HIDE_FROM_ABI __money_put() {} |
std::__1::__money_put<wchar_t>::__money_put[abi:ne180100]() Line | Count | Source | 2690 | 6 | _LIBCPP_HIDE_FROM_ABI __money_put() {} |
|
2691 | | |
2692 | | static void __gather_info( |
2693 | | bool __intl, |
2694 | | bool __neg, |
2695 | | const locale& __loc, |
2696 | | money_base::pattern& __pat, |
2697 | | char_type& __dp, |
2698 | | char_type& __ts, |
2699 | | string& __grp, |
2700 | | string_type& __sym, |
2701 | | string_type& __sn, |
2702 | | int& __fd); |
2703 | | static void __format( |
2704 | | char_type* __mb, |
2705 | | char_type*& __mi, |
2706 | | char_type*& __me, |
2707 | | ios_base::fmtflags __flags, |
2708 | | const char_type* __db, |
2709 | | const char_type* __de, |
2710 | | const ctype<char_type>& __ct, |
2711 | | bool __neg, |
2712 | | const money_base::pattern& __pat, |
2713 | | char_type __dp, |
2714 | | char_type __ts, |
2715 | | const string& __grp, |
2716 | | const string_type& __sym, |
2717 | | const string_type& __sn, |
2718 | | int __fd); |
2719 | | }; |
2720 | | |
2721 | | template <class _CharT> |
2722 | | void __money_put<_CharT>::__gather_info( |
2723 | | bool __intl, |
2724 | | bool __neg, |
2725 | | const locale& __loc, |
2726 | | money_base::pattern& __pat, |
2727 | | char_type& __dp, |
2728 | | char_type& __ts, |
2729 | | string& __grp, |
2730 | | string_type& __sym, |
2731 | | string_type& __sn, |
2732 | 0 | int& __fd) { |
2733 | 0 | if (__intl) { |
2734 | 0 | const moneypunct<char_type, true>& __mp = std::use_facet<moneypunct<char_type, true> >(__loc); |
2735 | 0 | if (__neg) { |
2736 | 0 | __pat = __mp.neg_format(); |
2737 | 0 | __sn = __mp.negative_sign(); |
2738 | 0 | } else { |
2739 | 0 | __pat = __mp.pos_format(); |
2740 | 0 | __sn = __mp.positive_sign(); |
2741 | 0 | } |
2742 | 0 | __dp = __mp.decimal_point(); |
2743 | 0 | __ts = __mp.thousands_sep(); |
2744 | 0 | __grp = __mp.grouping(); |
2745 | 0 | __sym = __mp.curr_symbol(); |
2746 | 0 | __fd = __mp.frac_digits(); |
2747 | 0 | } else { |
2748 | 0 | const moneypunct<char_type, false>& __mp = std::use_facet<moneypunct<char_type, false> >(__loc); |
2749 | 0 | if (__neg) { |
2750 | 0 | __pat = __mp.neg_format(); |
2751 | 0 | __sn = __mp.negative_sign(); |
2752 | 0 | } else { |
2753 | 0 | __pat = __mp.pos_format(); |
2754 | 0 | __sn = __mp.positive_sign(); |
2755 | 0 | } |
2756 | 0 | __dp = __mp.decimal_point(); |
2757 | 0 | __ts = __mp.thousands_sep(); |
2758 | 0 | __grp = __mp.grouping(); |
2759 | 0 | __sym = __mp.curr_symbol(); |
2760 | 0 | __fd = __mp.frac_digits(); |
2761 | 0 | } |
2762 | 0 | } Unexecuted instantiation: std::__1::__money_put<char>::__gather_info(bool, bool, std::__1::locale const&, std::__1::money_base::pattern&, char&, char&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, int&) Unexecuted instantiation: std::__1::__money_put<wchar_t>::__gather_info(bool, bool, std::__1::locale const&, std::__1::money_base::pattern&, wchar_t&, wchar_t&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, int&) |
2763 | | |
2764 | | template <class _CharT> |
2765 | | void __money_put<_CharT>::__format( |
2766 | | char_type* __mb, |
2767 | | char_type*& __mi, |
2768 | | char_type*& __me, |
2769 | | ios_base::fmtflags __flags, |
2770 | | const char_type* __db, |
2771 | | const char_type* __de, |
2772 | | const ctype<char_type>& __ct, |
2773 | | bool __neg, |
2774 | | const money_base::pattern& __pat, |
2775 | | char_type __dp, |
2776 | | char_type __ts, |
2777 | | const string& __grp, |
2778 | | const string_type& __sym, |
2779 | | const string_type& __sn, |
2780 | 0 | int __fd) { |
2781 | 0 | __me = __mb; |
2782 | 0 | for (char __p : __pat.field) { |
2783 | 0 | switch (__p) { |
2784 | 0 | case money_base::none: |
2785 | 0 | __mi = __me; |
2786 | 0 | break; |
2787 | 0 | case money_base::space: |
2788 | 0 | __mi = __me; |
2789 | 0 | *__me++ = __ct.widen(' '); |
2790 | 0 | break; |
2791 | 0 | case money_base::sign: |
2792 | 0 | if (!__sn.empty()) |
2793 | 0 | *__me++ = __sn[0]; |
2794 | 0 | break; |
2795 | 0 | case money_base::symbol: |
2796 | 0 | if (!__sym.empty() && (__flags & ios_base::showbase)) |
2797 | 0 | __me = std::copy(__sym.begin(), __sym.end(), __me); |
2798 | 0 | break; |
2799 | 0 | case money_base::value: { |
2800 | | // remember start of value so we can reverse it |
2801 | 0 | char_type* __t = __me; |
2802 | | // find beginning of digits |
2803 | 0 | if (__neg) |
2804 | 0 | ++__db; |
2805 | | // find end of digits |
2806 | 0 | const char_type* __d; |
2807 | 0 | for (__d = __db; __d < __de; ++__d) |
2808 | 0 | if (!__ct.is(ctype_base::digit, *__d)) |
2809 | 0 | break; |
2810 | | // print fractional part |
2811 | 0 | if (__fd > 0) { |
2812 | 0 | int __f; |
2813 | 0 | for (__f = __fd; __d > __db && __f > 0; --__f) |
2814 | 0 | *__me++ = *--__d; |
2815 | 0 | char_type __z = __f > 0 ? __ct.widen('0') : char_type(); |
2816 | 0 | for (; __f > 0; --__f) |
2817 | 0 | *__me++ = __z; |
2818 | 0 | *__me++ = __dp; |
2819 | 0 | } |
2820 | | // print units part |
2821 | 0 | if (__d == __db) { |
2822 | 0 | *__me++ = __ct.widen('0'); |
2823 | 0 | } else { |
2824 | 0 | unsigned __ng = 0; |
2825 | 0 | unsigned __ig = 0; |
2826 | 0 | unsigned __gl = __grp.empty() ? numeric_limits<unsigned>::max() : static_cast<unsigned>(__grp[__ig]); |
2827 | 0 | while (__d != __db) { |
2828 | 0 | if (__ng == __gl) { |
2829 | 0 | *__me++ = __ts; |
2830 | 0 | __ng = 0; |
2831 | 0 | if (++__ig < __grp.size()) |
2832 | 0 | __gl = __grp[__ig] == numeric_limits<char>::max() |
2833 | 0 | ? numeric_limits<unsigned>::max() |
2834 | 0 | : static_cast<unsigned>(__grp[__ig]); |
2835 | 0 | } |
2836 | 0 | *__me++ = *--__d; |
2837 | 0 | ++__ng; |
2838 | 0 | } |
2839 | 0 | } |
2840 | | // reverse it |
2841 | 0 | std::reverse(__t, __me); |
2842 | 0 | } break; |
2843 | 0 | } |
2844 | 0 | } |
2845 | | // print rest of sign, if any |
2846 | 0 | if (__sn.size() > 1) |
2847 | 0 | __me = std::copy(__sn.begin() + 1, __sn.end(), __me); |
2848 | | // set alignment |
2849 | 0 | if ((__flags & ios_base::adjustfield) == ios_base::left) |
2850 | 0 | __mi = __me; |
2851 | 0 | else if ((__flags & ios_base::adjustfield) != ios_base::internal) |
2852 | 0 | __mi = __mb; |
2853 | 0 | } Unexecuted instantiation: std::__1::__money_put<char>::__format(char*, char*&, char*&, unsigned int, char const*, char const*, std::__1::ctype<char> const&, bool, std::__1::money_base::pattern const&, char, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) Unexecuted instantiation: std::__1::__money_put<wchar_t>::__format(wchar_t*, wchar_t*&, wchar_t*&, unsigned int, wchar_t const*, wchar_t const*, std::__1::ctype<wchar_t> const&, bool, std::__1::money_base::pattern const&, wchar_t, wchar_t, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, int) |
2854 | | |
2855 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>; |
2856 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
2857 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>; |
2858 | | #endif |
2859 | | |
2860 | | template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> > |
2861 | | class _LIBCPP_TEMPLATE_VIS money_put : public locale::facet, private __money_put<_CharT> { |
2862 | | public: |
2863 | | typedef _CharT char_type; |
2864 | | typedef _OutputIterator iter_type; |
2865 | | typedef basic_string<char_type> string_type; |
2866 | | |
2867 | 12 | _LIBCPP_HIDE_FROM_ABI explicit money_put(size_t __refs = 0) : locale::facet(__refs) {} std::__1::money_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::money_put[abi:ne180100](unsigned long) Line | Count | Source | 2867 | 6 | _LIBCPP_HIDE_FROM_ABI explicit money_put(size_t __refs = 0) : locale::facet(__refs) {} |
std::__1::money_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::money_put[abi:ne180100](unsigned long) Line | Count | Source | 2867 | 6 | _LIBCPP_HIDE_FROM_ABI explicit money_put(size_t __refs = 0) : locale::facet(__refs) {} |
|
2868 | | |
2869 | | _LIBCPP_HIDE_FROM_ABI iter_type |
2870 | | put(iter_type __s, bool __intl, ios_base& __iob, char_type __fl, long double __units) const { |
2871 | | return do_put(__s, __intl, __iob, __fl, __units); |
2872 | | } |
2873 | | |
2874 | | _LIBCPP_HIDE_FROM_ABI iter_type |
2875 | | put(iter_type __s, bool __intl, ios_base& __iob, char_type __fl, const string_type& __digits) const { |
2876 | | return do_put(__s, __intl, __iob, __fl, __digits); |
2877 | | } |
2878 | | |
2879 | | static locale::id id; |
2880 | | |
2881 | | protected: |
2882 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~money_put() override {} |
2883 | | |
2884 | | virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __iob, char_type __fl, long double __units) const; |
2885 | | virtual iter_type |
2886 | | do_put(iter_type __s, bool __intl, ios_base& __iob, char_type __fl, const string_type& __digits) const; |
2887 | | }; |
2888 | | |
2889 | | template <class _CharT, class _OutputIterator> |
2890 | | locale::id money_put<_CharT, _OutputIterator>::id; |
2891 | | |
2892 | | template <class _CharT, class _OutputIterator> |
2893 | | _OutputIterator money_put<_CharT, _OutputIterator>::do_put( |
2894 | 0 | iter_type __s, bool __intl, ios_base& __iob, char_type __fl, long double __units) const { |
2895 | | // convert to char |
2896 | 0 | const size_t __bs = 100; |
2897 | 0 | char __buf[__bs]; |
2898 | 0 | char* __bb = __buf; |
2899 | 0 | char_type __digits[__bs]; |
2900 | 0 | char_type* __db = __digits; |
2901 | 0 | int __n = snprintf(__bb, __bs, "%.0Lf", __units); |
2902 | 0 | unique_ptr<char, void (*)(void*)> __hn(nullptr, free); |
2903 | 0 | unique_ptr<char_type, void (*)(void*)> __hd(0, free); |
2904 | | // secure memory for digit storage |
2905 | 0 | if (static_cast<size_t>(__n) > __bs - 1) { |
2906 | 0 | __n = __libcpp_asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units); |
2907 | 0 | if (__n == -1) |
2908 | 0 | __throw_bad_alloc(); |
2909 | 0 | __hn.reset(__bb); |
2910 | 0 | __hd.reset((char_type*)malloc(static_cast<size_t>(__n) * sizeof(char_type))); |
2911 | 0 | if (__hd == nullptr) |
2912 | 0 | __throw_bad_alloc(); |
2913 | 0 | __db = __hd.get(); |
2914 | 0 | } |
2915 | | // gather info |
2916 | 0 | locale __loc = __iob.getloc(); |
2917 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__loc); |
2918 | 0 | __ct.widen(__bb, __bb + __n, __db); |
2919 | 0 | bool __neg = __n > 0 && __bb[0] == '-'; |
2920 | 0 | money_base::pattern __pat; |
2921 | 0 | char_type __dp; |
2922 | 0 | char_type __ts; |
2923 | 0 | string __grp; |
2924 | 0 | string_type __sym; |
2925 | 0 | string_type __sn; |
2926 | 0 | int __fd; |
2927 | 0 | this->__gather_info(__intl, __neg, __loc, __pat, __dp, __ts, __grp, __sym, __sn, __fd); |
2928 | | // secure memory for formatting |
2929 | 0 | char_type __mbuf[__bs]; |
2930 | 0 | char_type* __mb = __mbuf; |
2931 | 0 | unique_ptr<char_type, void (*)(void*)> __hw(0, free); |
2932 | 0 | size_t __exn = __n > __fd ? (static_cast<size_t>(__n) - static_cast<size_t>(__fd)) * 2 + __sn.size() + __sym.size() + |
2933 | 0 | static_cast<size_t>(__fd) + 1 |
2934 | 0 | : __sn.size() + __sym.size() + static_cast<size_t>(__fd) + 2; |
2935 | 0 | if (__exn > __bs) { |
2936 | 0 | __hw.reset((char_type*)malloc(__exn * sizeof(char_type))); |
2937 | 0 | __mb = __hw.get(); |
2938 | 0 | if (__mb == 0) |
2939 | 0 | __throw_bad_alloc(); |
2940 | 0 | } |
2941 | | // format |
2942 | 0 | char_type* __mi; |
2943 | 0 | char_type* __me; |
2944 | 0 | this->__format( |
2945 | 0 | __mb, __mi, __me, __iob.flags(), __db, __db + __n, __ct, __neg, __pat, __dp, __ts, __grp, __sym, __sn, __fd); |
2946 | 0 | return std::__pad_and_output(__s, __mb, __mi, __me, __iob, __fl); |
2947 | 0 | } Unexecuted instantiation: std::__1::money_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, bool, std::__1::ios_base&, char, long double) const Unexecuted instantiation: std::__1::money_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, bool, std::__1::ios_base&, wchar_t, long double) const |
2948 | | |
2949 | | template <class _CharT, class _OutputIterator> |
2950 | | _OutputIterator money_put<_CharT, _OutputIterator>::do_put( |
2951 | 0 | iter_type __s, bool __intl, ios_base& __iob, char_type __fl, const string_type& __digits) const { |
2952 | | // gather info |
2953 | 0 | locale __loc = __iob.getloc(); |
2954 | 0 | const ctype<char_type>& __ct = std::use_facet<ctype<char_type> >(__loc); |
2955 | 0 | bool __neg = __digits.size() > 0 && __digits[0] == __ct.widen('-'); |
2956 | 0 | money_base::pattern __pat; |
2957 | 0 | char_type __dp; |
2958 | 0 | char_type __ts; |
2959 | 0 | string __grp; |
2960 | 0 | string_type __sym; |
2961 | 0 | string_type __sn; |
2962 | 0 | int __fd; |
2963 | 0 | this->__gather_info(__intl, __neg, __loc, __pat, __dp, __ts, __grp, __sym, __sn, __fd); |
2964 | | // secure memory for formatting |
2965 | 0 | char_type __mbuf[100]; |
2966 | 0 | char_type* __mb = __mbuf; |
2967 | 0 | unique_ptr<char_type, void (*)(void*)> __h(0, free); |
2968 | 0 | size_t __exn = |
2969 | 0 | static_cast<int>(__digits.size()) > __fd |
2970 | 0 | ? (__digits.size() - static_cast<size_t>(__fd)) * 2 + __sn.size() + __sym.size() + static_cast<size_t>(__fd) + |
2971 | 0 | 1 |
2972 | 0 | : __sn.size() + __sym.size() + static_cast<size_t>(__fd) + 2; |
2973 | 0 | if (__exn > 100) { |
2974 | 0 | __h.reset((char_type*)malloc(__exn * sizeof(char_type))); |
2975 | 0 | __mb = __h.get(); |
2976 | 0 | if (__mb == 0) |
2977 | 0 | __throw_bad_alloc(); |
2978 | 0 | } |
2979 | | // format |
2980 | 0 | char_type* __mi; |
2981 | 0 | char_type* __me; |
2982 | 0 | this->__format( |
2983 | 0 | __mb, |
2984 | 0 | __mi, |
2985 | 0 | __me, |
2986 | 0 | __iob.flags(), |
2987 | 0 | __digits.data(), |
2988 | 0 | __digits.data() + __digits.size(), |
2989 | 0 | __ct, |
2990 | 0 | __neg, |
2991 | 0 | __pat, |
2992 | 0 | __dp, |
2993 | 0 | __ts, |
2994 | 0 | __grp, |
2995 | 0 | __sym, |
2996 | 0 | __sn, |
2997 | 0 | __fd); |
2998 | 0 | return std::__pad_and_output(__s, __mb, __mi, __me, __iob, __fl); |
2999 | 0 | } Unexecuted instantiation: std::__1::money_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, bool, std::__1::ios_base&, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Unexecuted instantiation: std::__1::money_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_put(std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, bool, std::__1::ios_base&, wchar_t, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&) const |
3000 | | |
3001 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>; |
3002 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
3003 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>; |
3004 | | #endif |
3005 | | |
3006 | | // messages |
3007 | | |
3008 | | class _LIBCPP_EXPORTED_FROM_ABI messages_base { |
3009 | | public: |
3010 | | typedef intptr_t catalog; |
3011 | | |
3012 | 12 | _LIBCPP_HIDE_FROM_ABI messages_base() {} |
3013 | | }; |
3014 | | |
3015 | | template <class _CharT> |
3016 | | class _LIBCPP_TEMPLATE_VIS messages : public locale::facet, public messages_base { |
3017 | | public: |
3018 | | typedef _CharT char_type; |
3019 | | typedef basic_string<_CharT> string_type; |
3020 | | |
3021 | 12 | _LIBCPP_HIDE_FROM_ABI explicit messages(size_t __refs = 0) : locale::facet(__refs) {} std::__1::messages<char>::messages[abi:ne180100](unsigned long) Line | Count | Source | 3021 | 6 | _LIBCPP_HIDE_FROM_ABI explicit messages(size_t __refs = 0) : locale::facet(__refs) {} |
std::__1::messages<wchar_t>::messages[abi:ne180100](unsigned long) Line | Count | Source | 3021 | 6 | _LIBCPP_HIDE_FROM_ABI explicit messages(size_t __refs = 0) : locale::facet(__refs) {} |
|
3022 | | |
3023 | | _LIBCPP_HIDE_FROM_ABI catalog open(const basic_string<char>& __nm, const locale& __loc) const { |
3024 | | return do_open(__nm, __loc); |
3025 | | } |
3026 | | |
3027 | | _LIBCPP_HIDE_FROM_ABI string_type get(catalog __c, int __set, int __msgid, const string_type& __dflt) const { |
3028 | | return do_get(__c, __set, __msgid, __dflt); |
3029 | | } |
3030 | | |
3031 | | _LIBCPP_HIDE_FROM_ABI void close(catalog __c) const { do_close(__c); } |
3032 | | |
3033 | | static locale::id id; |
3034 | | |
3035 | | protected: |
3036 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~messages() override {} |
3037 | | |
3038 | | virtual catalog do_open(const basic_string<char>&, const locale&) const; |
3039 | | virtual string_type do_get(catalog, int __set, int __msgid, const string_type& __dflt) const; |
3040 | | virtual void do_close(catalog) const; |
3041 | | }; |
3042 | | |
3043 | | template <class _CharT> |
3044 | | locale::id messages<_CharT>::id; |
3045 | | |
3046 | | template <class _CharT> |
3047 | 0 | typename messages<_CharT>::catalog messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const { |
3048 | 0 | #ifdef _LIBCPP_HAS_CATOPEN |
3049 | 0 | return (catalog)catopen(__nm.c_str(), NL_CAT_LOCALE); |
3050 | | #else // !_LIBCPP_HAS_CATOPEN |
3051 | | (void)__nm; |
3052 | | return -1; |
3053 | | #endif // _LIBCPP_HAS_CATOPEN |
3054 | 0 | } Unexecuted instantiation: std::__1::messages<char>::do_open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::locale const&) const Unexecuted instantiation: std::__1::messages<wchar_t>::do_open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::locale const&) const |
3055 | | |
3056 | | template <class _CharT> |
3057 | | typename messages<_CharT>::string_type |
3058 | 0 | messages<_CharT>::do_get(catalog __c, int __set, int __msgid, const string_type& __dflt) const { |
3059 | 0 | #ifdef _LIBCPP_HAS_CATOPEN |
3060 | 0 | string __ndflt; |
3061 | 0 | __narrow_to_utf8<sizeof(char_type) * __CHAR_BIT__>()( |
3062 | 0 | std::back_inserter(__ndflt), __dflt.c_str(), __dflt.c_str() + __dflt.size()); |
3063 | 0 | nl_catd __cat = (nl_catd)__c; |
3064 | 0 | static_assert(sizeof(catalog) >= sizeof(nl_catd), "Unexpected nl_catd type"); |
3065 | 0 | char* __n = catgets(__cat, __set, __msgid, __ndflt.c_str()); |
3066 | 0 | string_type __w; |
3067 | 0 | __widen_from_utf8<sizeof(char_type) * __CHAR_BIT__>()(std::back_inserter(__w), __n, __n + std::strlen(__n)); |
3068 | 0 | return __w; |
3069 | | #else // !_LIBCPP_HAS_CATOPEN |
3070 | | (void)__c; |
3071 | | (void)__set; |
3072 | | (void)__msgid; |
3073 | | return __dflt; |
3074 | | #endif // _LIBCPP_HAS_CATOPEN |
3075 | 0 | } Unexecuted instantiation: std::__1::messages<char>::do_get(long, int, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Unexecuted instantiation: std::__1::messages<wchar_t>::do_get(long, int, int, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&) const |
3076 | | |
3077 | | template <class _CharT> |
3078 | 0 | void messages<_CharT>::do_close(catalog __c) const { |
3079 | 0 | #ifdef _LIBCPP_HAS_CATOPEN |
3080 | 0 | catclose((nl_catd)__c); |
3081 | | #else // !_LIBCPP_HAS_CATOPEN |
3082 | | (void)__c; |
3083 | | #endif // _LIBCPP_HAS_CATOPEN |
3084 | 0 | } Unexecuted instantiation: std::__1::messages<char>::do_close(long) const Unexecuted instantiation: std::__1::messages<wchar_t>::do_close(long) const |
3085 | | |
3086 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<char>; |
3087 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
3088 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>; |
3089 | | #endif |
3090 | | |
3091 | | template <class _CharT> |
3092 | | class _LIBCPP_TEMPLATE_VIS messages_byname : public messages<_CharT> { |
3093 | | public: |
3094 | | typedef messages_base::catalog catalog; |
3095 | | typedef basic_string<_CharT> string_type; |
3096 | | |
3097 | | _LIBCPP_HIDE_FROM_ABI explicit messages_byname(const char*, size_t __refs = 0) : messages<_CharT>(__refs) {} |
3098 | | |
3099 | 0 | _LIBCPP_HIDE_FROM_ABI explicit messages_byname(const string&, size_t __refs = 0) : messages<_CharT>(__refs) {} Unexecuted instantiation: std::__1::messages_byname<char>::messages_byname[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) Unexecuted instantiation: std::__1::messages_byname<wchar_t>::messages_byname[abi:ne180100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) |
3100 | | |
3101 | | protected: |
3102 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~messages_byname() override {} |
3103 | | }; |
3104 | | |
3105 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>; |
3106 | | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
3107 | | extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>; |
3108 | | #endif |
3109 | | |
3110 | | template <class _Codecvt, |
3111 | | class _Elem = wchar_t, |
3112 | | class _WideAlloc = allocator<_Elem>, |
3113 | | class _ByteAlloc = allocator<char> > |
3114 | | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert { |
3115 | | public: |
3116 | | typedef basic_string<char, char_traits<char>, _ByteAlloc> byte_string; |
3117 | | typedef basic_string<_Elem, char_traits<_Elem>, _WideAlloc> wide_string; |
3118 | | typedef typename _Codecvt::state_type state_type; |
3119 | | typedef typename wide_string::traits_type::int_type int_type; |
3120 | | |
3121 | | private: |
3122 | | byte_string __byte_err_string_; |
3123 | | wide_string __wide_err_string_; |
3124 | | _Codecvt* __cvtptr_; |
3125 | | state_type __cvtstate_; |
3126 | | size_t __cvtcount_; |
3127 | | |
3128 | | wstring_convert(const wstring_convert& __wc); |
3129 | | wstring_convert& operator=(const wstring_convert& __wc); |
3130 | | |
3131 | | public: |
3132 | | #ifndef _LIBCPP_CXX03_LANG |
3133 | | _LIBCPP_HIDE_FROM_ABI wstring_convert() : wstring_convert(new _Codecvt) {} |
3134 | | _LIBCPP_HIDE_FROM_ABI explicit wstring_convert(_Codecvt* __pcvt); |
3135 | | #else |
3136 | | _LIBCPP_HIDE_FROM_ABI _LIBCPP_EXPLICIT_SINCE_CXX14 wstring_convert(_Codecvt* __pcvt = new _Codecvt); |
3137 | | #endif |
3138 | | |
3139 | | _LIBCPP_HIDE_FROM_ABI wstring_convert(_Codecvt* __pcvt, state_type __state); |
3140 | | _LIBCPP_EXPLICIT_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI |
3141 | | wstring_convert(const byte_string& __byte_err, const wide_string& __wide_err = wide_string()); |
3142 | | #ifndef _LIBCPP_CXX03_LANG |
3143 | | _LIBCPP_HIDE_FROM_ABI wstring_convert(wstring_convert&& __wc); |
3144 | | #endif |
3145 | | _LIBCPP_HIDE_FROM_ABI ~wstring_convert(); |
3146 | | |
3147 | | _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(char __byte) { return from_bytes(&__byte, &__byte + 1); } |
3148 | | _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const char* __ptr) { |
3149 | | return from_bytes(__ptr, __ptr + char_traits<char>::length(__ptr)); |
3150 | | } |
3151 | | _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const byte_string& __str) { |
3152 | | return from_bytes(__str.data(), __str.data() + __str.size()); |
3153 | | } |
3154 | | _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const char* __first, const char* __last); |
3155 | | |
3156 | | _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(_Elem __wchar) { return to_bytes(&__wchar, &__wchar + 1); } |
3157 | | _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const _Elem* __wptr) { |
3158 | | return to_bytes(__wptr, __wptr + char_traits<_Elem>::length(__wptr)); |
3159 | | } |
3160 | | _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const wide_string& __wstr) { |
3161 | | return to_bytes(__wstr.data(), __wstr.data() + __wstr.size()); |
3162 | | } |
3163 | | _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const _Elem* __first, const _Elem* __last); |
3164 | | |
3165 | | _LIBCPP_HIDE_FROM_ABI size_t converted() const _NOEXCEPT { return __cvtcount_; } |
3166 | | _LIBCPP_HIDE_FROM_ABI state_type state() const { return __cvtstate_; } |
3167 | | }; |
3168 | | |
3169 | | _LIBCPP_SUPPRESS_DEPRECATED_PUSH |
3170 | | template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc> |
3171 | | inline wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wstring_convert(_Codecvt* __pcvt) |
3172 | | : __cvtptr_(__pcvt), __cvtstate_(), __cvtcount_(0) {} |
3173 | | _LIBCPP_SUPPRESS_DEPRECATED_POP |
3174 | | |
3175 | | template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc> |
3176 | | inline wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wstring_convert(_Codecvt* __pcvt, state_type __state) |
3177 | | : __cvtptr_(__pcvt), __cvtstate_(__state), __cvtcount_(0) {} |
3178 | | |
3179 | | template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc> |
3180 | | wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wstring_convert( |
3181 | | const byte_string& __byte_err, const wide_string& __wide_err) |
3182 | | : __byte_err_string_(__byte_err), __wide_err_string_(__wide_err), __cvtstate_(), __cvtcount_(0) { |
3183 | | __cvtptr_ = new _Codecvt; |
3184 | | } |
3185 | | |
3186 | | #ifndef _LIBCPP_CXX03_LANG |
3187 | | |
3188 | | template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc> |
3189 | | inline wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wstring_convert(wstring_convert&& __wc) |
3190 | | : __byte_err_string_(std::move(__wc.__byte_err_string_)), |
3191 | | __wide_err_string_(std::move(__wc.__wide_err_string_)), |
3192 | | __cvtptr_(__wc.__cvtptr_), |
3193 | | __cvtstate_(__wc.__cvtstate_), |
3194 | | __cvtcount_(__wc.__cvtcount_) { |
3195 | | __wc.__cvtptr_ = nullptr; |
3196 | | } |
3197 | | |
3198 | | #endif // _LIBCPP_CXX03_LANG |
3199 | | |
3200 | | _LIBCPP_SUPPRESS_DEPRECATED_PUSH |
3201 | | template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc> |
3202 | | wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::~wstring_convert() { |
3203 | | delete __cvtptr_; |
3204 | | } |
3205 | | |
3206 | | template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc> |
3207 | | typename wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::wide_string |
3208 | | wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::from_bytes(const char* __frm, const char* __frm_end) { |
3209 | | _LIBCPP_SUPPRESS_DEPRECATED_POP |
3210 | | __cvtcount_ = 0; |
3211 | | if (__cvtptr_ != nullptr) { |
3212 | | wide_string __ws(2 * (__frm_end - __frm), _Elem()); |
3213 | | if (__frm != __frm_end) |
3214 | | __ws.resize(__ws.capacity()); |
3215 | | codecvt_base::result __r = codecvt_base::ok; |
3216 | | state_type __st = __cvtstate_; |
3217 | | if (__frm != __frm_end) { |
3218 | | _Elem* __to = &__ws[0]; |
3219 | | _Elem* __to_end = __to + __ws.size(); |
3220 | | const char* __frm_nxt; |
3221 | | do { |
3222 | | _Elem* __to_nxt; |
3223 | | __r = __cvtptr_->in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); |
3224 | | __cvtcount_ += __frm_nxt - __frm; |
3225 | | if (__frm_nxt == __frm) { |
3226 | | __r = codecvt_base::error; |
3227 | | } else if (__r == codecvt_base::noconv) { |
3228 | | __ws.resize(__to - &__ws[0]); |
3229 | | // This only gets executed if _Elem is char |
3230 | | __ws.append((const _Elem*)__frm, (const _Elem*)__frm_end); |
3231 | | __frm = __frm_nxt; |
3232 | | __r = codecvt_base::ok; |
3233 | | } else if (__r == codecvt_base::ok) { |
3234 | | __ws.resize(__to_nxt - &__ws[0]); |
3235 | | __frm = __frm_nxt; |
3236 | | } else if (__r == codecvt_base::partial) { |
3237 | | ptrdiff_t __s = __to_nxt - &__ws[0]; |
3238 | | __ws.resize(2 * __s); |
3239 | | __to = &__ws[0] + __s; |
3240 | | __to_end = &__ws[0] + __ws.size(); |
3241 | | __frm = __frm_nxt; |
3242 | | } |
3243 | | } while (__r == codecvt_base::partial && __frm_nxt < __frm_end); |
3244 | | } |
3245 | | if (__r == codecvt_base::ok) |
3246 | | return __ws; |
3247 | | } |
3248 | | |
3249 | | if (__wide_err_string_.empty()) |
3250 | | __throw_range_error("wstring_convert: from_bytes error"); |
3251 | | |
3252 | | return __wide_err_string_; |
3253 | | } |
3254 | | |
3255 | | template <class _Codecvt, class _Elem, class _WideAlloc, class _ByteAlloc> |
3256 | | typename wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::byte_string |
3257 | | wstring_convert<_Codecvt, _Elem, _WideAlloc, _ByteAlloc>::to_bytes(const _Elem* __frm, const _Elem* __frm_end) { |
3258 | | __cvtcount_ = 0; |
3259 | | if (__cvtptr_ != nullptr) { |
3260 | | byte_string __bs(2 * (__frm_end - __frm), char()); |
3261 | | if (__frm != __frm_end) |
3262 | | __bs.resize(__bs.capacity()); |
3263 | | codecvt_base::result __r = codecvt_base::ok; |
3264 | | state_type __st = __cvtstate_; |
3265 | | if (__frm != __frm_end) { |
3266 | | char* __to = &__bs[0]; |
3267 | | char* __to_end = __to + __bs.size(); |
3268 | | const _Elem* __frm_nxt; |
3269 | | do { |
3270 | | char* __to_nxt; |
3271 | | __r = __cvtptr_->out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); |
3272 | | __cvtcount_ += __frm_nxt - __frm; |
3273 | | if (__frm_nxt == __frm) { |
3274 | | __r = codecvt_base::error; |
3275 | | } else if (__r == codecvt_base::noconv) { |
3276 | | __bs.resize(__to - &__bs[0]); |
3277 | | // This only gets executed if _Elem is char |
3278 | | __bs.append((const char*)__frm, (const char*)__frm_end); |
3279 | | __frm = __frm_nxt; |
3280 | | __r = codecvt_base::ok; |
3281 | | } else if (__r == codecvt_base::ok) { |
3282 | | __bs.resize(__to_nxt - &__bs[0]); |
3283 | | __frm = __frm_nxt; |
3284 | | } else if (__r == codecvt_base::partial) { |
3285 | | ptrdiff_t __s = __to_nxt - &__bs[0]; |
3286 | | __bs.resize(2 * __s); |
3287 | | __to = &__bs[0] + __s; |
3288 | | __to_end = &__bs[0] + __bs.size(); |
3289 | | __frm = __frm_nxt; |
3290 | | } |
3291 | | } while (__r == codecvt_base::partial && __frm_nxt < __frm_end); |
3292 | | } |
3293 | | if (__r == codecvt_base::ok) { |
3294 | | size_t __s = __bs.size(); |
3295 | | __bs.resize(__bs.capacity()); |
3296 | | char* __to = &__bs[0] + __s; |
3297 | | char* __to_end = __to + __bs.size(); |
3298 | | do { |
3299 | | char* __to_nxt; |
3300 | | __r = __cvtptr_->unshift(__st, __to, __to_end, __to_nxt); |
3301 | | if (__r == codecvt_base::noconv) { |
3302 | | __bs.resize(__to - &__bs[0]); |
3303 | | __r = codecvt_base::ok; |
3304 | | } else if (__r == codecvt_base::ok) { |
3305 | | __bs.resize(__to_nxt - &__bs[0]); |
3306 | | } else if (__r == codecvt_base::partial) { |
3307 | | ptrdiff_t __sp = __to_nxt - &__bs[0]; |
3308 | | __bs.resize(2 * __sp); |
3309 | | __to = &__bs[0] + __sp; |
3310 | | __to_end = &__bs[0] + __bs.size(); |
3311 | | } |
3312 | | } while (__r == codecvt_base::partial); |
3313 | | if (__r == codecvt_base::ok) |
3314 | | return __bs; |
3315 | | } |
3316 | | } |
3317 | | |
3318 | | if (__byte_err_string_.empty()) |
3319 | | __throw_range_error("wstring_convert: to_bytes error"); |
3320 | | |
3321 | | return __byte_err_string_; |
3322 | | } |
3323 | | |
3324 | | template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> > |
3325 | | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wbuffer_convert : public basic_streambuf<_Elem, _Tr> { |
3326 | | public: |
3327 | | // types: |
3328 | | typedef _Elem char_type; |
3329 | | typedef _Tr traits_type; |
3330 | | typedef typename traits_type::int_type int_type; |
3331 | | typedef typename traits_type::pos_type pos_type; |
3332 | | typedef typename traits_type::off_type off_type; |
3333 | | typedef typename _Codecvt::state_type state_type; |
3334 | | |
3335 | | private: |
3336 | | char* __extbuf_; |
3337 | | const char* __extbufnext_; |
3338 | | const char* __extbufend_; |
3339 | | char __extbuf_min_[8]; |
3340 | | size_t __ebs_; |
3341 | | char_type* __intbuf_; |
3342 | | size_t __ibs_; |
3343 | | streambuf* __bufptr_; |
3344 | | _Codecvt* __cv_; |
3345 | | state_type __st_; |
3346 | | ios_base::openmode __cm_; |
3347 | | bool __owns_eb_; |
3348 | | bool __owns_ib_; |
3349 | | bool __always_noconv_; |
3350 | | |
3351 | | wbuffer_convert(const wbuffer_convert&); |
3352 | | wbuffer_convert& operator=(const wbuffer_convert&); |
3353 | | |
3354 | | public: |
3355 | | #ifndef _LIBCPP_CXX03_LANG |
3356 | | _LIBCPP_HIDE_FROM_ABI wbuffer_convert() : wbuffer_convert(nullptr) {} |
3357 | | explicit _LIBCPP_HIDE_FROM_ABI |
3358 | | wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type()); |
3359 | | #else |
3360 | | _LIBCPP_EXPLICIT_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI |
3361 | | wbuffer_convert(streambuf* __bytebuf = nullptr, _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type()); |
3362 | | #endif |
3363 | | |
3364 | | _LIBCPP_HIDE_FROM_ABI ~wbuffer_convert(); |
3365 | | |
3366 | | _LIBCPP_HIDE_FROM_ABI streambuf* rdbuf() const { return __bufptr_; } |
3367 | | _LIBCPP_HIDE_FROM_ABI streambuf* rdbuf(streambuf* __bytebuf) { |
3368 | | streambuf* __r = __bufptr_; |
3369 | | __bufptr_ = __bytebuf; |
3370 | | return __r; |
3371 | | } |
3372 | | |
3373 | | _LIBCPP_HIDE_FROM_ABI state_type state() const { return __st_; } |
3374 | | |
3375 | | protected: |
3376 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type underflow(); |
3377 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type pbackfail(int_type __c = traits_type::eof()); |
3378 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type overflow(int_type __c = traits_type::eof()); |
3379 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual basic_streambuf<char_type, traits_type>* setbuf(char_type* __s, streamsize __n); |
3380 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual pos_type |
3381 | | seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __wch = ios_base::in | ios_base::out); |
3382 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual pos_type |
3383 | | seekpos(pos_type __sp, ios_base::openmode __wch = ios_base::in | ios_base::out); |
3384 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int sync(); |
3385 | | |
3386 | | private: |
3387 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL bool __read_mode(); |
3388 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __write_mode(); |
3389 | | _LIBCPP_HIDE_FROM_ABI_VIRTUAL wbuffer_convert* __close(); |
3390 | | }; |
3391 | | |
3392 | | _LIBCPP_SUPPRESS_DEPRECATED_PUSH |
3393 | | template <class _Codecvt, class _Elem, class _Tr> |
3394 | | wbuffer_convert<_Codecvt, _Elem, _Tr>::wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt, state_type __state) |
3395 | | : __extbuf_(nullptr), |
3396 | | __extbufnext_(nullptr), |
3397 | | __extbufend_(nullptr), |
3398 | | __ebs_(0), |
3399 | | __intbuf_(0), |
3400 | | __ibs_(0), |
3401 | | __bufptr_(__bytebuf), |
3402 | | __cv_(__pcvt), |
3403 | | __st_(__state), |
3404 | | __cm_(0), |
3405 | | __owns_eb_(false), |
3406 | | __owns_ib_(false), |
3407 | | __always_noconv_(__cv_ ? __cv_->always_noconv() : false) { |
3408 | | setbuf(0, 4096); |
3409 | | } |
3410 | | |
3411 | | template <class _Codecvt, class _Elem, class _Tr> |
3412 | | wbuffer_convert<_Codecvt, _Elem, _Tr>::~wbuffer_convert() { |
3413 | | __close(); |
3414 | | delete __cv_; |
3415 | | if (__owns_eb_) |
3416 | | delete[] __extbuf_; |
3417 | | if (__owns_ib_) |
3418 | | delete[] __intbuf_; |
3419 | | } |
3420 | | |
3421 | | template <class _Codecvt, class _Elem, class _Tr> |
3422 | | typename wbuffer_convert<_Codecvt, _Elem, _Tr>::int_type wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow() { |
3423 | | _LIBCPP_SUPPRESS_DEPRECATED_POP |
3424 | | if (__cv_ == 0 || __bufptr_ == nullptr) |
3425 | | return traits_type::eof(); |
3426 | | bool __initial = __read_mode(); |
3427 | | char_type __1buf; |
3428 | | if (this->gptr() == 0) |
3429 | | this->setg(&__1buf, &__1buf + 1, &__1buf + 1); |
3430 | | const size_t __unget_sz = __initial ? 0 : std::min<size_t>((this->egptr() - this->eback()) / 2, 4); |
3431 | | int_type __c = traits_type::eof(); |
3432 | | if (this->gptr() == this->egptr()) { |
3433 | | std::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type)); |
3434 | | if (__always_noconv_) { |
3435 | | streamsize __nmemb = static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz); |
3436 | | __nmemb = __bufptr_->sgetn((char*)this->eback() + __unget_sz, __nmemb); |
3437 | | if (__nmemb != 0) { |
3438 | | this->setg(this->eback(), this->eback() + __unget_sz, this->eback() + __unget_sz + __nmemb); |
3439 | | __c = *this->gptr(); |
3440 | | } |
3441 | | } else { |
3442 | | if (__extbufend_ != __extbufnext_) { |
3443 | | _LIBCPP_ASSERT_NON_NULL(__extbufnext_ != nullptr, "underflow moving from nullptr"); |
3444 | | _LIBCPP_ASSERT_NON_NULL(__extbuf_ != nullptr, "underflow moving into nullptr"); |
3445 | | std::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_); |
3446 | | } |
3447 | | __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_); |
3448 | | __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_); |
3449 | | streamsize __nmemb = std::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz), |
3450 | | static_cast<streamsize>(__extbufend_ - __extbufnext_)); |
3451 | | codecvt_base::result __r; |
3452 | | // FIXME: Do we ever need to restore the state here? |
3453 | | // state_type __svs = __st_; |
3454 | | streamsize __nr = __bufptr_->sgetn(const_cast<char*>(__extbufnext_), __nmemb); |
3455 | | if (__nr != 0) { |
3456 | | __extbufend_ = __extbufnext_ + __nr; |
3457 | | char_type* __inext; |
3458 | | __r = __cv_->in( |
3459 | | __st_, __extbuf_, __extbufend_, __extbufnext_, this->eback() + __unget_sz, this->egptr(), __inext); |
3460 | | if (__r == codecvt_base::noconv) { |
3461 | | this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, (char_type*)const_cast<char*>(__extbufend_)); |
3462 | | __c = *this->gptr(); |
3463 | | } else if (__inext != this->eback() + __unget_sz) { |
3464 | | this->setg(this->eback(), this->eback() + __unget_sz, __inext); |
3465 | | __c = *this->gptr(); |
3466 | | } |
3467 | | } |
3468 | | } |
3469 | | } else |
3470 | | __c = *this->gptr(); |
3471 | | if (this->eback() == &__1buf) |
3472 | | this->setg(0, 0, 0); |
3473 | | return __c; |
3474 | | } |
3475 | | |
3476 | | _LIBCPP_SUPPRESS_DEPRECATED_PUSH |
3477 | | template <class _Codecvt, class _Elem, class _Tr> |
3478 | | typename wbuffer_convert<_Codecvt, _Elem, _Tr>::int_type |
3479 | | wbuffer_convert<_Codecvt, _Elem, _Tr>::pbackfail(int_type __c) { |
3480 | | _LIBCPP_SUPPRESS_DEPRECATED_POP |
3481 | | if (__cv_ != 0 && __bufptr_ && this->eback() < this->gptr()) { |
3482 | | if (traits_type::eq_int_type(__c, traits_type::eof())) { |
3483 | | this->gbump(-1); |
3484 | | return traits_type::not_eof(__c); |
3485 | | } |
3486 | | if (traits_type::eq(traits_type::to_char_type(__c), this->gptr()[-1])) { |
3487 | | this->gbump(-1); |
3488 | | *this->gptr() = traits_type::to_char_type(__c); |
3489 | | return __c; |
3490 | | } |
3491 | | } |
3492 | | return traits_type::eof(); |
3493 | | } |
3494 | | |
3495 | | _LIBCPP_SUPPRESS_DEPRECATED_PUSH |
3496 | | template <class _Codecvt, class _Elem, class _Tr> |
3497 | | typename wbuffer_convert<_Codecvt, _Elem, _Tr>::int_type wbuffer_convert<_Codecvt, _Elem, _Tr>::overflow(int_type __c) { |
3498 | | _LIBCPP_SUPPRESS_DEPRECATED_POP |
3499 | | if (__cv_ == 0 || !__bufptr_) |
3500 | | return traits_type::eof(); |
3501 | | __write_mode(); |
3502 | | char_type __1buf; |
3503 | | char_type* __pb_save = this->pbase(); |
3504 | | char_type* __epb_save = this->epptr(); |
3505 | | if (!traits_type::eq_int_type(__c, traits_type::eof())) { |
3506 | | if (this->pptr() == 0) |
3507 | | this->setp(&__1buf, &__1buf + 1); |
3508 | | *this->pptr() = traits_type::to_char_type(__c); |
3509 | | this->pbump(1); |
3510 | | } |
3511 | | if (this->pptr() != this->pbase()) { |
3512 | | if (__always_noconv_) { |
3513 | | streamsize __nmemb = static_cast<streamsize>(this->pptr() - this->pbase()); |
3514 | | if (__bufptr_->sputn((const char*)this->pbase(), __nmemb) != __nmemb) |
3515 | | return traits_type::eof(); |
3516 | | } else { |
3517 | | char* __extbe = __extbuf_; |
3518 | | codecvt_base::result __r; |
3519 | | do { |
3520 | | const char_type* __e; |
3521 | | __r = __cv_->out(__st_, this->pbase(), this->pptr(), __e, __extbuf_, __extbuf_ + __ebs_, __extbe); |
3522 | | if (__e == this->pbase()) |
3523 | | return traits_type::eof(); |
3524 | | if (__r == codecvt_base::noconv) { |
3525 | | streamsize __nmemb = static_cast<size_t>(this->pptr() - this->pbase()); |
3526 | | if (__bufptr_->sputn((const char*)this->pbase(), __nmemb) != __nmemb) |
3527 | | return traits_type::eof(); |
3528 | | } else if (__r == codecvt_base::ok || __r == codecvt_base::partial) { |
3529 | | streamsize __nmemb = static_cast<size_t>(__extbe - __extbuf_); |
3530 | | if (__bufptr_->sputn(__extbuf_, __nmemb) != __nmemb) |
3531 | | return traits_type::eof(); |
3532 | | if (__r == codecvt_base::partial) { |
3533 | | this->setp(const_cast<char_type*>(__e), this->pptr()); |
3534 | | this->__pbump(this->epptr() - this->pbase()); |
3535 | | } |
3536 | | } else |
3537 | | return traits_type::eof(); |
3538 | | } while (__r == codecvt_base::partial); |
3539 | | } |
3540 | | this->setp(__pb_save, __epb_save); |
3541 | | } |
3542 | | return traits_type::not_eof(__c); |
3543 | | } |
3544 | | |
3545 | | _LIBCPP_SUPPRESS_DEPRECATED_PUSH |
3546 | | template <class _Codecvt, class _Elem, class _Tr> |
3547 | | basic_streambuf<_Elem, _Tr>* wbuffer_convert<_Codecvt, _Elem, _Tr>::setbuf(char_type* __s, streamsize __n) { |
3548 | | _LIBCPP_SUPPRESS_DEPRECATED_POP |
3549 | | this->setg(0, 0, 0); |
3550 | | this->setp(0, 0); |
3551 | | if (__owns_eb_) |
3552 | | delete[] __extbuf_; |
3553 | | if (__owns_ib_) |
3554 | | delete[] __intbuf_; |
3555 | | __ebs_ = __n; |
3556 | | if (__ebs_ > sizeof(__extbuf_min_)) { |
3557 | | if (__always_noconv_ && __s) { |
3558 | | __extbuf_ = (char*)__s; |
3559 | | __owns_eb_ = false; |
3560 | | } else { |
3561 | | __extbuf_ = new char[__ebs_]; |
3562 | | __owns_eb_ = true; |
3563 | | } |
3564 | | } else { |
3565 | | __extbuf_ = __extbuf_min_; |
3566 | | __ebs_ = sizeof(__extbuf_min_); |
3567 | | __owns_eb_ = false; |
3568 | | } |
3569 | | if (!__always_noconv_) { |
3570 | | __ibs_ = max<streamsize>(__n, sizeof(__extbuf_min_)); |
3571 | | if (__s && __ibs_ >= sizeof(__extbuf_min_)) { |
3572 | | __intbuf_ = __s; |
3573 | | __owns_ib_ = false; |
3574 | | } else { |
3575 | | __intbuf_ = new char_type[__ibs_]; |
3576 | | __owns_ib_ = true; |
3577 | | } |
3578 | | } else { |
3579 | | __ibs_ = 0; |
3580 | | __intbuf_ = 0; |
3581 | | __owns_ib_ = false; |
3582 | | } |
3583 | | return this; |
3584 | | } |
3585 | | |
3586 | | _LIBCPP_SUPPRESS_DEPRECATED_PUSH |
3587 | | template <class _Codecvt, class _Elem, class _Tr> |
3588 | | typename wbuffer_convert<_Codecvt, _Elem, _Tr>::pos_type |
3589 | | wbuffer_convert<_Codecvt, _Elem, _Tr>::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __om) { |
3590 | | int __width = __cv_->encoding(); |
3591 | | if (__cv_ == 0 || !__bufptr_ || (__width <= 0 && __off != 0) || sync()) |
3592 | | return pos_type(off_type(-1)); |
3593 | | // __width > 0 || __off == 0, now check __way |
3594 | | if (__way != ios_base::beg && __way != ios_base::cur && __way != ios_base::end) |
3595 | | return pos_type(off_type(-1)); |
3596 | | pos_type __r = __bufptr_->pubseekoff(__width * __off, __way, __om); |
3597 | | __r.state(__st_); |
3598 | | return __r; |
3599 | | } |
3600 | | |
3601 | | template <class _Codecvt, class _Elem, class _Tr> |
3602 | | typename wbuffer_convert<_Codecvt, _Elem, _Tr>::pos_type |
3603 | | wbuffer_convert<_Codecvt, _Elem, _Tr>::seekpos(pos_type __sp, ios_base::openmode __wch) { |
3604 | | if (__cv_ == 0 || !__bufptr_ || sync()) |
3605 | | return pos_type(off_type(-1)); |
3606 | | if (__bufptr_->pubseekpos(__sp, __wch) == pos_type(off_type(-1))) |
3607 | | return pos_type(off_type(-1)); |
3608 | | return __sp; |
3609 | | } |
3610 | | |
3611 | | template <class _Codecvt, class _Elem, class _Tr> |
3612 | | int wbuffer_convert<_Codecvt, _Elem, _Tr>::sync() { |
3613 | | _LIBCPP_SUPPRESS_DEPRECATED_POP |
3614 | | if (__cv_ == 0 || !__bufptr_) |
3615 | | return 0; |
3616 | | if (__cm_ & ios_base::out) { |
3617 | | if (this->pptr() != this->pbase()) |
3618 | | if (overflow() == traits_type::eof()) |
3619 | | return -1; |
3620 | | codecvt_base::result __r; |
3621 | | do { |
3622 | | char* __extbe; |
3623 | | __r = __cv_->unshift(__st_, __extbuf_, __extbuf_ + __ebs_, __extbe); |
3624 | | streamsize __nmemb = static_cast<streamsize>(__extbe - __extbuf_); |
3625 | | if (__bufptr_->sputn(__extbuf_, __nmemb) != __nmemb) |
3626 | | return -1; |
3627 | | } while (__r == codecvt_base::partial); |
3628 | | if (__r == codecvt_base::error) |
3629 | | return -1; |
3630 | | if (__bufptr_->pubsync()) |
3631 | | return -1; |
3632 | | } else if (__cm_ & ios_base::in) { |
3633 | | off_type __c; |
3634 | | if (__always_noconv_) |
3635 | | __c = this->egptr() - this->gptr(); |
3636 | | else { |
3637 | | int __width = __cv_->encoding(); |
3638 | | __c = __extbufend_ - __extbufnext_; |
3639 | | if (__width > 0) |
3640 | | __c += __width * (this->egptr() - this->gptr()); |
3641 | | else { |
3642 | | if (this->gptr() != this->egptr()) { |
3643 | | std::reverse(this->gptr(), this->egptr()); |
3644 | | codecvt_base::result __r; |
3645 | | const char_type* __e = this->gptr(); |
3646 | | char* __extbe; |
3647 | | do { |
3648 | | __r = __cv_->out(__st_, __e, this->egptr(), __e, __extbuf_, __extbuf_ + __ebs_, __extbe); |
3649 | | switch (__r) { |
3650 | | case codecvt_base::noconv: |
3651 | | __c += this->egptr() - this->gptr(); |
3652 | | break; |
3653 | | case codecvt_base::ok: |
3654 | | case codecvt_base::partial: |
3655 | | __c += __extbe - __extbuf_; |
3656 | | break; |
3657 | | default: |
3658 | | return -1; |
3659 | | } |
3660 | | } while (__r == codecvt_base::partial); |
3661 | | } |
3662 | | } |
3663 | | } |
3664 | | if (__bufptr_->pubseekoff(-__c, ios_base::cur, __cm_) == pos_type(off_type(-1))) |
3665 | | return -1; |
3666 | | this->setg(0, 0, 0); |
3667 | | __cm_ = 0; |
3668 | | } |
3669 | | return 0; |
3670 | | } |
3671 | | |
3672 | | _LIBCPP_SUPPRESS_DEPRECATED_PUSH |
3673 | | template <class _Codecvt, class _Elem, class _Tr> |
3674 | | bool wbuffer_convert<_Codecvt, _Elem, _Tr>::__read_mode() { |
3675 | | if (!(__cm_ & ios_base::in)) { |
3676 | | this->setp(0, 0); |
3677 | | if (__always_noconv_) |
3678 | | this->setg((char_type*)__extbuf_, (char_type*)__extbuf_ + __ebs_, (char_type*)__extbuf_ + __ebs_); |
3679 | | else |
3680 | | this->setg(__intbuf_, __intbuf_ + __ibs_, __intbuf_ + __ibs_); |
3681 | | __cm_ = ios_base::in; |
3682 | | return true; |
3683 | | } |
3684 | | return false; |
3685 | | } |
3686 | | |
3687 | | template <class _Codecvt, class _Elem, class _Tr> |
3688 | | void wbuffer_convert<_Codecvt, _Elem, _Tr>::__write_mode() { |
3689 | | if (!(__cm_ & ios_base::out)) { |
3690 | | this->setg(0, 0, 0); |
3691 | | if (__ebs_ > sizeof(__extbuf_min_)) { |
3692 | | if (__always_noconv_) |
3693 | | this->setp((char_type*)__extbuf_, (char_type*)__extbuf_ + (__ebs_ - 1)); |
3694 | | else |
3695 | | this->setp(__intbuf_, __intbuf_ + (__ibs_ - 1)); |
3696 | | } else |
3697 | | this->setp(0, 0); |
3698 | | __cm_ = ios_base::out; |
3699 | | } |
3700 | | } |
3701 | | |
3702 | | template <class _Codecvt, class _Elem, class _Tr> |
3703 | | wbuffer_convert<_Codecvt, _Elem, _Tr>* wbuffer_convert<_Codecvt, _Elem, _Tr>::__close() { |
3704 | | wbuffer_convert* __rt = nullptr; |
3705 | | if (__cv_ != nullptr && __bufptr_ != nullptr) { |
3706 | | __rt = this; |
3707 | | if ((__cm_ & ios_base::out) && sync()) |
3708 | | __rt = nullptr; |
3709 | | } |
3710 | | return __rt; |
3711 | | } |
3712 | | |
3713 | | _LIBCPP_SUPPRESS_DEPRECATED_POP |
3714 | | |
3715 | | _LIBCPP_END_NAMESPACE_STD |
3716 | | |
3717 | | _LIBCPP_POP_MACROS |
3718 | | |
3719 | | // NOLINTEND(libcpp-robust-against-adl) |
3720 | | |
3721 | | #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 |
3722 | | # include <atomic> |
3723 | | # include <concepts> |
3724 | | # include <cstdarg> |
3725 | | # include <iterator> |
3726 | | # include <mutex> |
3727 | | # include <stdexcept> |
3728 | | # include <type_traits> |
3729 | | # include <typeinfo> |
3730 | | #endif |
3731 | | |
3732 | | #endif // _LIBCPP_LOCALE |