genericopenlibs/cppstdlib/stl/src/messages.cpp
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     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 
       
    27 _STLP_DECLSPEC messages<char>::messages(_STLP_PRIV _Messages* imp) :
       
    28   locale::facet(1), _M_impl(imp) { if (imp) imp->_M_delete = true; }
       
    29 
       
    30 _STLP_DECLSPEC messages<char>::~messages()
       
    31 { if (_M_impl && _M_impl->_M_delete) delete _M_impl; }
       
    32 
       
    33 _STLP_DECLSPEC messages<char>::catalog
       
    34 messages<char>::do_open(const string& filename, const locale& l) const
       
    35 { return _M_impl->do_open(filename, l); }
       
    36 
       
    37 _STLP_DECLSPEC string
       
    38 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 
       
    42 _STLP_DECLSPEC void messages<char>::do_close(catalog cat) const
       
    43 { _M_impl->do_close(cat); }
       
    44 
       
    45 _STLP_MOVE_TO_PRIV_NAMESPACE
       
    46 
       
    47 _Messages::_Messages()
       
    48 {}
       
    49 
       
    50 _Messages::~_Messages()
       
    51 {}
       
    52 
       
    53 _STLP_DECLSPEC _Messages::catalog _Messages::do_open(const string&, const locale&) const
       
    54 { return -1; }
       
    55 
       
    56 _STLP_DECLSPEC string _Messages::do_get(catalog, int, int, const string& dfault) const
       
    57 { return dfault; }
       
    58 
       
    59 _STLP_DECLSPEC void _Messages::do_close(catalog) const
       
    60 {}
       
    61 
       
    62 _STLP_MOVE_TO_STD_NAMESPACE
       
    63 
       
    64 #if !defined (_STLP_NO_WCHAR_T)
       
    65 
       
    66 _STLP_DECLSPEC messages<wchar_t>::messages(_STLP_PRIV _Messages* imp) :
       
    67   locale::facet(1), _M_impl(imp) { if (imp) imp->_M_delete = true; }
       
    68 
       
    69 _STLP_DECLSPEC messages<wchar_t>::~messages()
       
    70 { if (_M_impl && _M_impl->_M_delete) delete _M_impl; }
       
    71 
       
    72 _STLP_DECLSPEC messages<wchar_t>::catalog
       
    73 messages<wchar_t>::do_open(const string& filename, const locale& L) const
       
    74 { return _M_impl->do_open(filename, L); }
       
    75 
       
    76 _STLP_DECLSPEC wstring
       
    77 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 
       
    81 _STLP_DECLSPEC 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
       
    87 _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: