epoc32/include/stdapis/stlportv5/stl/_ctraits_fns.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
 * Copyright (c) 1999
williamr@2
     3
 * Silicon Graphics Computer Systems, Inc.
williamr@2
     4
 *
williamr@2
     5
 * Permission to use, copy, modify, distribute and sell this software
williamr@2
     6
 * and its documentation for any purpose is hereby granted without fee,
williamr@2
     7
 * provided that the above copyright notice appear in all copies and
williamr@2
     8
 * that both that copyright notice and this permission notice appear
williamr@2
     9
 * in supporting documentation.  Silicon Graphics makes no
williamr@2
    10
 * representations about the suitability of this software for any
williamr@2
    11
 * purpose.  It is provided "as is" without express or implied warranty.
williamr@4
    12
 */
williamr@2
    13
williamr@2
    14
// WARNING: This is an internal header file, included by other C++
williamr@2
    15
// standard library headers.  You should not attempt to use this header
williamr@2
    16
// file directly.
williamr@2
    17
williamr@2
    18
#ifndef _STLP_INTERNAL_CTRAITS_FUNCTIONS_H
williamr@2
    19
#define _STLP_INTERNAL_CTRAITS_FUNCTIONS_H
williamr@2
    20
williamr@4
    21
#ifndef _STLP_INTERNAL_FUNCTION_BASE_H
williamr@2
    22
#  include <stl/_function_base.h>
williamr@4
    23
#endif
williamr@2
    24
williamr@2
    25
// This file contains a few small adapters that allow a character
williamr@2
    26
// traits class to be used as a function object.
williamr@2
    27
williamr@2
    28
_STLP_BEGIN_NAMESPACE
williamr@2
    29
williamr@4
    30
_STLP_MOVE_TO_PRIV_NAMESPACE
williamr@4
    31
williamr@2
    32
template <class _Traits>
williamr@2
    33
struct _Eq_traits
williamr@2
    34
  : public binary_function<typename _Traits::char_type,
williamr@2
    35
                           typename _Traits::char_type,
williamr@4
    36
                           bool> {
williamr@2
    37
  bool operator()(const typename _Traits::char_type& __x,
williamr@2
    38
                  const typename _Traits::char_type& __y) const
williamr@4
    39
  { return _Traits::eq(__x, __y); }
williamr@2
    40
};
williamr@2
    41
williamr@2
    42
template <class _Traits>
williamr@2
    43
struct _Eq_char_bound
williamr@4
    44
  : public unary_function<typename _Traits::char_type, bool> {
williamr@2
    45
  typename _Traits::char_type __val;
williamr@2
    46
  _Eq_char_bound(typename _Traits::char_type __c) : __val(__c) {}
williamr@2
    47
  bool operator()(const typename _Traits::char_type& __x) const
williamr@4
    48
  { return _Traits::eq(__x, __val); }
williamr@2
    49
};
williamr@2
    50
williamr@2
    51
template <class _Traits>
williamr@2
    52
struct _Neq_char_bound
williamr@2
    53
  : public unary_function<typename _Traits::char_type, bool>
williamr@2
    54
{
williamr@2
    55
  typename _Traits::char_type __val;
williamr@2
    56
  _Neq_char_bound(typename _Traits::char_type __c) : __val(__c) {}
williamr@2
    57
  bool operator()(const typename _Traits::char_type& __x) const
williamr@4
    58
  { return !_Traits::eq(__x, __val); }
williamr@2
    59
};
williamr@2
    60
williamr@2
    61
template <class _Traits>
williamr@2
    62
struct _Eq_int_bound
williamr@4
    63
  : public unary_function<typename _Traits::char_type, bool> {
williamr@2
    64
  typename _Traits::int_type __val;
williamr@2
    65
williamr@2
    66
  _Eq_int_bound(typename _Traits::int_type __c) : __val(__c) {}
williamr@2
    67
  bool operator()(const typename _Traits::char_type& __x) const
williamr@4
    68
  { return _Traits::eq_int_type(_Traits::to_int_type(__x), __val); }
williamr@2
    69
};
williamr@2
    70
williamr@4
    71
#if 0
williamr@2
    72
template <class _Traits>
williamr@2
    73
struct _Lt_traits
williamr@2
    74
  : public binary_function<typename _Traits::char_type,
williamr@2
    75
                           typename _Traits::char_type,
williamr@4
    76
                           bool> {
williamr@2
    77
  bool operator()(const typename _Traits::char_type& __x,
williamr@2
    78
                  const typename _Traits::char_type& __y) const
williamr@4
    79
  { return _Traits::lt(__x, __y); }
williamr@2
    80
};
williamr@4
    81
#endif
williamr@4
    82
williamr@4
    83
_STLP_MOVE_TO_STD_NAMESPACE
williamr@2
    84
williamr@2
    85
_STLP_END_NAMESPACE
williamr@2
    86
williamr@2
    87
#endif /* _STLP_INTERNAL_CTRAITS_FUNCTIONS_H */
williamr@2
    88
williamr@2
    89
// Local Variables:
williamr@2
    90
// mode:C++
williamr@2
    91
// End: