/* * Copyright (c) 1999 * Silicon Graphics Computer Systems, Inc. * * Copyright (c) 1999 * Boris Fomitchev * * This material is provided "as is", with absolutely no warranty expressed * or implied. Any use is at your own risk. * * Permission to use or copy this software for any purpose is hereby granted * without fee, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. * */ #ifndef __SGI_STL_LOCALE #define __SGI_STL_LOCALE // Basic framework: class locale and class locale::facet # ifndef __STL_OUTERMOST_HEADER_ID # define __STL_OUTERMOST_HEADER_ID 0x1041 # include # endif # if defined (__SGI_STL_OWN_IOSTREAMS) #include #include // Some facets need basic_ios and/or ios_base #include // Needed by #include // Needed for [io]streambuf_iterator #include // Needed by numeric facets #include // Needed (for struct tm) by time facets // Individual facets #include #include #include #include #include #include #include // Convenience interfaces #undef isspace #undef isprint #undef iscntrl #undef isupper #undef islower #undef isalpha #undef isdigit #undef ispunct #undef isxdigit #undef isalnum #undef isgraph #undef toupper #undef tolower __STL_BEGIN_NAMESPACE template inline bool isspace (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::space, c); } template inline bool isprint (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::print, c); } template inline bool iscntrl (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::cntrl, c); } template inline bool isupper (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::upper, c); } template inline bool islower (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::lower, c); } template inline bool isalpha (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::alpha, c); } template inline bool isdigit (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::digit, c); } template inline bool ispunct (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::punct, c); } template inline bool isxdigit (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::xdigit, c); } template inline bool isalnum (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::alnum, c); } template inline bool isgraph (_CharT c, const locale& loc) { return (use_facet >(loc)).is(ctype_base::graph, c); } template inline _CharT toupper(_CharT c, const locale& loc) { return (use_facet >(loc)).toupper(c); } template inline _CharT tolower(_CharT c, const locale& loc) { return (use_facet >(loc)).tolower(c); } # ifndef __IOS_BASE_INITIALIZED # define __IOS_BASE_INITIALIZED // Global initializer object, to ensure construction of static objects. static ios_base::Init __initializer; # endif __STL_END_NAMESPACE # elif !defined (__STL_USE_NO_IOSTREAMS) # include # endif # if (__STL_OUTERMOST_HEADER_ID == 0x1041) # include # undef __STL_OUTERMOST_HEADER_ID # endif #endif /* __SGI_STL_LOCALE */ // Local Variables: // mode:C++ // End: