ctype_inline.h revision 169691
180028Stakawata// Locale support -*- C++ -*-
280028Stakawata
380028Stakawata// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
480028Stakawata//
580028Stakawata// This file is part of the GNU ISO C++ Library.  This library is free
680028Stakawata// software; you can redistribute it and/or modify it under the
780028Stakawata// terms of the GNU General Public License as published by the
880028Stakawata// Free Software Foundation; either version 2, or (at your option)
980028Stakawata// any later version.
1080028Stakawata
1180028Stakawata// This library is distributed in the hope that it will be useful,
1280028Stakawata// but WITHOUT ANY WARRANTY; without even the implied warranty of
1380028Stakawata// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1480028Stakawata// GNU General Public License for more details.
1580028Stakawata
1680028Stakawata// You should have received a copy of the GNU General Public License along
1780028Stakawata// with this library; see the file COPYING.  If not, write to the Free
1880028Stakawata// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1980028Stakawata// USA.
2080028Stakawata
2180028Stakawata// As a special exception, you may use this file as part of a free software
2280028Stakawata// library without restriction.  Specifically, if other files instantiate
2380028Stakawata// templates or use macros or inline functions from this file, or you compile
2480028Stakawata// this file and link it with other files to produce an executable, this
2580028Stakawata// file does not by itself cause the resulting executable to be covered by
2680028Stakawata// the GNU General Public License.  This exception does not however
2780028Stakawata// invalidate any other reasons why the executable file might be covered by
28115681Sobrien// the GNU General Public License.
29115681Sobrien
30115681Sobrien/** @file ctype_inline.h
3180028Stakawata *  This is an internal header file, included by other library headers.
3280028Stakawata *  You should not attempt to use it directly.
3380028Stakawata */
3480028Stakawata
3580028Stakawata//
3680028Stakawata// ISO C++ 14882: 22.1  Locales
3780028Stakawata//
3880028Stakawata
3980028Stakawata// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
4080028Stakawata// functions go in ctype.cc
4180028Stakawata
4280028Stakawata_GLIBCXX_BEGIN_NAMESPACE(std)
4380028Stakawata
4480028Stakawata  bool
45121603Snjl  ctype<char>::
46121603Snjl  is(mask __m, char __c) const
47121603Snjl  { return (_M_table)[static_cast<unsigned char>(__c)] & __m; }
48121603Snjl
49121603Snjl  const char*
50121603Snjl  ctype<char>::
51121603Snjl  is(const char* __low, const char* __high, mask* __vec) const
52121603Snjl  {
53121603Snjl    while (__low < __high)
5480028Stakawata      *__vec++ = (_M_table)[static_cast<unsigned char>(*__low++)];
5580028Stakawata    return __high;
5680028Stakawata  }
5780028Stakawata
5880028Stakawata  const char*
5980028Stakawata  ctype<char>::
6080028Stakawata  scan_is(mask __m, const char* __low, const char* __high) const
6180028Stakawata  {
6280028Stakawata    while (__low < __high && ! this->is(__m, *__low))
6380028Stakawata      ++__low;
6480028Stakawata    return __low;
6580028Stakawata  }
6680028Stakawata
6780028Stakawata  const char*
6880028Stakawata  ctype<char>::
6980028Stakawata  scan_not(mask __m, const char* __low, const char* __high) const
7080028Stakawata  {
7180028Stakawata    while (__low < __high && this->is(__m, *__low))
7280028Stakawata      ++__low;
7380028Stakawata    return __low;
7480028Stakawata  }
7580028Stakawata
7680028Stakawata_GLIBCXX_END_NAMESPACE
7780028Stakawata