ctype_inline.h revision 117397
1184610Salfred// Locale support -*- C++ -*-
2184610Salfred
3184610Salfred// Copyright (C) 2000 Free Software Foundation, Inc.
4184610Salfred//
5184610Salfred// This file is part of the GNU ISO C++ Library.  This library is free
6184610Salfred// software; you can redistribute it and/or modify it under the
7184610Salfred// terms of the GNU General Public License as published by the
8184610Salfred// Free Software Foundation; either version 2, or (at your option)
9184610Salfred// any later version.
10184610Salfred
11184610Salfred// This library is distributed in the hope that it will be useful,
12184610Salfred// but WITHOUT ANY WARRANTY; without even the implied warranty of
13184610Salfred// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14184610Salfred// GNU General Public License for more details.
15184610Salfred
16184610Salfred// You should have received a copy of the GNU General Public License along
17184610Salfred// with this library; see the file COPYING.  If not, write to the Free
18184610Salfred// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19184610Salfred// USA.
20184610Salfred
21184610Salfred// As a special exception, you may use this file as part of a free software
22184610Salfred// library without restriction.  Specifically, if other files instantiate
23184610Salfred// templates or use macros or inline functions from this file, or you compile
24184610Salfred// this file and link it with other files to produce an executable, this
25184610Salfred// file does not by itself cause the resulting executable to be covered by
26184610Salfred// the GNU General Public License.  This exception does not however
27184610Salfred// invalidate any other reasons why the executable file might be covered by
28184610Salfred// the GNU General Public License.
29184610Salfred
30184610Salfred//
31184610Salfred// ISO C++ 14882: 22.1  Locales
32184610Salfred//
33184610Salfred
34184610Salfred// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
35184610Salfred// functions go in ctype.cc
36184610Salfred
37188412Sthompsa  bool
38188412Sthompsa  ctype<char>::
39184610Salfred  is(mask __m, char __c) const
40184610Salfred  { return _M_table[(unsigned char)(__c)] & __m; }
41184610Salfred
42184610Salfred  const char*
43184610Salfred  ctype<char>::
44184610Salfred  is(const char* __low, const char* __high, mask* __vec) const
45184610Salfred  {
46184610Salfred    while (__low < __high)
47184610Salfred      *__vec++ = _M_table[*__low++];
48184610Salfred    return __high;
49184610Salfred  }
50184610Salfred
51184610Salfred  const char*
52184610Salfred  ctype<char>::
53184610Salfred  scan_is(mask __m, const char* __low, const char* __high) const
54184610Salfred  {
55184610Salfred    while (__low < __high && !this->is(__m, *__low))
56184610Salfred      ++__low;
57184610Salfred    return __low;
58184610Salfred  }
59184610Salfred
60184610Salfred  const char*
61184610Salfred  ctype<char>::
62184610Salfred  scan_not(mask __m, const char* __low, const char* __high) const
63184610Salfred  {
64184610Salfred    while (__low < __high && this->is(__m, *__low) != 0)
65184610Salfred      ++__low;
66184610Salfred    return __low;
67184610Salfred  }
68184610Salfred
69184610Salfred
70184610Salfred
71184610Salfred
72184610Salfred
73184610Salfred
74184610Salfred