ctype_inline.h revision 169692
11558Srgrimes// Locale support -*- C++ -*- 21558Srgrimes 31558Srgrimes// Copyright (C) 2000, 2002 Free Software Foundation, Inc. 41558Srgrimes// 51558Srgrimes// This file is part of the GNU ISO C++ Library. This library is free 61558Srgrimes// software; you can redistribute it and/or modify it under the 71558Srgrimes// terms of the GNU General Public License as published by the 81558Srgrimes// Free Software Foundation; either version 2, or (at your option) 91558Srgrimes// any later version. 101558Srgrimes 111558Srgrimes// This library is distributed in the hope that it will be useful, 121558Srgrimes// but WITHOUT ANY WARRANTY; without even the implied warranty of 131558Srgrimes// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 141558Srgrimes// GNU General Public License for more details. 151558Srgrimes 161558Srgrimes// You should have received a copy of the GNU General Public License along 171558Srgrimes// with this library; see the file COPYING. If not, write to the Free 181558Srgrimes// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 191558Srgrimes// USA. 201558Srgrimes 211558Srgrimes// As a special exception, you may use this file as part of a free software 221558Srgrimes// library without restriction. Specifically, if other files instantiate 231558Srgrimes// templates or use macros or inline functions from this file, or you compile 241558Srgrimes// this file and link it with other files to produce an executable, this 251558Srgrimes// file does not by itself cause the resulting executable to be covered by 261558Srgrimes// the GNU General Public License. This exception does not however 271558Srgrimes// invalidate any other reasons why the executable file might be covered by 281558Srgrimes// the GNU General Public License. 291558Srgrimes 301558Srgrimes/** @file ctype_inline.h 3136997Scharnier * This is an internal header file, included by other library headers. 321558Srgrimes * You should not attempt to use it directly. 3336997Scharnier */ 3436997Scharnier 3550476Speter// 361558Srgrimes// ISO C++ 14882: 22.1 Locales 371558Srgrimes// 381558Srgrimes 3971787Sphk// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) 401558Srgrimes// functions go in ctype.cc 411558Srgrimes 421558Srgrimes_GLIBCXX_BEGIN_NAMESPACE(std) 4398542Smckusick 4498542Smckusick bool 451558Srgrimes ctype<char>:: 461558Srgrimes is(mask __m, char __c) const 471558Srgrimes { return _M_table[static_cast<unsigned char>(__c)] & __m; } 48103949Smike 491558Srgrimes const char* 501558Srgrimes ctype<char>:: 511558Srgrimes is(const char* __low, const char* __high, mask* __vec) const 521558Srgrimes { 5390742Siedowse while (__low < __high) 541558Srgrimes *__vec++ = _M_table[static_cast<unsigned char>(*__low++)]; 551558Srgrimes return __high; 561558Srgrimes } 571558Srgrimes 581558Srgrimes const char* 5992837Simp ctype<char>:: 6092837Simp scan_is(mask __m, const char* __low, const char* __high) const 611558Srgrimes { 621558Srgrimes while (__low < __high 631558Srgrimes && !(_M_table[static_cast<unsigned char>(*__low)] & __m)) 641558Srgrimes ++__low; 651558Srgrimes return __low; 661558Srgrimes } 671558Srgrimes 681558Srgrimes const char* 691558Srgrimes ctype<char>:: 701558Srgrimes scan_not(mask __m, const char* __low, const char* __high) const 711558Srgrimes { 721558Srgrimes while (__low < __high 731558Srgrimes && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0) 7492837Simp ++__low; 751558Srgrimes return __low; 761558Srgrimes } 7792837Simp 781558Srgrimes_GLIBCXX_END_NAMESPACE 791558Srgrimes