Update contrib.
2 * Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
5 * Silicon Graphics Computer Systems, Inc.
10 * This material is provided "as is", with absolutely no warranty expressed
11 * or implied. Any use is at your own risk.
13 * Permission to use or copy this software for any purpose is hereby granted
14 * without fee, provided the above notices are retained on all copies.
15 * Permission to modify the code and to distribute modified code is granted,
16 * provided the above notices are retained, and a notice that the code was
17 * modified is included with the above copyright notice.
20 #include "stlport_prefix.h"
22 #ifndef _STLP_NO_MBSTATE_T
29 //----------------------------------------------------------------------
30 // codecvt<char, char, mbstate_t>
32 _STLP_DECLSPEC codecvt<char, char, mbstate_t>::~codecvt() {}
34 _STLP_DECLSPEC int codecvt<char, char, mbstate_t>::do_length(const mbstate_t&,
38 { return (int)(min) ( __STATIC_CAST(size_t, (end - from)), mx); }
40 _STLP_DECLSPEC int codecvt<char, char, mbstate_t>::do_max_length() const _STLP_NOTHROW
44 codecvt<char, char, mbstate_t>::do_always_noconv() const _STLP_NOTHROW
48 codecvt<char, char, mbstate_t>::do_encoding() const _STLP_NOTHROW
51 _STLP_DECLSPEC codecvt_base::result
52 codecvt<char, char, mbstate_t>::do_unshift(mbstate_t& /* __state */,
54 char* /* __to_limit */,
55 char*& __to_next) const
56 { __to_next = __to; return noconv; }
58 _STLP_DECLSPEC codecvt_base::result
59 codecvt<char, char, mbstate_t>::do_in (mbstate_t& /* __state */ ,
61 const char* /* __from_end */,
62 const char*& __from_next,
65 char*& __to_next) const
66 { __from_next = __from; __to_next = __to; return noconv; }
68 _STLP_DECLSPEC codecvt_base::result
69 codecvt<char, char, mbstate_t>::do_out(mbstate_t& /* __state */,
71 const char* /* __from_end */,
72 const char*& __from_next,
74 char* /* __to_limit */,
75 char*& __to_next) const
76 { __from_next = __from; __to_next = __to; return noconv; }
79 #if !defined (_STLP_NO_WCHAR_T)
80 //----------------------------------------------------------------------
81 // codecvt<wchar_t, char, mbstate_t>
83 _STLP_DECLSPEC codecvt<wchar_t, char, mbstate_t>::~codecvt() {}
86 _STLP_DECLSPEC codecvt<wchar_t, char, mbstate_t>::result
87 codecvt<wchar_t, char, mbstate_t>::do_out(state_type& /* state */,
88 const intern_type* from,
89 const intern_type* from_end,
90 const intern_type*& from_next,
92 extern_type* to_limit,
93 extern_type*& to_next) const {
94 ptrdiff_t len = (min) (from_end - from, to_limit - to);
95 copy(from, from + len, to);
96 from_next = from + len;
101 _STLP_DECLSPEC codecvt<wchar_t, char, mbstate_t>::result
102 codecvt<wchar_t, char, mbstate_t>::do_in (state_type& /* state */,
103 const extern_type* from,
104 const extern_type* from_end,
105 const extern_type*& from_next,
107 intern_type* to_limit,
108 intern_type*& to_next) const {
109 ptrdiff_t len = (min) (from_end - from, to_limit - to);
110 copy(__REINTERPRET_CAST(const unsigned char*, from),
111 __REINTERPRET_CAST(const unsigned char*, from) + len, to);
112 from_next = from + len;
117 _STLP_DECLSPEC codecvt<wchar_t, char, mbstate_t>::result
118 codecvt<wchar_t, char, mbstate_t>::do_unshift(state_type& /* state */,
121 extern_type*& to_next) const {
126 _STLP_DECLSPEC int codecvt<wchar_t, char, mbstate_t>::do_encoding() const _STLP_NOTHROW
127 #ifdef SYMBIAN_OE_ENHANCED_LOCALE_SUPPORT
138 _STLP_DECLSPEC bool codecvt<wchar_t, char, mbstate_t>::do_always_noconv() const _STLP_NOTHROW
141 _STLP_DECLSPEC int codecvt<wchar_t, char, mbstate_t>::do_length(const state_type&,
142 const extern_type* from,
143 const extern_type* end,
145 { return (int)(min) ((size_t) (end - from), mx); }
147 _STLP_DECLSPEC int codecvt<wchar_t, char, mbstate_t>::do_max_length() const _STLP_NOTHROW
153 #endif /* _STLP_NO_MBSTATE_T */