ctype_noninline.h revision 169692
12116Sjkh// Locale support -*- C++ -*- 22116Sjkh 32116Sjkh// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. 42116Sjkh// 52116Sjkh// This file is part of the GNU ISO C++ Library. This library is free 62116Sjkh// software; you can redistribute it and/or modify it under the 72116Sjkh// terms of the GNU General Public License as published by the 82116Sjkh// Free Software Foundation; either version 2, or (at your option) 92116Sjkh// any later version. 102116Sjkh 112116Sjkh// This library is distributed in the hope that it will be useful, 122116Sjkh// but WITHOUT ANY WARRANTY; without even the implied warranty of 132116Sjkh// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 142116Sjkh// GNU General Public License for more details. 152116Sjkh 162116Sjkh// You should have received a copy of the GNU General Public License along 172116Sjkh// with this library; see the file COPYING. If not, write to the Free 182116Sjkh// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 192116Sjkh// USA. 202116Sjkh 212116Sjkh// As a special exception, you may use this file as part of a free software 222116Sjkh// library without restriction. Specifically, if other files instantiate 232116Sjkh// templates or use macros or inline functions from this file, or you compile 242116Sjkh// this file and link it with other files to produce an executable, this 252116Sjkh// file does not by itself cause the resulting executable to be covered by 262116Sjkh// the GNU General Public License. This exception does not however 272116Sjkh// invalidate any other reasons why the executable file might be covered by 282116Sjkh// the GNU General Public License. 2950476Speter 302116Sjkh/** @file ctype_noninline.h 31140171Sstefanf * This is an internal header file, included by other library headers. 322116Sjkh * You should not attempt to use it directly. 332116Sjkh */ 342116Sjkh 356794Sjkh// 36140143Sstefanf// ISO C++ 14882: 22.1 Locales 37140143Sstefanf// 3884885Sbde 3984881Sbde// Information as gleaned from /usr/include/ctype.h 4084881Sbde 412116Sjkh const ctype_base::mask* 4284306Sru ctype<char>::classic_table() throw() 432116Sjkh { return 0; } 442116Sjkh 456794Sjkh ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 466794Sjkh size_t __refs) 47140174Sru : facet(__refs), _M_del(__table != 0 && __del), 48140143Sstefanf _M_toupper(NULL), _M_tolower(NULL), 492116Sjkh _M_table(__table ? __table : classic_table()) 502116Sjkh { 51140143Sstefanf memset(_M_widen, 0, sizeof(_M_widen)); 52140143Sstefanf _M_widen_ok = 0; 53140174Sru memset(_M_narrow, 0, sizeof(_M_narrow)); 54140143Sstefanf _M_narrow_ok = 0; 5586712Sru } 562116Sjkh 5784885Sbde ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 5884885Sbde : facet(__refs), _M_del(__table != 0 && __del), 592116Sjkh _M_toupper(NULL), _M_tolower(NULL), 602116Sjkh _M_table(__table ? __table : classic_table()) 612116Sjkh { 622116Sjkh memset(_M_widen, 0, sizeof(_M_widen)); 632116Sjkh _M_widen_ok = 0; 6421907Swosch memset(_M_narrow, 0, sizeof(_M_narrow)); 65130770Sdas _M_narrow_ok = 0; 66130770Sdas } 67130770Sdas 682116Sjkh char 692116Sjkh ctype<char>::do_toupper(char __c) const 702116Sjkh { return ::toupper((int) __c); } 712116Sjkh 7273088Sru const char* 73140143Sstefanf ctype<char>::do_toupper(char* __low, const char* __high) const 74140143Sstefanf { 75140174Sru while (__low < __high) 76140143Sstefanf { 77140143Sstefanf *__low = ::toupper((int) *__low); 78140143Sstefanf ++__low; 79 } 80 return __high; 81 } 82 83 char 84 ctype<char>::do_tolower(char __c) const 85 { return ::tolower((int) __c); } 86 87 const char* 88 ctype<char>::do_tolower(char* __low, const char* __high) const 89 { 90 while (__low < __high) 91 { 92 *__low = ::tolower((int) *__low); 93 ++__low; 94 } 95 return __high; 96 } 97