ctype_inline.h revision 169691
1214503Srpaulo// Locale support -*- C++ -*-
2214503Srpaulo
3214503Srpaulo// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
4214503Srpaulo//
5214503Srpaulo// This file is part of the GNU ISO C++ Library.  This library is free
6214503Srpaulo// software; you can redistribute it and/or modify it under the
7214503Srpaulo// terms of the GNU General Public License as published by the
8214503Srpaulo// Free Software Foundation; either version 2, or (at your option)
9214503Srpaulo// any later version.
10214503Srpaulo
11214503Srpaulo// This library is distributed in the hope that it will be useful,
12214503Srpaulo// but WITHOUT ANY WARRANTY; without even the implied warranty of
13214503Srpaulo// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14214503Srpaulo// GNU General Public License for more details.
15214503Srpaulo
16214503Srpaulo// You should have received a copy of the GNU General Public License along
17214503Srpaulo// with this library; see the file COPYING.  If not, write to the Free
18214503Srpaulo// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19252726Srpaulo// USA.
20214503Srpaulo
21281806Srpaulo// As a special exception, you may use this file as part of a free software
22281806Srpaulo// library without restriction.  Specifically, if other files instantiate
23281806Srpaulo// templates or use macros or inline functions from this file, or you compile
24281806Srpaulo// this file and link it with other files to produce an executable, this
25281806Srpaulo// file does not by itself cause the resulting executable to be covered by
26281806Srpaulo// the GNU General Public License.  This exception does not however
27281806Srpaulo// invalidate any other reasons why the executable file might be covered by
28281806Srpaulo// the GNU General Public License.
29281806Srpaulo
30281806Srpaulo/** @file ctype_inline.h
31281806Srpaulo *  This is an internal header file, included by other library headers.
32281806Srpaulo *  You should not attempt to use it directly.
33281806Srpaulo */
34214503Srpaulo
35214503Srpaulo//
36214503Srpaulo// ISO C++ 14882: 22.1  Locales
37214503Srpaulo//
38214503Srpaulo
39214503Srpaulo// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
40214503Srpaulo// functions go in ctype.cc
41214503Srpaulo
42214503Srpaulo_GLIBCXX_BEGIN_NAMESPACE(std)
43214503Srpaulo
44214503Srpaulo  bool
45214503Srpaulo  ctype<char>::
46214503Srpaulo  is(mask __m, char __c) const
47214503Srpaulo  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
48214503Srpaulo
49214503Srpaulo  const char*
50214503Srpaulo  ctype<char>::
51214503Srpaulo  is(const char* __low, const char* __high, mask* __vec) const
52214503Srpaulo  {
53214503Srpaulo    while (__low < __high)
54281806Srpaulo      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
55214503Srpaulo    return __high;
56214503Srpaulo  }
57214503Srpaulo
58214503Srpaulo  const char*
59281806Srpaulo  ctype<char>::
60281806Srpaulo  scan_is(mask __m, const char* __low, const char* __high) const
61281806Srpaulo  {
62214503Srpaulo    while (__low < __high
63214503Srpaulo	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
64214503Srpaulo      ++__low;
65214503Srpaulo    return __low;
66214503Srpaulo  }
67214503Srpaulo
68214503Srpaulo  const char*
69214503Srpaulo  ctype<char>::
70214503Srpaulo  scan_not(mask __m, const char* __low, const char* __high) const
71214503Srpaulo  {
72214503Srpaulo    while (__low < __high
73214503Srpaulo	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
74214503Srpaulo      ++__low;
75214503Srpaulo    return __low;
76214503Srpaulo  }
77214503Srpaulo
78214503Srpaulo_GLIBCXX_END_NAMESPACE
79214503Srpaulo