/project/jni/stlport/src/messages.cpp

https://github.com/aichunyu/FFPlayer · C++ · 98 lines · 49 code · 27 blank · 22 comment · 6 complexity · 5aeb52ec5904ac00069875623db413fe MD5 · raw file

  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. #include "message_facets.h"
  20. _STLP_BEGIN_NAMESPACE
  21. //----------------------------------------------------------------------
  22. // messages<char>
  23. messages<char>::messages(_STLP_PRIV _Messages* imp) :
  24. locale::facet(1), _M_impl(imp) { if (imp) imp->_M_delete = true; }
  25. messages<char>::~messages()
  26. { if (_M_impl && _M_impl->_M_delete) delete _M_impl; }
  27. messages<char>::catalog
  28. messages<char>::do_open(const string& filename, const locale& l) const
  29. { return _M_impl->do_open(filename, l); }
  30. string
  31. messages<char>::do_get(catalog cat, int set, int p_id,
  32. const string& dfault) const
  33. { return _M_impl->do_get(cat, set, p_id, dfault); }
  34. void messages<char>::do_close(catalog cat) const
  35. { _M_impl->do_close(cat); }
  36. _STLP_MOVE_TO_PRIV_NAMESPACE
  37. _Messages::_Messages()
  38. {}
  39. _Messages::~_Messages()
  40. {}
  41. _Messages::catalog _Messages::do_open(const string&, const locale&) const
  42. { return -1; }
  43. string _Messages::do_get(catalog, int, int, const string& dfault) const
  44. { return dfault; }
  45. void _Messages::do_close(catalog) const
  46. {}
  47. _STLP_MOVE_TO_STD_NAMESPACE
  48. #if !defined (_STLP_NO_WCHAR_T)
  49. messages<wchar_t>::messages(_STLP_PRIV _Messages* imp) :
  50. locale::facet(1), _M_impl(imp) { if (imp) imp->_M_delete = true; }
  51. messages<wchar_t>::~messages()
  52. { if (_M_impl && _M_impl->_M_delete) delete _M_impl; }
  53. messages<wchar_t>::catalog
  54. messages<wchar_t>::do_open(const string& filename, const locale& L) const
  55. { return _M_impl->do_open(filename, L); }
  56. wstring
  57. messages<wchar_t>::do_get(catalog thecat,
  58. int set, int p_id, const wstring& dfault) const
  59. { return _M_impl->do_get(thecat, set, p_id, dfault); }
  60. void messages<wchar_t>::do_close(catalog cat) const
  61. { _M_impl->do_close(cat); }
  62. _STLP_MOVE_TO_PRIV_NAMESPACE
  63. wstring
  64. _Messages::do_get(catalog, int, int, const wstring& dfault) const
  65. { return dfault; }
  66. _STLP_MOVE_TO_STD_NAMESPACE
  67. #endif
  68. _STLP_END_NAMESPACE
  69. // Local Variables:
  70. // mode:C++
  71. // End: