1142215Sglebius// Locale support -*- C++ -*-
2142215Sglebius
3142215Sglebius// Copyright (C) 2000-2015 Free Software Foundation, Inc.
4142215Sglebius//
5142215Sglebius// This file is part of the GNU ISO C++ Library.  This library is free
6142215Sglebius// software; you can redistribute it and/or modify it under the
7142215Sglebius// terms of the GNU General Public License as published by the
8142215Sglebius// Free Software Foundation; either version 3, or (at your option)
9142215Sglebius// any later version.
10142215Sglebius
11142215Sglebius// This library is distributed in the hope that it will be useful,
12142215Sglebius// but WITHOUT ANY WARRANTY; without even the implied warranty of
13142215Sglebius// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14142215Sglebius// GNU General Public License for more details.
15142215Sglebius
16142215Sglebius// Under Section 7 of GPL version 3, you are granted additional
17142215Sglebius// permissions described in the GCC Runtime Library Exception, version
18142215Sglebius// 3.1, as published by the Free Software Foundation.
19142215Sglebius
20142215Sglebius// You should have received a copy of the GNU General Public License and
21142215Sglebius// a copy of the GCC Runtime Library Exception along with this program;
22142215Sglebius// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23142215Sglebius// <http://www.gnu.org/licenses/>.
24142215Sglebius
25142215Sglebius/** @file bits/ctype_inline.h
26142215Sglebius *  This is an internal header file, included by other library headers.
27172467Ssilby *  Do not attempt to use it directly. @headername{locale}
28172467Ssilby */
29172467Ssilby
30142215Sglebius//
31142215Sglebius// ISO C++ 14882: 22.1  Locales
32142215Sglebius//
33142215Sglebius
34142215Sglebius// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
35142215Sglebius// functions go in ctype.cc
36142215Sglebius
37142215Sglebiusnamespace std _GLIBCXX_VISIBILITY(default)
38142215Sglebius{
39142215Sglebius_GLIBCXX_BEGIN_NAMESPACE_VERSION
40142215Sglebius
41142215Sglebius  bool
42142215Sglebius  ctype<char>::
43142215Sglebius  is(mask __m, char __c) const
44142215Sglebius  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
45164033Srwatson
46142215Sglebius  const char*
47142215Sglebius  ctype<char>::
48142215Sglebius  is(const char* __low, const char* __high, mask* __vec) const
49142215Sglebius  {
50142215Sglebius    while (__low < __high)
51142215Sglebius      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
52142215Sglebius    return __high;
53142215Sglebius  }
54142215Sglebius
55142215Sglebius  const char*
56142215Sglebius  ctype<char>::
57142215Sglebius  scan_is(mask __m, const char* __low, const char* __high) const
58142215Sglebius  {
59142215Sglebius    while (__low < __high
60142215Sglebius	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
61142215Sglebius      ++__low;
62142215Sglebius    return __low;
63142215Sglebius  }
64152410Sru
65142215Sglebius  const char*
66142215Sglebius  ctype<char>::
67142215Sglebius  scan_not(mask __m, const char* __low, const char* __high) const
68142215Sglebius  {
69142215Sglebius    while (__low < __high
70142215Sglebius	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
71142215Sglebius      ++__low;
72142215Sglebius    return __low;
73142215Sglebius  }
74142215Sglebius
75142215Sglebius_GLIBCXX_END_NAMESPACE_VERSION
76142215Sglebius} // namespace
77142215Sglebius