1 /*
2  * Copyright (c) 1999
3  * Silicon Graphics Computer Systems, Inc.
4  *
5  * Copyright (c) 1999
6  * Boris Fomitchev
7  *
8  * This material is provided "as is", with absolutely no warranty expressed
9  * or implied. Any use is at your own risk.
10  *
11  * Permission to use or copy this software for any purpose is hereby granted
12  * without fee, provided the above notices are retained on all copies.
13  * Permission to modify the code and to distribute modified code is granted,
14  * provided the above notices are retained, and a notice that the code was
15  * modified is included with the above copyright notice.
16  *
17  */
18 #include "stlport_prefix.h"
19 
20 #include "message_facets.h"
21 
22 _STLP_BEGIN_NAMESPACE
23 
24 //----------------------------------------------------------------------
25 // messages<char>
26 
messages(_STLP_PRIV _Messages * imp)27 messages<char>::messages(_STLP_PRIV _Messages* imp) :
28   locale::facet(1), _M_impl(imp) { if (imp) imp->_M_delete = true; }
29 
~messages()30 messages<char>::~messages()
31 { if (_M_impl && _M_impl->_M_delete) delete _M_impl; }
32 
33 messages<char>::catalog
do_open(const string & filename,const locale & l) const34 messages<char>::do_open(const string& filename, const locale& l) const
35 { return _M_impl->do_open(filename, l); }
36 
37 string
do_get(catalog cat,int set,int p_id,const string & dfault) const38 messages<char>::do_get(catalog cat, int set, int p_id,
39                        const string& dfault) const
40 { return _M_impl->do_get(cat, set, p_id, dfault); }
41 
do_close(catalog cat) const42 void messages<char>::do_close(catalog cat) const
43 { _M_impl->do_close(cat); }
44 
45 _STLP_MOVE_TO_PRIV_NAMESPACE
46 
_Messages()47 _Messages::_Messages()
48 {}
49 
~_Messages()50 _Messages::~_Messages()
51 {}
52 
do_open(const string &,const locale &) const53 _Messages::catalog _Messages::do_open(const string&, const locale&) const
54 { return -1; }
55 
do_get(catalog,int,int,const string & dfault) const56 string _Messages::do_get(catalog, int, int, const string& dfault) const
57 { return dfault; }
58 
do_close(catalog) const59 void _Messages::do_close(catalog) const
60 {}
61 
62 _STLP_MOVE_TO_STD_NAMESPACE
63 
64 #if !defined (_STLP_NO_WCHAR_T)
65 
messages(_STLP_PRIV _Messages * imp)66 messages<wchar_t>::messages(_STLP_PRIV _Messages* imp) :
67   locale::facet(1), _M_impl(imp) { if (imp) imp->_M_delete = true; }
68 
~messages()69 messages<wchar_t>::~messages()
70 { if (_M_impl && _M_impl->_M_delete) delete _M_impl; }
71 
72 messages<wchar_t>::catalog
do_open(const string & filename,const locale & L) const73 messages<wchar_t>::do_open(const string& filename, const locale& L) const
74 { return _M_impl->do_open(filename, L); }
75 
76 wstring
do_get(catalog thecat,int set,int p_id,const wstring & dfault) const77 messages<wchar_t>::do_get(catalog thecat,
78                           int set, int p_id, const wstring& dfault) const
79 { return _M_impl->do_get(thecat, set, p_id, dfault); }
80 
do_close(catalog cat) const81 void messages<wchar_t>::do_close(catalog cat) const
82 { _M_impl->do_close(cat); }
83 
84 _STLP_MOVE_TO_PRIV_NAMESPACE
85 
86 wstring
do_get(catalog,int,int,const wstring & dfault) const87 _Messages::do_get(catalog, int, int, const wstring& dfault) const
88 { return dfault; }
89 
90 _STLP_MOVE_TO_STD_NAMESPACE
91 
92 #endif
93 
94 _STLP_END_NAMESPACE
95 
96 // Local Variables:
97 // mode:C++
98 // End:
99