/project/jni/stlport/stlport/stl/_messages_facets.h

https://github.com/aichunyu/FFPlayer · C Header · 181 lines · 111 code · 44 blank · 26 comment · 0 complexity · de62728c552721e570e450cb627c61e6 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. // WARNING: This is an internal header file, included by other C++
  19. // standard library headers. You should not attempt to use this header
  20. // file directly.
  21. #ifndef _STLP_INTERNAL_MESSAGES_H
  22. #define _STLP_INTERNAL_MESSAGES_H
  23. #ifndef _STLP_IOS_BASE_H
  24. # include <stl/_ios_base.h>
  25. #endif
  26. #ifndef _STLP_C_LOCALE_H
  27. # include <stl/c_locale.h>
  28. #endif
  29. #ifndef _STLP_INTERNAL_STRING_H
  30. # include <stl/_string.h>
  31. #endif
  32. _STLP_BEGIN_NAMESPACE
  33. // messages facets
  34. class messages_base {
  35. public:
  36. typedef int catalog;
  37. };
  38. template <class _CharT> class messages {};
  39. _STLP_MOVE_TO_PRIV_NAMESPACE
  40. class _Messages;
  41. _STLP_MOVE_TO_STD_NAMESPACE
  42. _STLP_TEMPLATE_NULL
  43. class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base {
  44. friend class _Locale_impl;
  45. public:
  46. typedef messages_base::catalog catalog;
  47. typedef char char_type;
  48. typedef string string_type;
  49. explicit messages(size_t __refs = 0);
  50. catalog open(const string& __fn, const locale& __loc) const
  51. { return do_open(__fn, __loc); }
  52. string_type get(catalog __c, int __set, int __msgid,
  53. const string_type& __dfault) const
  54. { return do_get(__c, __set, __msgid, __dfault); }
  55. inline void close(catalog __c) const
  56. { do_close(__c); }
  57. static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
  58. private:
  59. messages(_STLP_PRIV _Messages*);
  60. protected:
  61. messages(size_t, _Locale_messages*);
  62. ~messages();
  63. virtual catalog do_open(const string& __fn, const locale& __loc) const;
  64. virtual string_type do_get(catalog __c, int __set, int __msgid,
  65. const string_type& __dfault) const;
  66. virtual void do_close(catalog __c) const;
  67. void _M_initialize(const char* __name);
  68. private:
  69. _STLP_PRIV _Messages* _M_impl;
  70. };
  71. #if !defined (_STLP_NO_WCHAR_T)
  72. _STLP_TEMPLATE_NULL
  73. class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base {
  74. friend class _Locale_impl;
  75. public:
  76. typedef messages_base::catalog catalog;
  77. typedef wchar_t char_type;
  78. typedef wstring string_type;
  79. explicit messages(size_t __refs = 0);
  80. inline catalog open(const string& __fn, const locale& __loc) const
  81. { return do_open(__fn, __loc); }
  82. inline string_type get(catalog __c, int __set, int __msgid,
  83. const string_type& __dfault) const
  84. { return do_get(__c, __set, __msgid, __dfault); }
  85. inline void close(catalog __c) const
  86. { do_close(__c); }
  87. static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
  88. private:
  89. messages(_STLP_PRIV _Messages*);
  90. protected:
  91. messages(size_t, _Locale_messages*);
  92. ~messages();
  93. virtual catalog do_open(const string& __fn, const locale& __loc) const;
  94. virtual string_type do_get(catalog __c, int __set, int __msgid,
  95. const string_type& __dfault) const;
  96. virtual void do_close(catalog __c) const;
  97. void _M_initialize(const char* __name);
  98. private:
  99. _STLP_PRIV _Messages* _M_impl;
  100. };
  101. #endif
  102. template <class _CharT> class messages_byname {};
  103. _STLP_TEMPLATE_NULL
  104. class _STLP_CLASS_DECLSPEC messages_byname<char> : public messages<char> {
  105. public:
  106. typedef messages_base::catalog catalog;
  107. typedef string string_type;
  108. explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
  109. protected:
  110. ~messages_byname();
  111. private:
  112. typedef messages_byname<char> _Self;
  113. //explicitely defined as private to avoid warnings:
  114. messages_byname(_Self const&);
  115. _Self& operator = (_Self const&);
  116. };
  117. #if !defined (_STLP_NO_WCHAR_T)
  118. _STLP_TEMPLATE_NULL
  119. class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
  120. public:
  121. typedef messages_base::catalog catalog;
  122. typedef wstring string_type;
  123. explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
  124. protected:
  125. ~messages_byname();
  126. private:
  127. typedef messages_byname<wchar_t> _Self;
  128. //explicitely defined as private to avoid warnings:
  129. messages_byname(_Self const&);
  130. _Self& operator = (_Self const&);
  131. };
  132. #endif /* WCHAR_T */
  133. _STLP_END_NAMESPACE
  134. #endif /* _STLP_INTERNAL_MESSAGES_H */
  135. // Local Variables:
  136. // mode:C++
  137. // End: