ctype_inline.h revision 169691
1139825Simp// Locale support -*- C++ -*- 238363Swpaul 338363Swpaul// Copyright (C) 2000, 2002 Free Software Foundation, Inc. 438363Swpaul// 538363Swpaul// This file is part of the GNU ISO C++ Library. This library is free 638363Swpaul// software; you can redistribute it and/or modify it under the 738363Swpaul// terms of the GNU General Public License as published by the 838363Swpaul// Free Software Foundation; either version 2, or (at your option) 938363Swpaul// any later version. 1038363Swpaul 1138363Swpaul// This library is distributed in the hope that it will be useful, 1238363Swpaul// but WITHOUT ANY WARRANTY; without even the implied warranty of 1338363Swpaul// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1438363Swpaul// GNU General Public License for more details. 1538363Swpaul 1638363Swpaul// You should have received a copy of the GNU General Public License along 1738363Swpaul// with this library; see the file COPYING. If not, write to the Free 1838363Swpaul// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 1938363Swpaul// USA. 2038363Swpaul 2138363Swpaul// As a special exception, you may use this file as part of a free software 2238363Swpaul// library without restriction. Specifically, if other files instantiate 2338363Swpaul// templates or use macros or inline functions from this file, or you compile 2438363Swpaul// this file and link it with other files to produce an executable, this 2538363Swpaul// file does not by itself cause the resulting executable to be covered by 2638363Swpaul// the GNU General Public License. This exception does not however 2738363Swpaul// invalidate any other reasons why the executable file might be covered by 2838363Swpaul// the GNU General Public License. 2938363Swpaul 3038363Swpaul/** @file ctype_inline.h 3138363Swpaul * This is an internal header file, included by other library headers. 3250477Speter * You should not attempt to use it directly. 3338363Swpaul */ 3438363Swpaul 3538363Swpaul// 3638363Swpaul// ISO C++ 14882: 22.1 Locales 3738363Swpaul// 3838363Swpaul 3967233Simp// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) 4038363Swpaul// functions go in ctype.cc 4138363Swpaul 4238363Swpaul_GLIBCXX_BEGIN_NAMESPACE(std) 4338363Swpaul 4438363Swpaul bool 4538363Swpaul ctype<char>:: 4638363Swpaul is(mask __m, char __c) const 4738363Swpaul { return (_M_table)[static_cast<unsigned char>(__c)] & __m; } 4838363Swpaul 4938363Swpaul const char* 5038363Swpaul ctype<char>:: 5138363Swpaul is(const char* __low, const char* __high, mask* __vec) const 5238363Swpaul { 53131596Sbms while (__low < __high) 5438363Swpaul *__vec++ = (_M_table)[static_cast<unsigned char>(*__low++)]; 5538363Swpaul return __high; 5638363Swpaul } 5738363Swpaul 5838363Swpaul const char* 5938363Swpaul ctype<char>:: 6038363Swpaul scan_is(mask __m, const char* __low, const char* __high) const 6138363Swpaul { 6238363Swpaul while (__low < __high && ! this->is(__m, *__low)) 6338363Swpaul ++__low; 6438363Swpaul return __low; 6538363Swpaul } 6638363Swpaul 6738363Swpaul const char* 6838363Swpaul ctype<char>:: 6938363Swpaul scan_not(mask __m, const char* __low, const char* __high) const 7038363Swpaul { 7138363Swpaul while (__low < __high && this->is(__m, *__low)) 7238363Swpaul ++__low; 7338363Swpaul return __low; 7438363Swpaul } 7538363Swpaul 7638363Swpaul_GLIBCXX_END_NAMESPACE 7738363Swpaul