locale revision 951a39d68df598db08dfced8b4707755864a0492
1951a39d68df598db08dfced8b4707755864a0492Ying Wang/* 2951a39d68df598db08dfced8b4707755864a0492Ying Wang * Copyright (c) 1999 3951a39d68df598db08dfced8b4707755864a0492Ying Wang * Silicon Graphics Computer Systems, Inc. 4951a39d68df598db08dfced8b4707755864a0492Ying Wang * 5951a39d68df598db08dfced8b4707755864a0492Ying Wang * Copyright (c) 1999 6951a39d68df598db08dfced8b4707755864a0492Ying Wang * Boris Fomitchev 7951a39d68df598db08dfced8b4707755864a0492Ying Wang * 8951a39d68df598db08dfced8b4707755864a0492Ying Wang * This material is provided "as is", with absolutely no warranty expressed 9951a39d68df598db08dfced8b4707755864a0492Ying Wang * or implied. Any use is at your own risk. 10951a39d68df598db08dfced8b4707755864a0492Ying Wang * 11951a39d68df598db08dfced8b4707755864a0492Ying Wang * Permission to use or copy this software for any purpose is hereby granted 12951a39d68df598db08dfced8b4707755864a0492Ying Wang * without fee, provided the above notices are retained on all copies. 13951a39d68df598db08dfced8b4707755864a0492Ying Wang * Permission to modify the code and to distribute modified code is granted, 14951a39d68df598db08dfced8b4707755864a0492Ying Wang * provided the above notices are retained, and a notice that the code was 15951a39d68df598db08dfced8b4707755864a0492Ying Wang * modified is included with the above copyright notice. 16951a39d68df598db08dfced8b4707755864a0492Ying Wang * 17951a39d68df598db08dfced8b4707755864a0492Ying Wang */ 18951a39d68df598db08dfced8b4707755864a0492Ying Wang#ifndef _STLP_LOCALE 19951a39d68df598db08dfced8b4707755864a0492Ying Wang 20951a39d68df598db08dfced8b4707755864a0492Ying Wang// Basic framework: class locale and class locale::facet 21951a39d68df598db08dfced8b4707755864a0492Ying Wang 22951a39d68df598db08dfced8b4707755864a0492Ying Wang#ifndef _STLP_OUTERMOST_HEADER_ID 23951a39d68df598db08dfced8b4707755864a0492Ying Wang# define _STLP_OUTERMOST_HEADER_ID 0x1041 24951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_prolog.h> 25951a39d68df598db08dfced8b4707755864a0492Ying Wang# define _STLP_LOCALE 26951a39d68df598db08dfced8b4707755864a0492Ying Wang#endif 27951a39d68df598db08dfced8b4707755864a0492Ying Wang 28951a39d68df598db08dfced8b4707755864a0492Ying Wang#if (_STLP_OUTERMOST_HEADER_ID == 0x1041) && \ 29951a39d68df598db08dfced8b4707755864a0492Ying Wang !(defined (_STLP_NO_IOSTREAMS) && defined (_STLP_IMPORT_VENDOR_STD)) 30951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_ioserr.h> 31951a39d68df598db08dfced8b4707755864a0492Ying Wang 32951a39d68df598db08dfced8b4707755864a0492Ying Wang// Individual facets 33951a39d68df598db08dfced8b4707755864a0492Ying Wang# ifndef _STLP_INTERNAL_CTYPE_H 34951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_ctype.h> 35951a39d68df598db08dfced8b4707755864a0492Ying Wang# endif 36951a39d68df598db08dfced8b4707755864a0492Ying Wang 37951a39d68df598db08dfced8b4707755864a0492Ying Wang# ifndef _STLP_INTERNAL_CODECVT_H 38951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_codecvt.h> 39951a39d68df598db08dfced8b4707755864a0492Ying Wang# endif 40951a39d68df598db08dfced8b4707755864a0492Ying Wang 41951a39d68df598db08dfced8b4707755864a0492Ying Wang# ifndef _STLP_INTERNAL_COLLATE_H 42951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_collate.h> 43951a39d68df598db08dfced8b4707755864a0492Ying Wang# endif 44951a39d68df598db08dfced8b4707755864a0492Ying Wang 45951a39d68df598db08dfced8b4707755864a0492Ying Wang# ifndef _STLP_INTERNAL_NUM_PUT_H 46951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_num_put.h> 47951a39d68df598db08dfced8b4707755864a0492Ying Wang# endif 48951a39d68df598db08dfced8b4707755864a0492Ying Wang 49951a39d68df598db08dfced8b4707755864a0492Ying Wang# ifndef _STLP_INTERNAL_NUM_GET_H 50951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_num_get.h> 51951a39d68df598db08dfced8b4707755864a0492Ying Wang# endif 52951a39d68df598db08dfced8b4707755864a0492Ying Wang 53951a39d68df598db08dfced8b4707755864a0492Ying Wang// those never included separately anyway 54951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_monetary.h> 55951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_time_facets.h> 56951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_messages_facets.h> 57951a39d68df598db08dfced8b4707755864a0492Ying Wang 58951a39d68df598db08dfced8b4707755864a0492Ying Wang// some stuff for streambuf iterators ended up defined there 59951a39d68df598db08dfced8b4707755864a0492Ying Wang// Strictly speaking, _istream.h portion is only required for <iterator>, but it may break too many 60951a39d68df598db08dfced8b4707755864a0492Ying Wang// programs if we omit it 61951a39d68df598db08dfced8b4707755864a0492Ying Wang# ifndef _STLP_ISTREAM_H 62951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_istream.h> 63951a39d68df598db08dfced8b4707755864a0492Ying Wang# endif 64951a39d68df598db08dfced8b4707755864a0492Ying Wang 65951a39d68df598db08dfced8b4707755864a0492Ying Wang// Convenience interfaces 66951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef isspace 67951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef isprint 68951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef iscntrl 69951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef isupper 70951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef islower 71951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef isalpha 72951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef isdigit 73951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef ispunct 74951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef isxdigit 75951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef isalnum 76951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef isgraph 77951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef toupper 78951a39d68df598db08dfced8b4707755864a0492Ying Wang#undef tolower 79951a39d68df598db08dfced8b4707755864a0492Ying Wang 80951a39d68df598db08dfced8b4707755864a0492Ying Wang_STLP_BEGIN_NAMESPACE 81951a39d68df598db08dfced8b4707755864a0492Ying Wang 82951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 83951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool isspace (_CharT c, const locale& loc) 84951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::space, c); } 85951a39d68df598db08dfced8b4707755864a0492Ying Wang 86951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 87951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool isprint (_CharT c, const locale& loc) 88951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::print, c); } 89951a39d68df598db08dfced8b4707755864a0492Ying Wang 90951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 91951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool iscntrl (_CharT c, const locale& loc) 92951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::cntrl, c); } 93951a39d68df598db08dfced8b4707755864a0492Ying Wang 94951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 95951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool isupper (_CharT c, const locale& loc) 96951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::upper, c); } 97951a39d68df598db08dfced8b4707755864a0492Ying Wang 98951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 99951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool islower (_CharT c, const locale& loc) 100951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::lower, c); } 101951a39d68df598db08dfced8b4707755864a0492Ying Wang 102951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 103951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool isalpha (_CharT c, const locale& loc) 104951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alpha, c); } 105951a39d68df598db08dfced8b4707755864a0492Ying Wang 106951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 107951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool isdigit (_CharT c, const locale& loc) 108951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::digit, c); } 109951a39d68df598db08dfced8b4707755864a0492Ying Wang 110951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 111951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool ispunct (_CharT c, const locale& loc) 112951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::punct, c); } 113951a39d68df598db08dfced8b4707755864a0492Ying Wang 114951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 115951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool isxdigit (_CharT c, const locale& loc) 116951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::xdigit, c); } 117951a39d68df598db08dfced8b4707755864a0492Ying Wang 118951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 119951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool isalnum (_CharT c, const locale& loc) 120951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alnum, c); } 121951a39d68df598db08dfced8b4707755864a0492Ying Wang 122951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 123951a39d68df598db08dfced8b4707755864a0492Ying Wanginline bool isgraph (_CharT c, const locale& loc) 124951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::graph, c); } 125951a39d68df598db08dfced8b4707755864a0492Ying Wang 126951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 127951a39d68df598db08dfced8b4707755864a0492Ying Wanginline _CharT toupper(_CharT c, const locale& loc) 128951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).toupper(c); } 129951a39d68df598db08dfced8b4707755864a0492Ying Wang 130951a39d68df598db08dfced8b4707755864a0492Ying Wangtemplate <class _CharT> 131951a39d68df598db08dfced8b4707755864a0492Ying Wanginline _CharT tolower(_CharT c, const locale& loc) 132951a39d68df598db08dfced8b4707755864a0492Ying Wang{ return (use_facet<ctype<_CharT> >(loc)).tolower(c); } 133951a39d68df598db08dfced8b4707755864a0492Ying Wang 134951a39d68df598db08dfced8b4707755864a0492Ying Wang_STLP_END_NAMESPACE 135951a39d68df598db08dfced8b4707755864a0492Ying Wang 136951a39d68df598db08dfced8b4707755864a0492Ying Wang#endif 137951a39d68df598db08dfced8b4707755864a0492Ying Wang 138951a39d68df598db08dfced8b4707755864a0492Ying Wang#if (_STLP_OUTERMOST_HEADER_ID != 0x1041) || defined (_STLP_IMPORT_VENDOR_STD) 139951a39d68df598db08dfced8b4707755864a0492Ying Wang# if defined (_STLP_HAS_INCLUDE_NEXT) 140951a39d68df598db08dfced8b4707755864a0492Ying Wang# include_next <locale> 141951a39d68df598db08dfced8b4707755864a0492Ying Wang# else 142951a39d68df598db08dfced8b4707755864a0492Ying Wang# include _STLP_NATIVE_HEADER(locale) 143951a39d68df598db08dfced8b4707755864a0492Ying Wang# endif 144951a39d68df598db08dfced8b4707755864a0492Ying Wang#endif 145951a39d68df598db08dfced8b4707755864a0492Ying Wang 146951a39d68df598db08dfced8b4707755864a0492Ying Wang#if (_STLP_OUTERMOST_HEADER_ID == 0x1041) 147951a39d68df598db08dfced8b4707755864a0492Ying Wang# include <stl/_epilog.h> 148951a39d68df598db08dfced8b4707755864a0492Ying Wang# undef _STLP_OUTERMOST_HEADER_ID 149951a39d68df598db08dfced8b4707755864a0492Ying Wang#endif 150951a39d68df598db08dfced8b4707755864a0492Ying Wang 151951a39d68df598db08dfced8b4707755864a0492Ying Wang#endif /* _STLP_LOCALE */ 152951a39d68df598db08dfced8b4707755864a0492Ying Wang 153951a39d68df598db08dfced8b4707755864a0492Ying Wang 154951a39d68df598db08dfced8b4707755864a0492Ying Wang// Local Variables: 155951a39d68df598db08dfced8b4707755864a0492Ying Wang// mode:C++ 156951a39d68df598db08dfced8b4707755864a0492Ying Wang// End: 157