3 * Silicon Graphics Computer Systems, Inc.
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
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.
20 // Basic framework: class locale and class locale::facet
22 #ifndef _STLP_OUTERMOST_HEADER_ID
23 # define _STLP_OUTERMOST_HEADER_ID 0x1041
24 # include <stl/_prolog.h>
28 #if (_STLP_OUTERMOST_HEADER_ID == 0x1041) && \
29 !(defined (_STLP_NO_IOSTREAMS) && defined (_STLP_IMPORT_VENDOR_STD))
30 # include <stl/_ioserr.h>
33 # ifndef _STLP_INTERNAL_CTYPE_H
34 # include <stl/_ctype.h>
37 # ifndef _STLP_INTERNAL_CODECVT_H
38 # include <stl/_codecvt.h>
41 # ifndef _STLP_INTERNAL_COLLATE_H
42 # include <stl/_collate.h>
45 # ifndef _STLP_INTERNAL_NUM_PUT_H
46 # include <stl/_num_put.h>
49 # ifndef _STLP_INTERNAL_NUM_GET_H
50 # include <stl/_num_get.h>
53 // those never included separately anyway
54 # include <stl/_monetary.h>
55 # include <stl/_time_facets.h>
56 # include <stl/_messages_facets.h>
58 // some stuff for streambuf iterators ended up defined there
59 // Strictly speaking, _istream.h portion is only required for <iterator>, but it may break too many
60 // programs if we omit it
61 # ifndef _STLP_ISTREAM_H
62 # include <stl/_istream.h>
65 // Convenience interfaces
82 template <class _CharT>
83 inline bool isspace (_CharT c, const locale& loc)
84 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::space, c); }
86 template <class _CharT>
87 inline bool isprint (_CharT c, const locale& loc)
88 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::print, c); }
90 template <class _CharT>
91 inline bool iscntrl (_CharT c, const locale& loc)
92 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::cntrl, c); }
94 template <class _CharT>
95 inline bool isupper (_CharT c, const locale& loc)
96 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::upper, c); }
98 template <class _CharT>
99 inline bool islower (_CharT c, const locale& loc)
100 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::lower, c); }
102 template <class _CharT>
103 inline bool isalpha (_CharT c, const locale& loc)
104 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alpha, c); }
106 template <class _CharT>
107 inline bool isdigit (_CharT c, const locale& loc)
108 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::digit, c); }
110 template <class _CharT>
111 inline bool ispunct (_CharT c, const locale& loc)
112 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::punct, c); }
114 template <class _CharT>
115 inline bool isxdigit (_CharT c, const locale& loc)
116 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::xdigit, c); }
118 template <class _CharT>
119 inline bool isalnum (_CharT c, const locale& loc)
120 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alnum, c); }
122 template <class _CharT>
123 inline bool isgraph (_CharT c, const locale& loc)
124 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::graph, c); }
126 template <class _CharT>
127 inline _CharT toupper(_CharT c, const locale& loc)
128 { return (use_facet<ctype<_CharT> >(loc)).toupper(c); }
130 template <class _CharT>
131 inline _CharT tolower(_CharT c, const locale& loc)
132 { return (use_facet<ctype<_CharT> >(loc)).tolower(c); }
138 #if (_STLP_OUTERMOST_HEADER_ID != 0x1041) || defined (_STLP_IMPORT_VENDOR_STD)
139 # if defined (_STLP_HAS_INCLUDE_NEXT)
140 # include_next <locale>
142 # include _STLP_NATIVE_HEADER(locale)
146 #if (_STLP_OUTERMOST_HEADER_ID == 0x1041)
147 # include <stl/_epilog.h>
148 # undef _STLP_OUTERMOST_HEADER_ID
151 #endif /* _STLP_LOCALE */