diff -r 000000000000 -r e4d67989cc36 stdcpp/src/messages.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdcpp/src/messages.cpp Tue Feb 02 02:01:42 2010 +0200 @@ -0,0 +1,112 @@ +/* + * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved. + * Copyright (c) 1999 + * Silicon Graphics Computer Systems, Inc. + * + * Copyright (c) 1999 + * Boris Fomitchev + * + * This material is provided "as is", with absolutely no warranty expressed + * or implied. Any use is at your own risk. + * + * Permission to use or copy this software for any purpose is hereby granted + * without fee, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is granted, + * provided the above notices are retained, and a notice that the code was + * modified is included with the above copyright notice. + * + */ +# include "stlport_prefix.h" + +# include "message_facets.h" + +_STLP_BEGIN_NAMESPACE + +//---------------------------------------------------------------------- +// messages + +_STLP_EXP_DECLSPEC messages::messages(_Messages* imp) : + _BaseFacet(1), _M_impl(imp) { imp->_M_delete = false; } + +_STLP_EXP_DECLSPEC messages::~messages() +{ + if (_M_impl && _M_impl->_M_delete) delete _M_impl; +} + +_STLP_EXP_DECLSPEC int messages::do_open(const string& filename, const locale& l) const +{ + return _M_impl->do_open(filename, l); +} + +_STLP_EXP_DECLSPEC string messages::do_get(catalog cat, + int set, int p_id, const string& dfault) const +{ + return _M_impl->do_get(cat, set, p_id, dfault); +} + +_STLP_EXP_DECLSPEC void messages::do_close(catalog cat) const +{ + _M_impl->do_close(cat); +} + +_STLP_EXP_DECLSPEC _Messages::_Messages() +{ } + +_STLP_EXP_DECLSPEC _Messages::~_Messages() +{} + +_STLP_EXP_DECLSPEC int _Messages::do_open(const string&, const locale&) const +{ + return -1; +} + +string _Messages::do_get(catalog, + int, int, const string& dfault) const +{ + return dfault; +} + + void _Messages::do_close(catalog) const +{} + + +# ifndef _STLP_NO_WCHAR_T + +_STLP_EXP_DECLSPEC messages::messages(_Messages* imp) : + _BaseFacet(1), _M_impl(imp) { imp->_M_delete = false; } + +_STLP_EXP_DECLSPEC messages::~messages() +{ if (_M_impl && _M_impl->_M_delete) delete _M_impl; } + +_STLP_EXP_DECLSPEC int messages::do_open(const string& filename, const locale& L) const +{ + return _M_impl->do_open(filename, L); +} + +_STLP_EXP_DECLSPEC wstring +messages::do_get(catalog thecat, + int set, int p_id, const wstring& dfault) const +{ + return _M_impl->do_get(thecat, set, p_id, dfault); +} + +_STLP_EXP_DECLSPEC void messages::do_close(catalog cat) const +{ + _M_impl->do_close(cat); +} + +wstring +_Messages::do_get(catalog, + int, int, const wstring& dfault) const +{ + return dfault; +} + +# endif + +_STLP_END_NAMESPACE + +// Local Variables: +// mode:C++ +// End: +