Coverage Report

Created: 2020-02-15 09:57

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