~ubuntu-branches/ubuntu/vivid/emscripten/vivid-proposed

« back to all changes in this revision

Viewing changes to system/include/libcxx/codecvt

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
class codecvt_utf8
30
30
    : public codecvt<Elem, char, mbstate_t>
31
31
{
32
 
    // unspecified
 
32
    explicit codecvt_utf8(size_t refs = 0);
 
33
    ~codecvt_utf8();
33
34
};
34
35
 
35
36
template <class Elem, unsigned long Maxcode = 0x10ffff,
37
38
class codecvt_utf16
38
39
    : public codecvt<Elem, char, mbstate_t>
39
40
{
40
 
    // unspecified
 
41
    explicit codecvt_utf16(size_t refs = 0);
 
42
    ~codecvt_utf16();
41
43
};
42
44
 
43
45
template <class Elem, unsigned long Maxcode = 0x10ffff,
45
47
class codecvt_utf8_utf16
46
48
    : public codecvt<Elem, char, mbstate_t>
47
49
{
48
 
    // unspecified
 
50
    explicit codecvt_utf8_utf16(size_t refs = 0);
 
51
    ~codecvt_utf8_utf16();
49
52
};
50
53
 
51
54
}  // std
73
76
template <class _Elem> class __codecvt_utf8;
74
77
 
75
78
template <>
76
 
class __codecvt_utf8<wchar_t>
 
79
class _LIBCPP_TYPE_VIS __codecvt_utf8<wchar_t>
77
80
    : public codecvt<wchar_t, char, mbstate_t>
78
81
{
79
82
    unsigned long _Maxcode_;
108
111
};
109
112
 
110
113
template <>
111
 
class __codecvt_utf8<char16_t>
 
114
class _LIBCPP_TYPE_VIS __codecvt_utf8<char16_t>
112
115
    : public codecvt<char16_t, char, mbstate_t>
113
116
{
114
117
    unsigned long _Maxcode_;
143
146
};
144
147
 
145
148
template <>
146
 
class __codecvt_utf8<char32_t>
 
149
class _LIBCPP_TYPE_VIS __codecvt_utf8<char32_t>
147
150
    : public codecvt<char32_t, char, mbstate_t>
148
151
{
149
152
    unsigned long _Maxcode_;
179
182
 
180
183
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
181
184
          codecvt_mode _Mode = (codecvt_mode)0>
182
 
class _LIBCPP_TYPE_VIS codecvt_utf8
 
185
class _LIBCPP_TYPE_VIS_ONLY codecvt_utf8
183
186
    : public __codecvt_utf8<_Elem>
184
187
{
185
188
public:
196
199
template <class _Elem, bool _LittleEndian> class __codecvt_utf16;
197
200
 
198
201
template <>
199
 
class __codecvt_utf16<wchar_t, false>
200
 
    : public codecvt<wchar_t, char, mbstate_t>
201
 
{
202
 
    unsigned long _Maxcode_;
203
 
    codecvt_mode _Mode_;
204
 
public:
205
 
    typedef wchar_t   intern_type;
206
 
    typedef char      extern_type;
207
 
    typedef mbstate_t state_type;
208
 
 
209
 
    _LIBCPP_ALWAYS_INLINE
210
 
    explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode,
211
 
                            codecvt_mode _Mode)
212
 
        : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
213
 
          _Mode_(_Mode) {}
214
 
protected:
215
 
    virtual result
216
 
        do_out(state_type& __st,
217
 
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
218
 
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
219
 
    virtual result
220
 
        do_in(state_type& __st,
221
 
              const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
222
 
              intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
223
 
    virtual result
224
 
        do_unshift(state_type& __st,
225
 
                   extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
226
 
    virtual int do_encoding() const throw();
227
 
    virtual bool do_always_noconv() const throw();
228
 
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
229
 
                          size_t __mx) const;
230
 
    virtual int do_max_length() const throw();
231
 
};
232
 
 
233
 
template <>
234
 
class __codecvt_utf16<wchar_t, true>
235
 
    : public codecvt<wchar_t, char, mbstate_t>
236
 
{
237
 
    unsigned long _Maxcode_;
238
 
    codecvt_mode _Mode_;
239
 
public:
240
 
    typedef wchar_t   intern_type;
241
 
    typedef char      extern_type;
242
 
    typedef mbstate_t state_type;
243
 
 
244
 
    _LIBCPP_ALWAYS_INLINE
245
 
    explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode,
246
 
                            codecvt_mode _Mode)
247
 
        : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
248
 
          _Mode_(_Mode) {}
249
 
protected:
250
 
    virtual result
251
 
        do_out(state_type& __st,
252
 
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
253
 
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
254
 
    virtual result
255
 
        do_in(state_type& __st,
256
 
              const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
257
 
              intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
258
 
    virtual result
259
 
        do_unshift(state_type& __st,
260
 
                   extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
261
 
    virtual int do_encoding() const throw();
262
 
    virtual bool do_always_noconv() const throw();
263
 
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
264
 
                          size_t __mx) const;
265
 
    virtual int do_max_length() const throw();
266
 
};
267
 
 
268
 
template <>
269
 
class __codecvt_utf16<char16_t, false>
270
 
    : public codecvt<char16_t, char, mbstate_t>
271
 
{
272
 
    unsigned long _Maxcode_;
273
 
    codecvt_mode _Mode_;
274
 
public:
275
 
    typedef char16_t  intern_type;
276
 
    typedef char      extern_type;
277
 
    typedef mbstate_t state_type;
278
 
 
279
 
    _LIBCPP_ALWAYS_INLINE
280
 
    explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode,
281
 
                            codecvt_mode _Mode)
282
 
        : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
283
 
          _Mode_(_Mode) {}
284
 
protected:
285
 
    virtual result
286
 
        do_out(state_type& __st,
287
 
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
288
 
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
289
 
    virtual result
290
 
        do_in(state_type& __st,
291
 
              const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
292
 
              intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
293
 
    virtual result
294
 
        do_unshift(state_type& __st,
295
 
                   extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
296
 
    virtual int do_encoding() const throw();
297
 
    virtual bool do_always_noconv() const throw();
298
 
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
299
 
                          size_t __mx) const;
300
 
    virtual int do_max_length() const throw();
301
 
};
302
 
 
303
 
template <>
304
 
class __codecvt_utf16<char16_t, true>
305
 
    : public codecvt<char16_t, char, mbstate_t>
306
 
{
307
 
    unsigned long _Maxcode_;
308
 
    codecvt_mode _Mode_;
309
 
public:
310
 
    typedef char16_t  intern_type;
311
 
    typedef char      extern_type;
312
 
    typedef mbstate_t state_type;
313
 
 
314
 
    _LIBCPP_ALWAYS_INLINE
315
 
    explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode,
316
 
                            codecvt_mode _Mode)
317
 
        : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
318
 
          _Mode_(_Mode) {}
319
 
protected:
320
 
    virtual result
321
 
        do_out(state_type& __st,
322
 
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
323
 
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
324
 
    virtual result
325
 
        do_in(state_type& __st,
326
 
              const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
327
 
              intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
328
 
    virtual result
329
 
        do_unshift(state_type& __st,
330
 
                   extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
331
 
    virtual int do_encoding() const throw();
332
 
    virtual bool do_always_noconv() const throw();
333
 
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
334
 
                          size_t __mx) const;
335
 
    virtual int do_max_length() const throw();
336
 
};
337
 
 
338
 
template <>
339
 
class __codecvt_utf16<char32_t, false>
 
202
class _LIBCPP_TYPE_VIS __codecvt_utf16<wchar_t, false>
 
203
    : public codecvt<wchar_t, char, mbstate_t>
 
204
{
 
205
    unsigned long _Maxcode_;
 
206
    codecvt_mode _Mode_;
 
207
public:
 
208
    typedef wchar_t   intern_type;
 
209
    typedef char      extern_type;
 
210
    typedef mbstate_t state_type;
 
211
 
 
212
    _LIBCPP_ALWAYS_INLINE
 
213
    explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode,
 
214
                            codecvt_mode _Mode)
 
215
        : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
 
216
          _Mode_(_Mode) {}
 
217
protected:
 
218
    virtual result
 
219
        do_out(state_type& __st,
 
220
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
 
221
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
 
222
    virtual result
 
223
        do_in(state_type& __st,
 
224
              const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
 
225
              intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
 
226
    virtual result
 
227
        do_unshift(state_type& __st,
 
228
                   extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
 
229
    virtual int do_encoding() const throw();
 
230
    virtual bool do_always_noconv() const throw();
 
231
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
 
232
                          size_t __mx) const;
 
233
    virtual int do_max_length() const throw();
 
234
};
 
235
 
 
236
template <>
 
237
class _LIBCPP_TYPE_VIS __codecvt_utf16<wchar_t, true>
 
238
    : public codecvt<wchar_t, char, mbstate_t>
 
239
{
 
240
    unsigned long _Maxcode_;
 
241
    codecvt_mode _Mode_;
 
242
public:
 
243
    typedef wchar_t   intern_type;
 
244
    typedef char      extern_type;
 
245
    typedef mbstate_t state_type;
 
246
 
 
247
    _LIBCPP_ALWAYS_INLINE
 
248
    explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode,
 
249
                            codecvt_mode _Mode)
 
250
        : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
 
251
          _Mode_(_Mode) {}
 
252
protected:
 
253
    virtual result
 
254
        do_out(state_type& __st,
 
255
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
 
256
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
 
257
    virtual result
 
258
        do_in(state_type& __st,
 
259
              const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
 
260
              intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
 
261
    virtual result
 
262
        do_unshift(state_type& __st,
 
263
                   extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
 
264
    virtual int do_encoding() const throw();
 
265
    virtual bool do_always_noconv() const throw();
 
266
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
 
267
                          size_t __mx) const;
 
268
    virtual int do_max_length() const throw();
 
269
};
 
270
 
 
271
template <>
 
272
class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, false>
 
273
    : public codecvt<char16_t, char, mbstate_t>
 
274
{
 
275
    unsigned long _Maxcode_;
 
276
    codecvt_mode _Mode_;
 
277
public:
 
278
    typedef char16_t  intern_type;
 
279
    typedef char      extern_type;
 
280
    typedef mbstate_t state_type;
 
281
 
 
282
    _LIBCPP_ALWAYS_INLINE
 
283
    explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode,
 
284
                            codecvt_mode _Mode)
 
285
        : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
 
286
          _Mode_(_Mode) {}
 
287
protected:
 
288
    virtual result
 
289
        do_out(state_type& __st,
 
290
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
 
291
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
 
292
    virtual result
 
293
        do_in(state_type& __st,
 
294
              const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
 
295
              intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
 
296
    virtual result
 
297
        do_unshift(state_type& __st,
 
298
                   extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
 
299
    virtual int do_encoding() const throw();
 
300
    virtual bool do_always_noconv() const throw();
 
301
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
 
302
                          size_t __mx) const;
 
303
    virtual int do_max_length() const throw();
 
304
};
 
305
 
 
306
template <>
 
307
class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, true>
 
308
    : public codecvt<char16_t, char, mbstate_t>
 
309
{
 
310
    unsigned long _Maxcode_;
 
311
    codecvt_mode _Mode_;
 
312
public:
 
313
    typedef char16_t  intern_type;
 
314
    typedef char      extern_type;
 
315
    typedef mbstate_t state_type;
 
316
 
 
317
    _LIBCPP_ALWAYS_INLINE
 
318
    explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode,
 
319
                            codecvt_mode _Mode)
 
320
        : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
 
321
          _Mode_(_Mode) {}
 
322
protected:
 
323
    virtual result
 
324
        do_out(state_type& __st,
 
325
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
 
326
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
 
327
    virtual result
 
328
        do_in(state_type& __st,
 
329
              const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
 
330
              intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
 
331
    virtual result
 
332
        do_unshift(state_type& __st,
 
333
                   extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
 
334
    virtual int do_encoding() const throw();
 
335
    virtual bool do_always_noconv() const throw();
 
336
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end,
 
337
                          size_t __mx) const;
 
338
    virtual int do_max_length() const throw();
 
339
};
 
340
 
 
341
template <>
 
342
class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, false>
340
343
    : public codecvt<char32_t, char, mbstate_t>
341
344
{
342
345
    unsigned long _Maxcode_;
371
374
};
372
375
 
373
376
template <>
374
 
class __codecvt_utf16<char32_t, true>
 
377
class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, true>
375
378
    : public codecvt<char32_t, char, mbstate_t>
376
379
{
377
380
    unsigned long _Maxcode_;
407
410
 
408
411
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
409
412
          codecvt_mode _Mode = (codecvt_mode)0>
410
 
class _LIBCPP_TYPE_VIS codecvt_utf16
 
413
class _LIBCPP_TYPE_VIS_ONLY codecvt_utf16
411
414
    : public __codecvt_utf16<_Elem, _Mode & little_endian>
412
415
{
413
416
public:
424
427
template <class _Elem> class __codecvt_utf8_utf16;
425
428
 
426
429
template <>
427
 
class __codecvt_utf8_utf16<wchar_t>
 
430
class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<wchar_t>
428
431
    : public codecvt<wchar_t, char, mbstate_t>
429
432
{
430
433
    unsigned long _Maxcode_;
459
462
};
460
463
 
461
464
template <>
462
 
class __codecvt_utf8_utf16<char32_t>
 
465
class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char32_t>
463
466
    : public codecvt<char32_t, char, mbstate_t>
464
467
{
465
468
    unsigned long _Maxcode_;
494
497
};
495
498
 
496
499
template <>
497
 
class __codecvt_utf8_utf16<char16_t>
 
500
class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char16_t>
498
501
    : public codecvt<char16_t, char, mbstate_t>
499
502
{
500
503
    unsigned long _Maxcode_;
530
533
 
531
534
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
532
535
          codecvt_mode _Mode = (codecvt_mode)0>
533
 
class _LIBCPP_TYPE_VIS codecvt_utf8_utf16
 
536
class _LIBCPP_TYPE_VIS_ONLY codecvt_utf8_utf16
534
537
    : public __codecvt_utf8_utf16<_Elem>
535
538
{
536
539
public: