Install gcc-4.4.0-tdm-1-core-2.tar.gz
[msysgit.git] / mingw / lib / gcc / mingw32 / 4.3.3 / include / c++ / mingw32 / bits / messages_members.h
blobf82f2f2b6460429065ee1c51023af9ae1bae7f62
1 // std::messages implementation details, generic version -*- C++ -*-
3 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
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.
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.
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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20 // USA.
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.
31 /** @file messages_members.h
32 * This is an internal header file, included by other library headers.
33 * You should not attempt to use it directly.
37 // ISO C++ 14882: 22.2.7.1.2 messages virtual functions
40 // Written by Benjamin Kosnik <bkoz@redhat.com>
42 _GLIBCXX_BEGIN_NAMESPACE(std)
44 // Non-virtual member functions.
45 template<typename _CharT>
46 messages<_CharT>::messages(size_t __refs)
47 : facet(__refs)
48 { _M_c_locale_messages = _S_get_c_locale(); }
50 template<typename _CharT>
51 messages<_CharT>::messages(__c_locale, const char*, size_t __refs)
52 : facet(__refs)
53 { _M_c_locale_messages = _S_get_c_locale(); }
55 template<typename _CharT>
56 typename messages<_CharT>::catalog
57 messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
58 const char*) const
59 { return this->do_open(__s, __loc); }
61 // Virtual member functions.
62 template<typename _CharT>
63 messages<_CharT>::~messages()
64 { _S_destroy_c_locale(_M_c_locale_messages); }
66 template<typename _CharT>
67 typename messages<_CharT>::catalog
68 messages<_CharT>::do_open(const basic_string<char>&, const locale&) const
69 { return 0; }
71 template<typename _CharT>
72 typename messages<_CharT>::string_type
73 messages<_CharT>::do_get(catalog, int, int,
74 const string_type& __dfault) const
75 { return __dfault; }
77 template<typename _CharT>
78 void
79 messages<_CharT>::do_close(catalog) const
80 { }
82 // messages_byname
83 template<typename _CharT>
84 messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
85 : messages<_CharT>(__refs)
87 if (__builtin_strcmp(__s, "C") != 0
88 && __builtin_strcmp(__s, "POSIX") != 0)
90 this->_S_destroy_c_locale(this->_M_c_locale_messages);
91 this->_S_create_c_locale(this->_M_c_locale_messages, __s);
95 _GLIBCXX_END_NAMESPACE