1101704Smjacob// Locale support -*- C++ -*- 2139749Simp 3233425Smarius// Copyright (C) 2000, 2002 Free Software Foundation, Inc. 4147883Sscottl// 5147883Sscottl// This file is part of the GNU ISO C++ Library. This library is free 6102599Smjacob// software; you can redistribute it and/or modify it under the 7147883Sscottl// terms of the GNU General Public License as published by the 8147883Sscottl// Free Software Foundation; either version 2, or (at your option) 9102599Smjacob// any later version. 10147883Sscottl 11147883Sscottl// This library is distributed in the hope that it will be useful, 12147883Sscottl// but WITHOUT ANY WARRANTY; without even the implied warranty of 13147883Sscottl// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14147883Sscottl// GNU General Public License for more details. 15147883Sscottl 16147883Sscottl// You should have received a copy of the GNU General Public License along 17147883Sscottl// with this library; see the file COPYING. If not, write to the Free 18147883Sscottl// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19147883Sscottl// USA. 20147883Sscottl 21147883Sscottl// As a special exception, you may use this file as part of a free software 22102599Smjacob// library without restriction. Specifically, if other files instantiate 23147883Sscottl// templates or use macros or inline functions from this file, or you compile 24147883Sscottl// this file and link it with other files to produce an executable, this 25147883Sscottl// file does not by itself cause the resulting executable to be covered by 26147883Sscottl// the GNU General Public License. This exception does not however 27147883Sscottl// invalidate any other reasons why the executable file might be covered by 28147883Sscottl// the GNU General Public License. 29147883Sscottl 30147883Sscottl// 31102599Smjacob// ISO C++ 14882: 22.1 Locales 32154603Smjacob// 33101704Smjacob 34101704Smjacob// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) 35101704Smjacob// functions go in ctype.cc 36170251Sscottl 37101704Smjacob bool 38101704Smjacob ctype<char>:: 39101704Smjacob is(mask __m, char __c) const 40101704Smjacob { return (_M_table)[static_cast<unsigned char>(__c)] & __m; } 41101704Smjacob 42101704Smjacob const char* 43101704Smjacob ctype<char>:: 44101704Smjacob is(const char* __low, const char* __high, mask* __vec) const 45101704Smjacob { 46101704Smjacob while (__low < __high) 47101704Smjacob *__vec++ = (_M_table)[static_cast<unsigned char>(*__low++)]; 48101704Smjacob return __high; 49101704Smjacob } 50101704Smjacob 51101704Smjacob const char* 52101704Smjacob ctype<char>:: 53101704Smjacob scan_is(mask __m, const char* __low, const char* __high) const 54101704Smjacob { 55101704Smjacob while (__low < __high && ! this->is(__m, *__low)) 56101704Smjacob ++__low; 57101704Smjacob return __low; 58101704Smjacob } 59101704Smjacob 60101704Smjacob const char* 61101704Smjacob ctype<char>:: 62101704Smjacob scan_not(mask __m, const char* __low, const char* __high) const 63101704Smjacob { 64147883Sscottl while (__low < __high && this->is(__m, *__low)) 65147883Sscottl ++__low; 66147883Sscottl return __low; 67147883Sscottl } 68147883Sscottl