home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / src / messages.cpp < prev    next >
C/C++ Source or Header  |  2001-01-26  |  2KB  |  112 lines

  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. messages<char>::messages(_Messages* imp)  : 
  28.   _BaseFacet(1), _M_impl(imp) { imp->_M_delete = false;  }
  29.  
  30. messages<char>::~messages()
  31.   if (_M_impl && _M_impl->_M_delete)  delete _M_impl; 
  32. }
  33.  
  34. int messages<char>::do_open(const string& filename, const locale& l) const
  35. {
  36.   return _M_impl->do_open(filename, l);
  37. }
  38.  
  39. string messages<char>::do_get(catalog cat,
  40.                               int set, int p_id, const string& dfault) const
  41. {
  42.   return _M_impl->do_get(cat, set, p_id, dfault);
  43. }
  44.  
  45. void messages<char>::do_close(catalog cat) const
  46. {
  47.   _M_impl->do_close(cat);
  48. }
  49.  
  50. _Messages::_Messages()
  51. { }
  52.  
  53. _Messages::~_Messages()
  54. {}
  55.  
  56. int _Messages::do_open(const string&, const locale&) const
  57. {  
  58.   return -1;
  59. }
  60.  
  61. string _Messages::do_get(catalog,
  62.              int, int, const string& dfault) const
  63. {
  64.   return dfault;
  65. }
  66.  
  67. void _Messages::do_close(catalog) const
  68. {}
  69.  
  70.  
  71. # ifndef _STLP_NO_WCHAR_T
  72.  
  73. messages<wchar_t>::messages(_Messages* imp)  : 
  74.   _BaseFacet(1), _M_impl(imp) { imp->_M_delete = false;  }
  75.  
  76. messages<wchar_t>::~messages()
  77. { if (_M_impl && _M_impl->_M_delete) delete _M_impl; }
  78.  
  79. int messages<wchar_t>::do_open(const string& filename, const locale& L) const
  80. {
  81.   return _M_impl->do_open(filename, L);
  82. }
  83.  
  84. wstring
  85. messages<wchar_t>::do_get(catalog thecat,
  86.                           int set, int p_id, const wstring& dfault) const
  87. {
  88.   return _M_impl->do_get(thecat, set, p_id, dfault);
  89. }
  90.  
  91. void messages<wchar_t>::do_close(catalog cat) const
  92. {
  93.   _M_impl->do_close(cat);
  94. }
  95.  
  96. wstring
  97. _Messages::do_get(catalog,
  98.           int, int, const wstring& dfault) const
  99. {
  100.   return dfault;
  101. }
  102.  
  103. # endif
  104.  
  105. _STLP_END_NAMESPACE
  106.  
  107. // Local Variables:
  108. // mode:C++
  109. // End:
  110.  
  111.