ReactOS 0.4.15-dev-7934-g1dc8d80
codecvt_byname< wchar_t, char, mbstate_t > Class Reference

#include <_codecvt.h>

Inheritance diagram for codecvt_byname< wchar_t, char, mbstate_t >:
Collaboration diagram for codecvt_byname< wchar_t, char, mbstate_t >:

Public Member Functions

 codecvt_byname (const char *__name, size_t __refs=0)
 
- Public Member Functions inherited from codecvt< wchar_t, char, mbstate_t >
 codecvt (size_t __refs=0)
 
result out (state_type &__state, const wchar_t *__from, const wchar_t *__from_end, const wchar_t *&__from_next, char *__to, char *__to_limit, char *&__to_next) const
 
result unshift (state_type &__state, char *__to, char *__to_limit, char *&__to_next) const
 
result in (state_type &__state, const char *__from, const char *__from_end, const char *&__from_next, wchar_t *__to, wchar_t *__to_limit, wchar_t *&__to_next) const
 
int encoding () const _STLP_NOTHROW
 
bool always_noconv () const _STLP_NOTHROW
 
int length (state_type &__state, const char *__from, const char *__from_end, size_t __max) const
 
int max_length () const _STLP_NOTHROW
 

Protected Member Functions

 ~codecvt_byname ()
 
virtual result do_out (state_type &__state, const wchar_t *__from, const wchar_t *__from_end, const wchar_t *&__from_next, char *__to, char *__to_limit, char *&__to_next) const
 
virtual result do_in (state_type &__state, const char *__from, const char *__from_end, const char *&__from_next, wchar_t *__to, wchar_t *__to_limit, wchar_t *&__to_next) const
 
virtual result do_unshift (state_type &__state, char *__to, char *__to_limit, char *&__to_next) const
 
virtual int do_encoding () const _STLP_NOTHROW
 
virtual bool do_always_noconv () const _STLP_NOTHROW
 
virtual int do_length (state_type &__state, const char *__from, const char *__end, size_t __max) const
 
virtual int do_max_length () const _STLP_NOTHROW
 
- Protected Member Functions inherited from codecvt< wchar_t, char, mbstate_t >
 ~codecvt ()
 
virtual result do_out (state_type &__state, const wchar_t *__from, const wchar_t *__from_end, const wchar_t *&__from_next, char *__to, char *__to_limit, char *&__to_next) const
 
virtual result do_in (state_type &__state, const char *__from, const char *__from_end, const char *&__from_next, wchar_t *__to, wchar_t *__to_limit, wchar_t *&__to_next) const
 
virtual result do_unshift (state_type &__state, char *__to, char *__to_limit, char *&__to_next) const
 
virtual int do_encoding () const _STLP_NOTHROW
 
virtual bool do_always_noconv () const _STLP_NOTHROW
 
virtual int do_length (state_type &__state, const char *__from, const char *__end, size_t __max) const
 
virtual int do_max_length () const _STLP_NOTHROW
 
- Protected Member Functions inherited from locale::facet
 facet (size_t __init_count=0)
 
virtual ~facet ()
 
- Protected Member Functions inherited from _Refcount_Base
 _Refcount_Base (__stl_atomic_t __n)
 
__stl_atomic_t _M_incr ()
 
__stl_atomic_t _M_decr ()
 

Private Member Functions

 codecvt_byname (_Locale_codecvt *__cvt)
 
 codecvt_byname (const codecvt_byname< wchar_t, char, mbstate_t > &)
 
codecvt_byname< wchar_t, char, mbstate_t > & operator= (const codecvt_byname< wchar_t, char, mbstate_t > &)
 

Private Attributes

_Locale_codecvt_M_codecvt
 

Friends

class _Locale_impl
 

Additional Inherited Members

- Public Types inherited from codecvt< wchar_t, char, mbstate_t >
typedef wchar_t intern_type
 
typedef char extern_type
 
typedef mbstate_t state_type
 
- Public Types inherited from codecvt_base
enum  result { ok , partial , error , noconv }
 
- Static Public Attributes inherited from codecvt< wchar_t, char, mbstate_t >
static _STLP_STATIC_DECLSPEC locale::id id = { 16 }
 

Detailed Description

Definition at line 383 of file _codecvt.h.

Constructor & Destructor Documentation

◆ codecvt_byname() [1/3]

codecvt_byname< wchar_t, char, mbstate_t >::codecvt_byname ( const char __name,
size_t  __refs = 0 
)
explicit

Definition at line 290 of file facets_byname.cpp.

292 if (!name)
294
295 int __err_code;
297 _M_codecvt = _STLP_PRIV __acquire_codecvt(name, buf, 0, &__err_code);
298 if (!_M_codecvt)
299 locale::_M_throw_on_creation_failure(__err_code, name, "ctype");
300}
#define _STLP_PRIV
Definition: _dm.h:70
_Locale_codecvt *_STLP_CALL __acquire_codecvt(const char *&name, char *buf, _Locale_name_hint *hint, int *__err_code)
static void _STLP_FUNCTION_THROWS _STLP_CALL _M_throw_on_null_name()
Definition: locale.cpp:57
static void _STLP_FUNCTION_THROWS _STLP_CALL _M_throw_on_creation_failure(int __err_code, const char *name, const char *facet)
Definition: locale.cpp:68
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define _Locale_MAX_SIMPLE_NAME
Definition: c_locale.h:54
Definition: name.c:39

◆ ~codecvt_byname()

Definition at line 302 of file facets_byname.cpp.

void _STLP_CALL __release_codecvt(_Locale_codecvt *cat)

◆ codecvt_byname() [2/3]

Definition at line 425 of file _codecvt.h.

426 : _M_codecvt(__cvt) {}

◆ codecvt_byname() [3/3]

Member Function Documentation

◆ do_always_noconv()

bool codecvt_byname< wchar_t, char, mbstate_t >::do_always_noconv ( ) const
protectedvirtual

Reimplemented from codecvt< wchar_t, char, mbstate_t >.

Definition at line 402 of file facets_byname.cpp.

403{ return false; }

◆ do_encoding()

int codecvt_byname< wchar_t, char, mbstate_t >::do_encoding ( ) const
protectedvirtual

Reimplemented from codecvt< wchar_t, char, mbstate_t >.

Definition at line 391 of file facets_byname.cpp.

391 {
393 int max_width = _WLocale_mb_cur_max(_M_codecvt);
394 int min_width = _WLocale_mb_cur_min(_M_codecvt);
395 return min_width == max_width ? min_width : 0;
396 }
397 else
398 return -1;
399}
int _WLocale_mb_cur_max(struct _Locale_codecvt *)
int _WLocale_is_stateless(struct _Locale_codecvt *)
int _WLocale_mb_cur_min(struct _Locale_codecvt *)

◆ do_in()

codecvt< wchar_t, char, mbstate_t >::result codecvt_byname< wchar_t, char, mbstate_t >::do_in ( state_type __state,
const char __from,
const char __from_end,
const char *&  __from_next,
wchar_t __to,
wchar_t __to_limit,
wchar_t *&  __to_next 
) const
protectedvirtual

Reimplemented from codecvt< wchar_t, char, mbstate_t >.

Definition at line 338 of file facets_byname.cpp.

344 {
345 while (from != from_end && to != to_end) {
346 size_t chars_read = _WLocale_mbtowc(_M_codecvt,
347 to, from, from_end - from,
348 &state);
349 if (chars_read == (size_t) -1) {
350 from_next = from;
351 to_next = to;
352 return error;
353 }
354
355 if (chars_read == (size_t) -2) {
356 from_next = from;
357 to_next = to;
358 return partial;
359 }
360
361 from += chars_read;
362 to++;
363 }
364
365 from_next = from;
366 to_next = to;
367 return ok;
368}
static int state
Definition: maze.c:121
size_t _WLocale_mbtowc(struct _Locale_codecvt *, wchar_t *, const char *, size_t, mbstate_t *)
CardRegion * from
Definition: spigame.cpp:19

◆ do_length()

int codecvt_byname< wchar_t, char, mbstate_t >::do_length ( state_type __state,
const char __from,
const char __end,
size_t  __max 
) const
protectedvirtual

Reimplemented from codecvt< wchar_t, char, mbstate_t >.

Definition at line 406 of file facets_byname.cpp.

409 {
410 size_t __count = 0;
411 while (from != end && mx--) {
412 intern_type __dummy;
413 size_t chars_read = _WLocale_mbtowc(_M_codecvt,
414 &__dummy, from, end - from,
415 &state);
416 if ((chars_read == (size_t) -1) || (chars_read == (size_t) -2)) // error or partial
417 break;
418 __count += chars_read;
419 from += chars_read;
420 }
421 return int(__count);
422}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
GLuint GLuint end
Definition: gl.h:1545

◆ do_max_length()

int codecvt_byname< wchar_t, char, mbstate_t >::do_max_length ( ) const
protectedvirtual

Reimplemented from codecvt< wchar_t, char, mbstate_t >.

Definition at line 425 of file facets_byname.cpp.

◆ do_out()

codecvt< wchar_t, char, mbstate_t >::result codecvt_byname< wchar_t, char, mbstate_t >::do_out ( state_type __state,
const wchar_t __from,
const wchar_t __from_end,
const wchar_t *&  __from_next,
char __to,
char __to_limit,
char *&  __to_next 
) const
protectedvirtual

Reimplemented from codecvt< wchar_t, char, mbstate_t >.

Definition at line 306 of file facets_byname.cpp.

312 {
313 while (from != from_end && to != to_limit) {
314 size_t chars_stored = _WLocale_wctomb(_M_codecvt,
315 to, to_limit - to, *from,
316 &state);
317 if (chars_stored == (size_t) -1) {
318 from_next = from;
319 to_next = to;
320 return error;
321 }
322 else if (chars_stored == (size_t) -2) {
323 from_next = from;
324 to_next = to;
325 return partial;
326 }
327
328 ++from;
329 to += chars_stored;
330 }
331
332 from_next = from;
333 to_next = to;
334 return ok;
335}
size_t _WLocale_wctomb(struct _Locale_codecvt *, char *, size_t, const wchar_t, mbstate_t *)

◆ do_unshift()

codecvt< wchar_t, char, mbstate_t >::result codecvt_byname< wchar_t, char, mbstate_t >::do_unshift ( state_type __state,
char __to,
char __to_limit,
char *&  __to_next 
) const
protectedvirtual

Reimplemented from codecvt< wchar_t, char, mbstate_t >.

Definition at line 371 of file facets_byname.cpp.

374 {
375 to_next = to;
377 to, to_limit - to, &to_next);
378 if (result == (size_t) -1)
379 return error;
380 else if (result == (size_t) -2)
381 return partial;
382 else
383# if defined (__ISCPP__)
384 return /*to_next == to ? noconv :*/ ok;
385# else
386 return to_next == to ? noconv : ok;
387# endif
388}
GLuint64EXT * result
Definition: glext.h:11304
size_t _WLocale_unshift(struct _Locale_codecvt *, mbstate_t *, char *, size_t, char **)

◆ operator=()

Friends And Related Function Documentation

◆ _Locale_impl

friend class _Locale_impl
friend

Definition at line 385 of file _codecvt.h.

Member Data Documentation

◆ _M_codecvt

Definition at line 430 of file _codecvt.h.


The documentation for this class was generated from the following files: