epoc32/include/stdapis/stlport/locale
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/stlport/locale	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/stlport/locale	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,175 @@
     1.4 -locale
     1.5 +/*
     1.6 + * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
     1.7 + *
     1.8 + * Copyright (c) 1999
     1.9 + * Silicon Graphics Computer Systems, Inc.
    1.10 + *
    1.11 + * Copyright (c) 1999 
    1.12 + * Boris Fomitchev
    1.13 + *
    1.14 + * This material is provided "as is", with absolutely no warranty expressed
    1.15 + * or implied. Any use is at your own risk.
    1.16 + *
    1.17 + * Permission to use or copy this software for any purpose is hereby granted 
    1.18 + * without fee, provided the above notices are retained on all copies.
    1.19 + * Permission to modify the code and to distribute modified code is granted,
    1.20 + * provided the above notices are retained, and a notice that the code was
    1.21 + * modified is included with the above copyright notice.
    1.22 + *
    1.23 + */ 
    1.24 +#ifndef _STLP_LOCALE
    1.25 +#define _STLP_LOCALE
    1.26 +
    1.27 +// Basic framework: class locale and class locale::facet
    1.28 +
    1.29 +# ifndef _STLP_OUTERMOST_HEADER_ID
    1.30 +#  define _STLP_OUTERMOST_HEADER_ID 0x1041
    1.31 +#  include <stl/_prolog.h>
    1.32 +# endif
    1.33 +
    1.34 +# ifdef _STLP_PRAGMA_ONCE
    1.35 +#  pragma once
    1.36 +# endif
    1.37 +# if defined (__SYMBIAN32__)
    1.38 +#  include <clocale>
    1.39 +# endif
    1.40 +
    1.41 +# if defined (_STLP_OWN_IOSTREAMS)
    1.42 +
    1.43 +// Individual facets
    1.44 +#ifndef _STLP_INTERNAL_CTYPE_H
    1.45 +#include <stl/_ctype.h>
    1.46 +#endif
    1.47 +#ifndef _STLP_INTERNAL_CODECVT_H
    1.48 +#include <stl/_codecvt.h>
    1.49 +#endif
    1.50 +#ifndef _STLP_INTERNAL_COLLATE_H
    1.51 +#include <stl/_collate.h>
    1.52 +#endif
    1.53 +#ifndef _STLP_INTERNAL_NUM_PUT_H
    1.54 +# include <stl/_num_put.h>
    1.55 +#endif
    1.56 +
    1.57 +#ifndef _STLP_INTERNAL_NUM_GET_H
    1.58 +# include <stl/_num_get.h>
    1.59 +#endif
    1.60 +
    1.61 +// those never included separately anyway
    1.62 +#include <stl/_monetary.h>
    1.63 +#include <stl/_time_facets.h>
    1.64 +#include <stl/_messages_facets.h>
    1.65 +
    1.66 +// some stuff for streambuf iterators ended up defined there
    1.67 +// Strictly speaking, _istream.h portion is only required for <iterator>, but it may break too many 
    1.68 +// programs if we omit it
    1.69 +#ifndef _STLP_ISTREAM_H
    1.70 +# include <stl/_istream.h>
    1.71 +#endif
    1.72 +
    1.73 +// Convenience interfaces
    1.74 +#undef isspace
    1.75 +#undef isprint
    1.76 +#undef iscntrl
    1.77 +#undef isupper
    1.78 +#undef islower
    1.79 +#undef isalpha
    1.80 +#undef isdigit
    1.81 +#undef ispunct
    1.82 +#undef isxdigit
    1.83 +#undef isalnum
    1.84 +#undef isgraph
    1.85 +#undef toupper
    1.86 +#undef tolower
    1.87 +
    1.88 +_STLP_BEGIN_NAMESPACE
    1.89 +
    1.90 +template <class _CharT> 
    1.91 +inline bool isspace (_CharT c, const locale& loc) {
    1.92 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::space, c);
    1.93 +}
    1.94 +
    1.95 +template <class _CharT> 
    1.96 +inline bool isprint (_CharT c, const locale& loc) {
    1.97 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::print, c);
    1.98 +}
    1.99 +
   1.100 +template <class _CharT> 
   1.101 +inline bool iscntrl (_CharT c, const locale& loc) {
   1.102 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::cntrl, c);
   1.103 +}
   1.104 +
   1.105 +template <class _CharT> 
   1.106 +inline bool isupper (_CharT c, const locale& loc) {
   1.107 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::upper, c);
   1.108 +}
   1.109 +
   1.110 +template <class _CharT> 
   1.111 +inline bool islower (_CharT c, const locale& loc) {
   1.112 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::lower, c);
   1.113 +}
   1.114 +
   1.115 +template <class _CharT> 
   1.116 +inline bool isalpha (_CharT c, const locale& loc) {
   1.117 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alpha, c);
   1.118 +}
   1.119 +
   1.120 +template <class _CharT> 
   1.121 +inline bool isdigit (_CharT c, const locale& loc) {
   1.122 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::digit, c);
   1.123 +}
   1.124 +
   1.125 +template <class _CharT> 
   1.126 +inline bool ispunct (_CharT c, const locale& loc) {
   1.127 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::punct, c);
   1.128 +}
   1.129 +
   1.130 +template <class _CharT> 
   1.131 +inline bool isxdigit (_CharT c, const locale& loc) {
   1.132 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::xdigit, c);
   1.133 +}
   1.134 +
   1.135 +template <class _CharT> 
   1.136 +inline bool isalnum (_CharT c, const locale& loc) {
   1.137 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alnum, c);
   1.138 +}
   1.139 +
   1.140 +template <class _CharT> 
   1.141 +inline bool isgraph (_CharT c, const locale& loc) {
   1.142 +  return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::graph, c);
   1.143 +}
   1.144 +
   1.145 +template <class _CharT>
   1.146 +inline _CharT toupper(_CharT c, const locale& loc) {
   1.147 +  return (use_facet<ctype<_CharT> >(loc)).toupper(c);
   1.148 +}
   1.149 +
   1.150 +template <class _CharT>
   1.151 +inline _CharT tolower(_CharT c, const locale& loc) {
   1.152 +  return (use_facet<ctype<_CharT> >(loc)).tolower(c);
   1.153 +}
   1.154 +
   1.155 +# ifndef __LOCALE_INITIALIZED
   1.156 +#  define __LOCALE_INITIALIZED
   1.157 +# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
   1.158 +// Global initializer object, to ensure initialization of locale subsystem.
   1.159 +static ios_base::_Loc_init _LocInit;
   1.160 +# endif
   1.161 +# endif
   1.162 +
   1.163 +_STLP_END_NAMESPACE
   1.164 +
   1.165 +# elif !defined (_STLP_USE_NO_IOSTREAMS)
   1.166 +#  include <wrap_std/locale> 
   1.167 +# endif
   1.168 +
   1.169 +# if (_STLP_OUTERMOST_HEADER_ID == 0x1041)
   1.170 +#  include <stl/_epilog.h>
   1.171 +#  undef _STLP_OUTERMOST_HEADER_ID
   1.172 +# endif
   1.173 +
   1.174 +#endif /* _STLP_LOCALE */
   1.175 +
   1.176 +
   1.177 +// Local Variables:
   1.178 +// mode:C++
   1.179 +// End: