/home/ntakagi/work/STLport-5.1.5/stlport/locale

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999
00003  * Silicon Graphics Computer Systems, Inc.
00004  *
00005  * Copyright (c) 1999
00006  * Boris Fomitchev
00007  *
00008  * This material is provided "as is", with absolutely no warranty expressed
00009  * or implied. Any use is at your own risk.
00010  *
00011  * Permission to use or copy this software for any purpose is hereby granted
00012  * without fee, provided the above notices are retained on all copies.
00013  * Permission to modify the code and to distribute modified code is granted,
00014  * provided the above notices are retained, and a notice that the code was
00015  * modified is included with the above copyright notice.
00016  *
00017  */
00018 #ifndef _STLP_LOCALE
00019 #define _STLP_LOCALE
00020 
00021 // Basic framework: class locale and class locale::facet
00022 
00023 #ifndef _STLP_OUTERMOST_HEADER_ID
00024 #  define _STLP_OUTERMOST_HEADER_ID 0x1041
00025 #  include <stl/_prolog.h>
00026 #endif
00027 
00028 #ifdef _STLP_PRAGMA_ONCE
00029 #  pragma once
00030 #endif
00031 
00032 #include <stl/_ioserr.h>
00033 
00034 // Individual facets
00035 #ifndef _STLP_INTERNAL_CTYPE_H
00036 #  include <stl/_ctype.h>
00037 #endif
00038 
00039 #ifndef _STLP_INTERNAL_CODECVT_H
00040 #  include <stl/_codecvt.h>
00041 #endif
00042 
00043 #ifndef _STLP_INTERNAL_COLLATE_H
00044 #  include <stl/_collate.h>
00045 #endif
00046 
00047 #ifndef _STLP_INTERNAL_NUM_PUT_H
00048 #  include <stl/_num_put.h>
00049 #endif
00050 
00051 #ifndef _STLP_INTERNAL_NUM_GET_H
00052 #  include <stl/_num_get.h>
00053 #endif
00054 
00055 // those never included separately anyway
00056 #include <stl/_monetary.h>
00057 #include <stl/_time_facets.h>
00058 #include <stl/_messages_facets.h>
00059 
00060 // some stuff for streambuf iterators ended up defined there
00061 // Strictly speaking, _istream.h portion is only required for <iterator>, but it may break too many
00062 // programs if we omit it
00063 #ifndef _STLP_ISTREAM_H
00064 #  include <stl/_istream.h>
00065 #endif
00066 
00067 // Convenience interfaces
00068 #undef isspace
00069 #undef isprint
00070 #undef iscntrl
00071 #undef isupper
00072 #undef islower
00073 #undef isalpha
00074 #undef isdigit
00075 #undef ispunct
00076 #undef isxdigit
00077 #undef isalnum
00078 #undef isgraph
00079 #undef toupper
00080 #undef tolower
00081 
00082 _STLP_BEGIN_NAMESPACE
00083 
00084 template <class _CharT> 
00085 inline bool isspace (_CharT c, const locale& loc)
00086 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::space, c); }
00087 
00088 template <class _CharT> 
00089 inline bool isprint (_CharT c, const locale& loc)
00090 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::print, c); }
00091 
00092 template <class _CharT> 
00093 inline bool iscntrl (_CharT c, const locale& loc)
00094 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::cntrl, c); }
00095 
00096 template <class _CharT> 
00097 inline bool isupper (_CharT c, const locale& loc)
00098 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::upper, c); }
00099 
00100 template <class _CharT> 
00101 inline bool islower (_CharT c, const locale& loc)
00102 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::lower, c); }
00103 
00104 template <class _CharT> 
00105 inline bool isalpha (_CharT c, const locale& loc)
00106 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alpha, c); }
00107 
00108 template <class _CharT> 
00109 inline bool isdigit (_CharT c, const locale& loc)
00110 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::digit, c); }
00111 
00112 template <class _CharT> 
00113 inline bool ispunct (_CharT c, const locale& loc)
00114 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::punct, c); }
00115 
00116 template <class _CharT> 
00117 inline bool isxdigit (_CharT c, const locale& loc)
00118 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::xdigit, c); }
00119 
00120 template <class _CharT> 
00121 inline bool isalnum (_CharT c, const locale& loc)
00122 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alnum, c); }
00123 
00124 template <class _CharT> 
00125 inline bool isgraph (_CharT c, const locale& loc)
00126 { return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::graph, c); }
00127 
00128 template <class _CharT>
00129 inline _CharT toupper(_CharT c, const locale& loc)
00130 { return (use_facet<ctype<_CharT> >(loc)).toupper(c); }
00131 
00132 template <class _CharT>
00133 inline _CharT tolower(_CharT c, const locale& loc)
00134 { return (use_facet<ctype<_CharT> >(loc)).tolower(c); }
00135 
00136 _STLP_END_NAMESPACE
00137 
00138 #if (_STLP_OUTERMOST_HEADER_ID == 0x1041)
00139 #  include <stl/_epilog.h>
00140 #  undef _STLP_OUTERMOST_HEADER_ID
00141 #endif
00142 
00143 #endif /* _STLP_LOCALE */
00144 
00145 
00146 // Local Variables:
00147 // mode:C++
00148 // End:



Generated on Mon Mar 10 15:32:18 2008 by  doxygen 1.5.1