libstdc++
ctype_inline.h
Go to the documentation of this file.
00001 // Locale support -*- C++ -*-
00002 
00003 // Copyright (C) 2000, 2002, 2009, 2010 Free Software Foundation, Inc.
00004 //
00005 // This file is part of the GNU ISO C++ Library.  This library is free
00006 // software; you can redistribute it and/or modify it under the
00007 // terms of the GNU General Public License as published by the
00008 // Free Software Foundation; either version 3, or (at your option)
00009 // any later version.
00010 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 
00016 // Under Section 7 of GPL version 3, you are granted additional
00017 // permissions described in the GCC Runtime Library Exception, version
00018 // 3.1, as published by the Free Software Foundation.
00019 
00020 // You should have received a copy of the GNU General Public License and
00021 // a copy of the GCC Runtime Library Exception along with this program;
00022 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00023 // <http://www.gnu.org/licenses/>.
00024 
00025 /** @file bits/ctype_inline.h
00026  *  This is an internal header file, included by other library headers.
00027  *  Do not attempt to use it directly. @headername{locale}
00028  */
00029 
00030 //
00031 // ISO C++ 14882: 22.1  Locales
00032 //
00033 
00034 // ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
00035 // functions go in ctype.cc
00036 
00037 namespace std _GLIBCXX_VISIBILITY(default)
00038 {
00039 _GLIBCXX_BEGIN_NAMESPACE_VERSION
00040 
00041   bool
00042   ctype<char>::
00043   is(mask __m, char __c) const
00044   { return _M_table[static_cast<unsigned char>(__c)] & __m; }
00045 
00046   const char*
00047   ctype<char>::
00048   is(const char* __low, const char* __high, mask* __vec) const
00049   {
00050     while (__low < __high)
00051       *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
00052     return __high;
00053   }
00054 
00055   const char*
00056   ctype<char>::
00057   scan_is(mask __m, const char* __low, const char* __high) const
00058   {
00059     while (__low < __high
00060        && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
00061       ++__low;
00062     return __low;
00063   }
00064 
00065   const char*
00066   ctype<char>::
00067   scan_not(mask __m, const char* __low, const char* __high) const
00068   {
00069     while (__low < __high
00070        && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
00071       ++__low;
00072     return __low;
00073   }
00074 
00075 _GLIBCXX_END_NAMESPACE_VERSION
00076 } // namespace