Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
_ctype.cc
Go to the documentation of this file.
1
31
32
33#ifndef _RWSTD_NO_EXT_CTYPE_PRIMARY
34
35template <class _CharT>
36_RW::__rw_facet_id ctype<_CharT>::id;
37
38
39template <class _CharT>
40/* virtual */ const typename ctype<_CharT>::char_type*
41ctype<_CharT>::
42do_is (const char_type *__lo, const char_type *__hi, mask *__m) const
43{
44 _RWSTD_ASSERT (__lo <= __hi);
45 _RWSTD_ASSERT (!__lo || __m);
46
47 for (; __lo < __hi; ++__lo, ++__m)
48 *__m = mask ();
49
50 return __hi;
51}
52
53
54template <class _CharT>
55/* virtual */ const typename ctype<_CharT>::char_type*
56ctype<_CharT>::
57do_scan_is (mask __m, const char_type *__lo, const char_type *__hi) const
58{
59 _RWSTD_ASSERT (__lo <= __hi);
60
61 for (; __lo < __hi; ++__lo) {
62 if (is (__m, *__lo))
63 return __lo;
64 }
65
66 return __hi;
67}
68
69
70template <class _CharT>
71/* virtual */ const typename ctype<_CharT>::char_type*
72ctype<_CharT>::
73do_scan_not (mask __m, const char_type *__lo, const char_type *__hi) const
74{
75 _RWSTD_ASSERT (__lo <= __hi);
76
77 for (; __lo < __hi; ++__lo) {
78 if (!is (__m, *__lo))
79 return __lo;
80 }
81
82 return __hi;
83}
84
85
86template <class _CharT>
87/* virtual */ const typename ctype<_CharT>::char_type*
88ctype<_CharT>::
89do_toupper (char_type *__lo, const char_type *__hi) const
90{
91 _RWSTD_ASSERT (__lo <= __hi);
92
93 for (; __lo < __hi; ++__lo) {
94 *__lo = (toupper)(*__lo);
95 }
96
97 return __hi;
98}
99
100
101template <class _CharT>
102/* virtual */ const typename ctype<_CharT>::char_type*
103ctype<_CharT>::
104do_tolower (char_type *__lo, const char_type *__hi) const
105{
106 _RWSTD_ASSERT (__lo <= __hi);
107
108 for (; __lo < __hi; ++__lo) {
109 *__lo = (tolower)(*__lo);
110 }
111
112 return __hi;
113}
114
115
116template <class _CharT>
117/* virtual */ const char*
118ctype<_CharT>::
119do_widen (const char *__lo, const char *__hi, char_type *__dest) const
120{
121 _RWSTD_ASSERT (__lo <= __hi);
122
123 for (; __lo < __hi; ++__lo, ++__dest)
124 *__dest = widen (*__lo);
125
126 return __hi;
127}
128
129
130template <class _CharT>
131/* virtual */ const typename ctype<_CharT>::char_type*
132ctype<_CharT>::
133do_narrow (const char_type *__lo, const char_type *__hi,
134 char __dfault, char *__dest) const
135{
136 _RWSTD_ASSERT (__lo <= __hi);
137 _RWSTD_ASSERT (!__lo || __dest);
138
139 for (; __lo < __hi; ++__lo, ++__dest)
140 *__dest = narrow (*__lo, __dfault);
141
142 return __hi;
143}
144
145#endif // _RWSTD_NO_EXT_CTYPE_PRIMARY
146
147
148} // namespace std
const char * widen(char *dst, const char *src)
const char * narrow(char *dst, const char *src)
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567
#define _RWSTD_ASSERT(ignore)
Definition _defs.h:1108
Definition json.h:5363