188536Sjoerg// Locale support -*- C++ -*- 230302Sjoerg 330302Sjoerg// Copyright (C) 2000, 2002 Free Software Foundation, Inc. 430302Sjoerg// 530302Sjoerg// This file is part of the GNU ISO C++ Library. This library is free 630302Sjoerg// software; you can redistribute it and/or modify it under the 730302Sjoerg// terms of the GNU General Public License as published by the 830302Sjoerg// Free Software Foundation; either version 2, or (at your option) 930302Sjoerg// any later version. 1030302Sjoerg 1130302Sjoerg// This library is distributed in the hope that it will be useful, 1230302Sjoerg// but WITHOUT ANY WARRANTY; without even the implied warranty of 1330302Sjoerg// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1430302Sjoerg// GNU General Public License for more details. 1530302Sjoerg 1630302Sjoerg// You should have received a copy of the GNU General Public License along 1730302Sjoerg// with this library; see the file COPYING. If not, write to the Free 1830302Sjoerg// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 1930302Sjoerg// USA. 2030302Sjoerg 2130302Sjoerg// As a special exception, you may use this file as part of a free software 2230302Sjoerg// library without restriction. Specifically, if other files instantiate 2330302Sjoerg// templates or use macros or inline functions from this file, or you compile 2430302Sjoerg// this file and link it with other files to produce an executable, this 2550476Speter// file does not by itself cause the resulting executable to be covered by 2630302Sjoerg// the GNU General Public License. This exception does not however 2788724Sjoerg// invalidate any other reasons why the executable file might be covered by 28206622Suqs// the GNU General Public License. 2930302Sjoerg 3030302Sjoerg/** @file ctype_inline.h 3130302Sjoerg * This is an internal header file, included by other library headers. 3230302Sjoerg * You should not attempt to use it directly. 3330302Sjoerg */ 3468960Sru 3530302Sjoerg// 3630302Sjoerg// ISO C++ 14882: 22.1 Locales 3789219Sru// 3830302Sjoerg 3930302Sjoerg// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) 4030302Sjoerg// functions go in ctype.cc 4130302Sjoerg 4230302Sjoerg_GLIBCXX_BEGIN_NAMESPACE(std) 4330302Sjoerg 4430302Sjoerg bool 4530302Sjoerg ctype<char>:: 4689219Sru is(mask __m, char __c) const 4789219Sru { return (_M_table)[static_cast<unsigned char>(__c)] & __m; } 4830302Sjoerg 4930302Sjoerg const char* 5030302Sjoerg ctype<char>:: 5130302Sjoerg is(const char* __low, const char* __high, mask* __vec) const 5230302Sjoerg { 5330302Sjoerg while (__low < __high) 5430302Sjoerg *__vec++ = (_M_table)[static_cast<unsigned char>(*__low++)]; 5530302Sjoerg return __high; 5630302Sjoerg } 5789219Sru 5889219Sru const char* 5930302Sjoerg ctype<char>:: 6030302Sjoerg scan_is(mask __m, const char* __low, const char* __high) const 6130302Sjoerg { 6230302Sjoerg while (__low < __high && ! this->is(__m, *__low)) 6330302Sjoerg ++__low; 6430302Sjoerg return __low; 6530302Sjoerg } 6630302Sjoerg 6730302Sjoerg const char* 6889219Sru ctype<char>:: 6989219Sru scan_not(mask __m, const char* __low, const char* __high) const 7030302Sjoerg { 7130302Sjoerg while (__low < __high && this->is(__m, *__low)) 7230302Sjoerg ++__low; 7330302Sjoerg return __low; 7430302Sjoerg } 7530302Sjoerg 7630302Sjoerg_GLIBCXX_END_NAMESPACE 7730302Sjoerg