localefwd.h revision 132720
1// Locale support -*- C++ -*- 2 3// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 4// Free Software Foundation, Inc. 5// 6// This file is part of the GNU ISO C++ Library. This library is free 7// software; you can redistribute it and/or modify it under the 8// terms of the GNU General Public License as published by the 9// Free Software Foundation; either version 2, or (at your option) 10// any later version. 11 12// This library is distributed in the hope that it will be useful, 13// but WITHOUT ANY WARRANTY; without even the implied warranty of 14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15// GNU General Public License for more details. 16 17// You should have received a copy of the GNU General Public License along 18// with this library; see the file COPYING. If not, write to the Free 19// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 20// USA. 21 22// As a special exception, you may use this file as part of a free software 23// library without restriction. Specifically, if other files instantiate 24// templates or use macros or inline functions from this file, or you compile 25// this file and link it with other files to produce an executable, this 26// file does not by itself cause the resulting executable to be covered by 27// the GNU General Public License. This exception does not however 28// invalidate any other reasons why the executable file might be covered by 29// the GNU General Public License. 30 31// 32// ISO C++ 14882: 22.1 Locales 33// 34 35/** @file localefwd.h 36 * This is an internal header file, included by other library headers. 37 * You should not attempt to use it directly. 38 */ 39 40#ifndef _LOCALE_FWD_H 41#define _LOCALE_FWD_H 1 42 43#pragma GCC system_header 44 45#include <bits/c++config.h> 46#include <bits/c++locale.h> // Defines __c_locale, config-specific includes 47#include <iosfwd> // For ostreambuf_iterator, istreambuf_iterator 48#include <bits/functexcept.h> 49 50namespace std 51{ 52 // 22.1.1 Locale 53 class locale; 54 55 // 22.1.3 Convenience interfaces 56 template<typename _CharT> 57 inline bool 58 isspace(_CharT, const locale&); 59 60 template<typename _CharT> 61 inline bool 62 isprint(_CharT, const locale&); 63 64 template<typename _CharT> 65 inline bool 66 iscntrl(_CharT, const locale&); 67 68 template<typename _CharT> 69 inline bool 70 isupper(_CharT, const locale&); 71 72 template<typename _CharT> 73 inline bool 74 islower(_CharT, const locale&); 75 76 template<typename _CharT> 77 inline bool 78 isalpha(_CharT, const locale&); 79 80 template<typename _CharT> 81 inline bool 82 isdigit(_CharT, const locale&); 83 84 template<typename _CharT> 85 inline bool 86 ispunct(_CharT, const locale&); 87 88 template<typename _CharT> 89 inline bool 90 isxdigit(_CharT, const locale&); 91 92 template<typename _CharT> 93 inline bool 94 isalnum(_CharT, const locale&); 95 96 template<typename _CharT> 97 inline bool 98 isgraph(_CharT, const locale&); 99 100 template<typename _CharT> 101 inline _CharT 102 toupper(_CharT, const locale&); 103 104 template<typename _CharT> 105 inline _CharT 106 tolower(_CharT, const locale&); 107 108 // 22.2.1 and 22.2.1.3 ctype 109 class ctype_base; 110 template<typename _CharT> 111 class ctype; 112 template<> class ctype<char>; 113#ifdef _GLIBCXX_USE_WCHAR_T 114 template<> class ctype<wchar_t>; 115#endif 116 template<typename _CharT> 117 class ctype_byname; 118 // NB: Specialized for char and wchar_t in locale_facets.h. 119 120 class codecvt_base; 121 class __enc_traits; 122 template<typename _InternT, typename _ExternT, typename _StateT> 123 class codecvt; 124 template<> class codecvt<char, char, mbstate_t>; 125#ifdef _GLIBCXX_USE_WCHAR_T 126 template<> class codecvt<wchar_t, char, mbstate_t>; 127#endif 128 template<typename _InternT, typename _ExternT, typename _StateT> 129 class codecvt_byname; 130 131 // 22.2.2 and 22.2.3 numeric 132 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> > 133 class num_get; 134 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> > 135 class num_put; 136 template<typename _CharT> class numpunct; 137 template<typename _CharT> class numpunct_byname; 138 139 // 22.2.4 collation 140 template<typename _CharT> 141 class collate; 142 template<typename _CharT> class 143 collate_byname; 144 145 // 22.2.5 date and time 146 class time_base; 147 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> > 148 class time_get; 149 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> > 150 class time_get_byname; 151 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> > 152 class time_put; 153 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> > 154 class time_put_byname; 155 156 // 22.2.6 money 157 class money_base; 158 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> > 159 class money_get; 160 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> > 161 class money_put; 162 template<typename _CharT, bool _Intl = false> 163 class moneypunct; 164 template<typename _CharT, bool _Intl = false> 165 class moneypunct_byname; 166 167 // 22.2.7 message retrieval 168 class messages_base; 169 template<typename _CharT> 170 class messages; 171 template<typename _CharT> 172 class messages_byname; 173 174 template<typename _Facet> 175 bool 176 has_facet(const locale& __loc) throw(); 177 178 template<typename _Facet> 179 const _Facet& 180 use_facet(const locale& __loc); 181 182 template<typename _Facet> 183 inline const _Facet& 184 __check_facet(const _Facet* __f) 185 { 186 if (!__f) 187 __throw_bad_cast(); 188 return *__f; 189 } 190} // namespace std 191 192#endif 193