ReactOS 0.4.15-dev-5664-g3bf4ef6
codecvt.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 1999
3 * Silicon Graphics Computer Systems, Inc.
4 *
5 * Copyright (c) 1999
6 * Boris Fomitchev
7 *
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
10 *
11 * Permission to use or copy this software for any purpose is hereby granted
12 * without fee, provided the above notices are retained on all copies.
13 * Permission to modify the code and to distribute modified code is granted,
14 * provided the above notices are retained, and a notice that the code was
15 * modified is included with the above copyright notice.
16 *
17 */
18#include "stlport_prefix.h"
19
20#include <locale>
21#include <algorithm>
22
24
25//----------------------------------------------------------------------
26// codecvt<char, char, mbstate_t>
27
29
31 const char* from,
32 const char* end,
33 size_t mx) const
34{ return (int)(min) ( __STATIC_CAST(size_t, (end - from)), mx); }
35
37{ return 1; }
38
39bool
41{ return true; }
42
43int
45{ return 1; }
46
49 char* __to,
50 char* /* __to_limit */,
51 char*& __to_next) const
52{ __to_next = __to; return noconv; }
53
56 const char* __from,
57 const char* /* __from_end */,
58 const char*& __from_next,
59 char* __to,
60 char* /* __to_end */,
61 char*& __to_next) const
62{ __from_next = __from; __to_next = __to; return noconv; }
63
66 const char* __from,
67 const char* /* __from_end */,
68 const char*& __from_next,
69 char* __to,
70 char* /* __to_limit */,
71 char*& __to_next) const
72{ __from_next = __from; __to_next = __to; return noconv; }
73
74
75#if !defined (_STLP_NO_WCHAR_T)
76//----------------------------------------------------------------------
77// codecvt<wchar_t, char, mbstate_t>
78
80
81
84 const intern_type* from,
85 const intern_type* from_end,
86 const intern_type*& from_next,
87 extern_type* to,
88 extern_type* to_limit,
89 extern_type*& to_next) const {
90 ptrdiff_t len = (min) (from_end - from, to_limit - to);
91 copy(from, from + len, to);
92 from_next = from + len;
93 to_next = to + len;
94 return ok;
95}
96
99 const extern_type* from,
100 const extern_type* from_end,
101 const extern_type*& from_next,
102 intern_type* to,
103 intern_type* to_limit,
104 intern_type*& to_next) const {
105 ptrdiff_t len = (min) (from_end - from, to_limit - to);
106 copy(__REINTERPRET_CAST(const unsigned char*, from),
107 __REINTERPRET_CAST(const unsigned char*, from) + len, to);
108 from_next = from + len;
109 to_next = to + len;
110 return ok;
111}
112
115 extern_type* to,
116 extern_type* ,
117 extern_type*& to_next) const {
118 to_next = to;
119 return noconv;
120}
121
123{ return 1; }
124
126{ return true; }
127
129 const extern_type* from,
130 const extern_type* end,
131 size_t mx) const
132{ return (int)(min) ((size_t) (end - from), mx); }
133
135{ return 1; }
136#endif /* wchar_t */
137
139
140// Local Variables:
141// mode:C++
142// End:
143
#define _STLP_NOTHROW
Definition: _intel.h:35
#define ok(value,...)
Definition: atltest.h:57
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
virtual int do_max_length() const _STLP_NOTHROW
Definition: _codecvt.h:153
virtual bool do_always_noconv() const _STLP_NOTHROW
Definition: _codecvt.h:144
virtual result do_unshift(state_type &, extern_type *__to, extern_type *, extern_type *&__to_next) const
Definition: _codecvt.h:135
~codecvt()
Definition: _codecvt.h:115
virtual int do_encoding() const _STLP_NOTHROW
Definition: _codecvt.h:141
virtual result do_in(state_type &, const extern_type *__from, const extern_type *, const extern_type *&__from_next, intern_type *__to, intern_type *, intern_type *&__to_next) const
Definition: _codecvt.h:126
virtual result do_out(state_type &, const intern_type *__from, const intern_type *, const intern_type *&__from_next, extern_type *__to, extern_type *, extern_type *&__to_next) const
Definition: _codecvt.h:117
virtual int do_length(state_type &, const extern_type *__from, const extern_type *__end, size_t __max) const
Definition: _codecvt.h:147
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
#define __REINTERPRET_CAST(__x, __y)
Definition: features.h:586
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
#define _STLP_END_NAMESPACE
Definition: features.h:503
GLuint GLuint end
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
#define min(a, b)
Definition: monoChain.cc:55
CardRegion * from
Definition: spigame.cpp:19
#define const
Definition: zconf.h:233