ctype_inline.h revision 169691
157416Smarkm// Locale support -*- C++ -*- 257416Smarkm 357416Smarkm// Copyright (C) 2000, 2002 Free Software Foundation, Inc. 457416Smarkm// 557416Smarkm// This file is part of the GNU ISO C++ Library. This library is free 657416Smarkm// software; you can redistribute it and/or modify it under the 757416Smarkm// terms of the GNU General Public License as published by the 857416Smarkm// Free Software Foundation; either version 2, or (at your option) 957416Smarkm// any later version. 1057416Smarkm 1157416Smarkm// This library is distributed in the hope that it will be useful, 1257416Smarkm// but WITHOUT ANY WARRANTY; without even the implied warranty of 1357416Smarkm// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1457416Smarkm// GNU General Public License for more details. 1557416Smarkm 1657416Smarkm// You should have received a copy of the GNU General Public License along 1757416Smarkm// with this library; see the file COPYING. If not, write to the Free 1857416Smarkm// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 1957416Smarkm// USA. 2057416Smarkm 2157416Smarkm// As a special exception, you may use this file as part of a free software 2257416Smarkm// library without restriction. Specifically, if other files instantiate 2357416Smarkm// templates or use macros or inline functions from this file, or you compile 2457416Smarkm// this file and link it with other files to produce an executable, this 2557416Smarkm// file does not by itself cause the resulting executable to be covered by 2657416Smarkm// the GNU General Public License. This exception does not however 2757416Smarkm// invalidate any other reasons why the executable file might be covered by 2857416Smarkm// the GNU General Public License. 2957416Smarkm 3057416Smarkm/** @file ctype_inline.h 3157416Smarkm * This is an internal header file, included by other library headers. 3257416Smarkm * You should not attempt to use it directly. 3357416Smarkm */ 3457416Smarkm 3557416Smarkm// 36233294Sstas// ISO C++ 14882: 22.1 Locales 3757416Smarkm// 3857416Smarkm 3957416Smarkm// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) 4057416Smarkm// functions go in ctype.cc 4157416Smarkm 4257416Smarkm_GLIBCXX_BEGIN_NAMESPACE(std) 4357416Smarkm 4457416Smarkm bool 4557416Smarkm ctype<char>:: 4657416Smarkm is(mask __m, char __c) const 4757416Smarkm { return _M_table[static_cast<unsigned char>(__c)] & __m; } 4857416Smarkm 4957416Smarkm const char* 5057416Smarkm ctype<char>:: 5157416Smarkm is(const char* __low, const char* __high, mask* __vec) const 5257416Smarkm { 5357416Smarkm while (__low < __high) 5457416Smarkm *__vec++ = _M_table[static_cast<unsigned char>(*__low++)]; 5557416Smarkm return __high; 5657416Smarkm } 5757416Smarkm 5857416Smarkm const char* 5957416Smarkm ctype<char>:: 6057416Smarkm scan_is(mask __m, const char* __low, const char* __high) const 6157416Smarkm { 6257416Smarkm while (__low < __high 6357416Smarkm && !(_M_table[static_cast<unsigned char>(*__low)] & __m)) 6457416Smarkm ++__low; 6557416Smarkm return __low; 6657416Smarkm } 6757416Smarkm 6857416Smarkm const char* 6957416Smarkm ctype<char>:: 7057416Smarkm scan_not(mask __m, const char* __low, const char* __high) const 7157416Smarkm { 7257416Smarkm while (__low < __high 7357416Smarkm && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0) 7457416Smarkm ++__low; 7557416Smarkm return __low; 7657416Smarkm } 7757416Smarkm 7857416Smarkm_GLIBCXX_END_NAMESPACE 7957416Smarkm