os/ossrv/genericopenlibs/cppstdlib/stl/stlport/locale
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
 * Copyright (c) 1999
sl@0
     3
 * Silicon Graphics Computer Systems, Inc.
sl@0
     4
 *
sl@0
     5
 * Copyright (c) 1999
sl@0
     6
 * Boris Fomitchev
sl@0
     7
 *
sl@0
     8
 * This material is provided "as is", with absolutely no warranty expressed
sl@0
     9
 * or implied. Any use is at your own risk.
sl@0
    10
 *
sl@0
    11
 * Permission to use or copy this software for any purpose is hereby granted
sl@0
    12
 * without fee, provided the above notices are retained on all copies.
sl@0
    13
 * Permission to modify the code and to distribute modified code is granted,
sl@0
    14
 * provided the above notices are retained, and a notice that the code was
sl@0
    15
 * modified is included with the above copyright notice.
sl@0
    16
 *
sl@0
    17
 */
sl@0
    18
#ifndef _STLP_LOCALE
sl@0
    19
#define _STLP_LOCALE
sl@0
    20
sl@0
    21
// Basic framework: class locale and class locale::facet
sl@0
    22
sl@0
    23
#ifndef _STLP_OUTERMOST_HEADER_ID
sl@0
    24
#  define _STLP_OUTERMOST_HEADER_ID 0x1041
sl@0
    25
#  include <stl/_prolog.h>
sl@0
    26
#endif
sl@0
    27
sl@0
    28
#ifdef _STLP_PRAGMA_ONCE
sl@0
    29
#  pragma once
sl@0
    30
#endif
sl@0
    31
sl@0
    32
#include <stl/_ioserr.h>
sl@0
    33
sl@0
    34
// Individual facets
sl@0
    35
#ifndef _STLP_INTERNAL_CTYPE_H
sl@0
    36
#  include <stl/_ctype.h>
sl@0
    37
#endif
sl@0
    38
sl@0
    39
#ifndef _STLP_INTERNAL_CODECVT_H
sl@0
    40
#  include <stl/_codecvt.h>
sl@0
    41
#endif
sl@0
    42
sl@0
    43
#ifndef _STLP_INTERNAL_COLLATE_H
sl@0
    44
#  include <stl/_collate.h>
sl@0
    45
#endif
sl@0
    46
sl@0
    47
#ifndef _STLP_INTERNAL_NUM_PUT_H
sl@0
    48
#  include <stl/_num_put.h>
sl@0
    49
#endif
sl@0
    50
sl@0
    51
#ifndef _STLP_INTERNAL_NUM_GET_H
sl@0
    52
#  include <stl/_num_get.h>
sl@0
    53
#endif
sl@0
    54
sl@0
    55
// those never included separately anyway
sl@0
    56
#include <stl/_monetary.h>
sl@0
    57
#include <stl/_time_facets.h>
sl@0
    58
#include <stl/_messages_facets.h>
sl@0
    59
sl@0
    60
// some stuff for streambuf iterators ended up defined there
sl@0
    61
// Strictly speaking, _istream.h portion is only required for <iterator>, but it may break too many
sl@0
    62
// programs if we omit it
sl@0
    63
#ifndef _STLP_ISTREAM_H
sl@0
    64
#  include <stl/_istream.h>
sl@0
    65
#endif
sl@0
    66
sl@0
    67
// Convenience interfaces
sl@0
    68
#undef isspace
sl@0
    69
#undef isprint
sl@0
    70
#undef iscntrl
sl@0
    71
#undef isupper
sl@0
    72
#undef islower
sl@0
    73
#undef isalpha
sl@0
    74
#undef isdigit
sl@0
    75
#undef ispunct
sl@0
    76
#undef isxdigit
sl@0
    77
#undef isalnum
sl@0
    78
#undef isgraph
sl@0
    79
#undef toupper
sl@0
    80
#undef tolower
sl@0
    81
sl@0
    82
_STLP_BEGIN_NAMESPACE
sl@0
    83
sl@0
    84
template <class _CharT> 
sl@0
    85
inline bool isspace (_CharT c, const locale& loc)
sl@0
    86
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::space, c); }
sl@0
    87
sl@0
    88
template <class _CharT> 
sl@0
    89
inline bool isprint (_CharT c, const locale& loc)
sl@0
    90
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::print, c); }
sl@0
    91
sl@0
    92
template <class _CharT> 
sl@0
    93
inline bool iscntrl (_CharT c, const locale& loc)
sl@0
    94
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::cntrl, c); }
sl@0
    95
sl@0
    96
template <class _CharT> 
sl@0
    97
inline bool isupper (_CharT c, const locale& loc)
sl@0
    98
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::upper, c); }
sl@0
    99
sl@0
   100
template <class _CharT> 
sl@0
   101
inline bool islower (_CharT c, const locale& loc)
sl@0
   102
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::lower, c); }
sl@0
   103
sl@0
   104
template <class _CharT> 
sl@0
   105
inline bool isalpha (_CharT c, const locale& loc)
sl@0
   106
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alpha, c); }
sl@0
   107
sl@0
   108
template <class _CharT> 
sl@0
   109
inline bool isdigit (_CharT c, const locale& loc)
sl@0
   110
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::digit, c); }
sl@0
   111
sl@0
   112
template <class _CharT> 
sl@0
   113
inline bool ispunct (_CharT c, const locale& loc)
sl@0
   114
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::punct, c); }
sl@0
   115
sl@0
   116
template <class _CharT> 
sl@0
   117
inline bool isxdigit (_CharT c, const locale& loc)
sl@0
   118
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::xdigit, c); }
sl@0
   119
sl@0
   120
template <class _CharT> 
sl@0
   121
inline bool isalnum (_CharT c, const locale& loc)
sl@0
   122
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alnum, c); }
sl@0
   123
sl@0
   124
template <class _CharT> 
sl@0
   125
inline bool isgraph (_CharT c, const locale& loc)
sl@0
   126
{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::graph, c); }
sl@0
   127
sl@0
   128
template <class _CharT>
sl@0
   129
inline _CharT toupper(_CharT c, const locale& loc)
sl@0
   130
{ return (use_facet<ctype<_CharT> >(loc)).toupper(c); }
sl@0
   131
sl@0
   132
template <class _CharT>
sl@0
   133
inline _CharT tolower(_CharT c, const locale& loc)
sl@0
   134
{ return (use_facet<ctype<_CharT> >(loc)).tolower(c); }
sl@0
   135
sl@0
   136
_STLP_END_NAMESPACE
sl@0
   137
sl@0
   138
#if (_STLP_OUTERMOST_HEADER_ID == 0x1041)
sl@0
   139
#  include <stl/_epilog.h>
sl@0
   140
#  undef _STLP_OUTERMOST_HEADER_ID
sl@0
   141
#endif
sl@0
   142
sl@0
   143
#endif /* _STLP_LOCALE */
sl@0
   144
sl@0
   145
sl@0
   146
// Local Variables:
sl@0
   147
// mode:C++
sl@0
   148
// End: