Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
_convenience.h
Go to the documentation of this file.
1
33#ifndef _RWSTD_LOC_CONVENIENCE_H_INCLUDED
34#define _RWSTD_LOC_CONVENIENCE_H_INCLUDED
35
36
37#include <loc/_ctype.h>
38#include <loc/_locale.h>
39#include <rw/_defs.h>
40
41
43
44
45// convenience interfaces: is*(char)
46// names parenthesized to avoid clashing with masking macros
47
48
49template <class _CharT>
50inline bool (isspace)(_CharT __c, const locale &__loc)
51{
52 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is (ctype_base::space, __c);
53}
54
55
56template <class _CharT>
57inline bool (isprint)(_CharT __c, const locale &__loc)
58{
59 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is (ctype_base::print, __c);
60}
61
62template <class _CharT>
63inline bool (iscntrl)(_CharT __c, const locale &__loc)
64{
65 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is(ctype_base::cntrl, __c);
66}
67
68
69template <class _CharT>
70inline bool (isupper)(_CharT __c, const locale &__loc)
71{
72 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is (ctype_base::upper, __c);
73}
74
75
76template <class _CharT>
77inline bool (islower)(_CharT __c, const locale &__loc)
78{
79 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is (ctype_base::lower, __c);
80}
81
82
83template <class _CharT>
84inline bool (isalpha)(_CharT __c, const locale &__loc)
85{
86 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is (ctype_base::alpha, __c);
87}
88
89
90template <class _CharT>
91inline bool (isdigit)(_CharT __c, const locale &__loc)
92{
93 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is (ctype_base::digit, __c);
94}
95
96
97template <class _CharT>
98inline bool (ispunct)(_CharT __c, const locale &__loc)
99{
100 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is(ctype_base::punct, __c);
101}
102
103
104template <class _CharT>
105inline bool (isxdigit)(_CharT __c, const locale &__loc)
106{
107 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is (ctype_base::xdigit,
108 __c);
109}
110
111
112template <class _CharT>
113inline bool (isalnum)(_CharT __c, const locale &__loc)
114{
115 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is (ctype_base::alnum, __c);
116}
117
118
119template <class _CharT>
120inline bool (isgraph)(_CharT __c, const locale &__loc)
121{
122 return _RWSTD_USE_FACET (ctype<_CharT>, __loc).is (ctype_base::graph, __c);
123}
124
125
126template <class _CharT>
127inline _CharT (toupper)(_CharT __c, const locale &__loc)
128{
129 return (_RWSTD_USE_FACET (ctype<_CharT>, __loc).toupper) (__c);
130}
131
132
133template <class _CharT>
134inline _CharT (tolower)(_CharT __c, const locale &__loc)
135{
136 return (_RWSTD_USE_FACET (ctype<_CharT>, __loc).tolower) (__c);
137}
138
139} // namespace std
140
141
142#endif // _RWSTD_LOC_CONVENIENCE_H_INCLUDED
#define _RWSTD_USE_FACET(type, arg)
Definition _defs.h:949
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567
Definition json.h:5363
#define bool
Definition stdbool.h:24