ctype_inline.h revision 169691
1251881Speter// Locale support -*- C++ -*- 2251881Speter 3251881Speter// Copyright (C) 2000, 2003 Free Software Foundation, Inc. 4251881Speter// 5251881Speter// This file is part of the GNU ISO C++ Library. This library is free 6251881Speter// software; you can redistribute it and/or modify it under the 7251881Speter// terms of the GNU General Public License as published by the 8251881Speter// Free Software Foundation; either version 2, or (at your option) 9251881Speter// any later version. 10251881Speter 11251881Speter// This library is distributed in the hope that it will be useful, 12251881Speter// but WITHOUT ANY WARRANTY; without even the implied warranty of 13251881Speter// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14251881Speter// GNU General Public License for more details. 15251881Speter 16251881Speter// You should have received a copy of the GNU General Public License along 17251881Speter// with this library; see the file COPYING. If not, write to the Free 18251881Speter// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19251881Speter// USA. 20251881Speter 21251881Speter// As a special exception, you may use this file as part of a free software 22251881Speter// library without restriction. Specifically, if other files instantiate 23251881Speter// templates or use macros or inline functions from this file, or you compile 24251881Speter// this file and link it with other files to produce an executable, this 25251881Speter// file does not by itself cause the resulting executable to be covered by 26251881Speter// the GNU General Public License. This exception does not however 27251881Speter// invalidate any other reasons why the executable file might be covered by 28251881Speter// the GNU General Public License. 29251881Speter 30251881Speter/** @file ctype_inline.h 31251881Speter * This is an internal header file, included by other library headers. 32251881Speter * You should not attempt to use it directly. 33251881Speter */ 34251881Speter 35251881Speter// 36251881Speter// ISO C++ 14882: 22.1 Locales 37251881Speter// 38251881Speter 39251881Speter// Information as gleaned from target/h/ctype.h 40251881Speter 41251881Speter// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) 42251881Speter// functions go in ctype.cc 43251881Speter 44251881Speter_GLIBCXX_BEGIN_NAMESPACE(std) 45251881Speter 46251881Speter bool 47251881Speter ctype<char>:: 48251881Speter is(mask __m, char __c) const 49251881Speter { return __ctype[static_cast<unsigned char>(__c)] & __m; } 50251881Speter 51251881Speter const char* 52251881Speter ctype<char>:: 53251881Speter is(const char* __low, const char* __high, mask* __vec) const 54251881Speter { 55251881Speter while (__low < __high) 56251881Speter *__vec++ = __ctype[static_cast<unsigned char>(*__low++)]; 57251881Speter return __high; 58251881Speter } 59251881Speter 60251881Speter const char* 61251881Speter ctype<char>:: 62251881Speter scan_is(mask __m, const char* __low, const char* __high) const 63251881Speter { 64251881Speter while (__low < __high 65251881Speter && !(__ctype[static_cast<unsigned char>(*__low)] & __m)) 66251881Speter ++__low; 67251881Speter return __low; 68251881Speter } 69251881Speter 70251881Speter const char* 71251881Speter ctype<char>:: 72251881Speter scan_not(mask __m, const char* __low, const char* __high) const 73251881Speter { 74251881Speter while (__low < __high 75251881Speter && (__ctype[static_cast<unsigned char>(*__low)] & __m)) 76251881Speter ++__low; 77251881Speter return __low; 78251881Speter } 79251881Speter 80251881Speter_GLIBCXX_END_NAMESPACE 81251881Speter