X-Git-Url: http://git.buserror.net/cgi-bin/gitweb.cgi?p=polintos%2Fscott%2Fpriv.git;a=blobdiff_plain;f=include%2Fc%2B%2B%2Fstl%2Flocale;fp=include%2Fc%2B%2B%2Fstl%2Flocale;h=289bfe394b324c314ba255d871936c9875380986;hp=0000000000000000000000000000000000000000;hb=173d8903eb9d51a4ea7d7fa3e52dc86c9bb6d4f1;hpb=b024710fe2b60cd4a42a8993b61333d6cdb56ca3 diff --git a/include/c++/stl/locale b/include/c++/stl/locale new file mode 100644 index 0000000..289bfe3 --- /dev/null +++ b/include/c++/stl/locale @@ -0,0 +1,148 @@ +/* + * 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 _STLP_LOCALE +#define _STLP_LOCALE + +// Basic framework: class locale and class locale::facet + +#ifndef _STLP_OUTERMOST_HEADER_ID +# define _STLP_OUTERMOST_HEADER_ID 0x1041 +# include +#endif + +#ifdef _STLP_PRAGMA_ONCE +# pragma once +#endif + +#include + +// Individual facets +#ifndef _STLP_INTERNAL_CTYPE_H +# include +#endif + +#ifndef _STLP_INTERNAL_CODECVT_H +# include +#endif + +#ifndef _STLP_INTERNAL_COLLATE_H +# include +#endif + +#ifndef _STLP_INTERNAL_NUM_PUT_H +# include +#endif + +#ifndef _STLP_INTERNAL_NUM_GET_H +# include +#endif + +// those never included separately anyway +#include +#include +#include + +// some stuff for streambuf iterators ended up defined there +// Strictly speaking, _istream.h portion is only required for , but it may break too many +// programs if we omit it +#ifndef _STLP_ISTREAM_H +# include +#endif + +// 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 + +_STLP_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); } + +_STLP_END_NAMESPACE + +#if (_STLP_OUTERMOST_HEADER_ID == 0x1041) +# include +# undef _STLP_OUTERMOST_HEADER_ID +#endif + +#endif /* _STLP_LOCALE */ + + +// Local Variables: +// mode:C++ +// End: