williamr@4: /* williamr@4: * Copyright (c) 1999 williamr@4: * Silicon Graphics Computer Systems, Inc. williamr@4: * williamr@4: * Copyright (c) 1999 williamr@4: * Boris Fomitchev williamr@4: * williamr@4: * This material is provided "as is", with absolutely no warranty expressed williamr@4: * or implied. Any use is at your own risk. williamr@4: * williamr@4: * Permission to use or copy this software for any purpose is hereby granted williamr@4: * without fee, provided the above notices are retained on all copies. williamr@4: * Permission to modify the code and to distribute modified code is granted, williamr@4: * provided the above notices are retained, and a notice that the code was williamr@4: * modified is included with the above copyright notice. williamr@4: * williamr@4: */ williamr@4: #ifndef _STLP_LOCALE williamr@4: #define _STLP_LOCALE williamr@4: williamr@4: // Basic framework: class locale and class locale::facet williamr@4: williamr@4: #ifndef _STLP_OUTERMOST_HEADER_ID williamr@4: # define _STLP_OUTERMOST_HEADER_ID 0x1041 williamr@4: # include williamr@4: #endif williamr@4: williamr@4: #ifdef _STLP_PRAGMA_ONCE williamr@4: # pragma once williamr@4: #endif williamr@4: williamr@4: #include williamr@4: williamr@4: // Individual facets williamr@4: #ifndef _STLP_INTERNAL_CTYPE_H williamr@4: # include williamr@4: #endif williamr@4: williamr@4: #ifndef _STLP_INTERNAL_CODECVT_H williamr@4: # include williamr@4: #endif williamr@4: williamr@4: #ifndef _STLP_INTERNAL_COLLATE_H williamr@4: # include williamr@4: #endif williamr@4: williamr@4: #ifndef _STLP_INTERNAL_NUM_PUT_H williamr@4: # include williamr@4: #endif williamr@4: williamr@4: #ifndef _STLP_INTERNAL_NUM_GET_H williamr@4: # include williamr@4: #endif williamr@4: williamr@4: // those never included separately anyway williamr@4: #include williamr@4: #include williamr@4: #include williamr@4: williamr@4: // some stuff for streambuf iterators ended up defined there williamr@4: // Strictly speaking, _istream.h portion is only required for , but it may break too many williamr@4: // programs if we omit it williamr@4: #ifndef _STLP_ISTREAM_H williamr@4: # include williamr@4: #endif williamr@4: williamr@4: // Convenience interfaces williamr@4: #undef isspace williamr@4: #undef isprint williamr@4: #undef iscntrl williamr@4: #undef isupper williamr@4: #undef islower williamr@4: #undef isalpha williamr@4: #undef isdigit williamr@4: #undef ispunct williamr@4: #undef isxdigit williamr@4: #undef isalnum williamr@4: #undef isgraph williamr@4: #undef toupper williamr@4: #undef tolower williamr@4: williamr@4: _STLP_BEGIN_NAMESPACE williamr@4: williamr@4: template williamr@4: inline bool isspace (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::space, c); } williamr@4: williamr@4: template williamr@4: inline bool isprint (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::print, c); } williamr@4: williamr@4: template williamr@4: inline bool iscntrl (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::cntrl, c); } williamr@4: williamr@4: template williamr@4: inline bool isupper (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::upper, c); } williamr@4: williamr@4: template williamr@4: inline bool islower (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::lower, c); } williamr@4: williamr@4: template williamr@4: inline bool isalpha (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::alpha, c); } williamr@4: williamr@4: template williamr@4: inline bool isdigit (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::digit, c); } williamr@4: williamr@4: template williamr@4: inline bool ispunct (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::punct, c); } williamr@4: williamr@4: template williamr@4: inline bool isxdigit (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::xdigit, c); } williamr@4: williamr@4: template williamr@4: inline bool isalnum (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::alnum, c); } williamr@4: williamr@4: template williamr@4: inline bool isgraph (_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).is(ctype_base::graph, c); } williamr@4: williamr@4: template williamr@4: inline _CharT toupper(_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).toupper(c); } williamr@4: williamr@4: template williamr@4: inline _CharT tolower(_CharT c, const locale& loc) williamr@4: { return (use_facet >(loc)).tolower(c); } williamr@4: williamr@4: _STLP_END_NAMESPACE williamr@4: williamr@4: #if (_STLP_OUTERMOST_HEADER_ID == 0x1041) williamr@4: # include williamr@4: # undef _STLP_OUTERMOST_HEADER_ID williamr@4: #endif williamr@4: williamr@4: #endif /* _STLP_LOCALE */ williamr@4: williamr@4: williamr@4: // Local Variables: williamr@4: // mode:C++ williamr@4: // End: