]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libstdc++-v3/contrib/libstdc++-v3-4.3.3/config/locale/generic/messages_members.h
update
[l4.git] / l4 / pkg / libstdc++-v3 / contrib / libstdc++-v3-4.3.3 / config / locale / generic / messages_members.h
1 // std::messages implementation details, generic version -*- C++ -*-
2
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.
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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
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 /** @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.
34  */
35
36 //
37 // ISO C++ 14882: 22.2.7.1.2  messages virtual functions
38 //
39
40 // Written by Benjamin Kosnik <bkoz@redhat.com>
41
42 _GLIBCXX_BEGIN_NAMESPACE(std)
43
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(); }
49
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(); }
54
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); }
60
61   // Virtual member functions.
62   template<typename _CharT>
63     messages<_CharT>::~messages()
64     { _S_destroy_c_locale(_M_c_locale_messages); }
65
66   template<typename _CharT>
67     typename messages<_CharT>::catalog 
68     messages<_CharT>::do_open(const basic_string<char>&, const locale&) const
69     { return 0; }
70
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; }
76
77   template<typename _CharT>
78     void    
79     messages<_CharT>::do_close(catalog) const 
80     { }
81
82    // messages_byname
83    template<typename _CharT>
84      messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
85      : messages<_CharT>(__refs) 
86      { 
87         if (__builtin_strcmp(__s, "C") != 0
88             && __builtin_strcmp(__s, "POSIX") != 0)
89           {
90             this->_S_destroy_c_locale(this->_M_c_locale_messages);
91             this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
92           }
93      }
94
95 _GLIBCXX_END_NAMESPACE