# ctype_inline.h

Go to the documentation of this file.

    00001 // Locale support -*- C++ -*-
    00002
    00003 // Copyright (C) 2000, 2002, 2009 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 ctype_inline.h
    00026  *  This is an internal header file, included by other library headers.
    00027  *  You should not attempt to use it directly.
    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 _GLIBCXX_BEGIN_NAMESPACE(std)
    00038
    00039   bool
    00040   ctype<char>::
    00041   is(mask __m, char __c) const
    00042   { return _M_table[static_cast<unsigned char>(__c)] & __m; }
    00043
    00044   const char*
    00045   ctype<char>::
    00046   is(const char* __low, const char* __high, mask* __vec) const
    00047   {
    00048     while (__low < __high)
    00049       *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
    00050     return __high;
    00051   }
    00052
    00053   const char*
    00054   ctype<char>::
    00055   scan_is(mask __m, const char* __low, const char* __high) const
    00056   {
    00057     while (__low < __high
    00058        && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
    00059       ++__low;
    00060     return __low;
    00061   }
    00062
    00063   const char*
    00064   ctype<char>::
    00065   scan_not(mask __m, const char* __low, const char* __high) const
    00066   {
    00067     while (__low < __high
    00068        && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
    00069       ++__low;
    00070     return __low;
    00071   }
    00072
    00073 _GLIBCXX_END_NAMESPACE