1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/stlport/stl/_messages_facets.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,186 @@
1.4 +/*
1.5 + * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.6 + *
1.7 + * Copyright (c) 1999
1.8 + * Silicon Graphics Computer Systems, Inc.
1.9 + *
1.10 + * Copyright (c) 1999
1.11 + * Boris Fomitchev
1.12 + *
1.13 + * This material is provided "as is", with absolutely no warranty expressed
1.14 + * or implied. Any use is at your own risk.
1.15 + *
1.16 + * Permission to use or copy this software for any purpose is hereby granted
1.17 + * without fee, provided the above notices are retained on all copies.
1.18 + * Permission to modify the code and to distribute modified code is granted,
1.19 + * provided the above notices are retained, and a notice that the code was
1.20 + * modified is included with the above copyright notice.
1.21 + *
1.22 + */
1.23 +
1.24 +// WARNING: This is an internal header file, included by other C++
1.25 +// standard library headers. You should not attempt to use this header
1.26 +// file directly.
1.27 +
1.28 +
1.29 +#ifndef _STLP_INTERNAL_MESSAGES_H
1.30 +#define _STLP_INTERNAL_MESSAGES_H
1.31 +
1.32 +#ifndef _STLP_IOS_BASE_H
1.33 +# include <stl/_ios_base.h>
1.34 +#endif
1.35 +
1.36 +# ifndef _STLP_C_LOCALE_H
1.37 +# include <stl/c_locale.h>
1.38 +# endif
1.39 +
1.40 +#ifndef _STLP_STRING_H
1.41 +# include <stl/_string.h>
1.42 +#endif
1.43 +
1.44 +_STLP_BEGIN_NAMESPACE
1.45 +
1.46 +// messages facets
1.47 +
1.48 +class messages_base {
1.49 +public:
1.50 + typedef int catalog;
1.51 +};
1.52 +
1.53 +template <class _CharT> class messages {};
1.54 +
1.55 +class _Messages;
1.56 +
1.57 +_STLP_TEMPLATE_NULL
1.58 +#ifdef __SYMBIAN32__
1.59 +class messages<char> : public locale::facet, public messages_base
1.60 +#else
1.61 +class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base
1.62 +#endif
1.63 +{
1.64 + friend class _Locale;
1.65 +public:
1.66 + typedef messages_base::catalog catalog;
1.67 + typedef char char_type;
1.68 + typedef string string_type;
1.69 +
1.70 + _STLP_DECLSPEC explicit messages(size_t __refs = 0);
1.71 +
1.72 + catalog open(const string& __fn, const locale& __loc) const
1.73 + { return do_open(__fn, __loc); }
1.74 + string_type get(catalog __c, int __set, int __msgid,
1.75 + const string_type& __dfault) const
1.76 + { return do_get(__c, __set, __msgid, __dfault); }
1.77 + inline void close(catalog __c) const
1.78 + { do_close(__c); }
1.79 +
1.80 +#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.81 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
1.82 +#else
1.83 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
1.84 +#endif
1.85 +
1.86 + _STLP_DECLSPEC messages(_Messages*);
1.87 +
1.88 +protected:
1.89 + _STLP_DECLSPEC messages(size_t, _Locale_messages*);
1.90 +_STLP_DECLSPEC ~messages();
1.91 +
1.92 +_STLP_DECLSPEC virtual catalog do_open(const string& __fn, const locale& __loc) const;
1.93 +_STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
1.94 + const string_type& __dfault) const;
1.95 +_STLP_DECLSPEC virtual void do_close(catalog __c) const;
1.96 +
1.97 + void _M_initialize(const char* __name);
1.98 +
1.99 +private:
1.100 + _Messages* _M_impl;
1.101 +};
1.102 +
1.103 +# if !defined (_STLP_NO_WCHAR_T)
1.104 +
1.105 +_STLP_TEMPLATE_NULL
1.106 +#ifdef __SYMBIAN32__
1.107 +class messages<wchar_t> : public locale::facet, public messages_base
1.108 +#else
1.109 +class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base
1.110 +#endif
1.111 +{
1.112 + friend class _Locale;
1.113 +public:
1.114 + typedef messages_base::catalog catalog;
1.115 + typedef wchar_t char_type;
1.116 + typedef wstring string_type;
1.117 +
1.118 +_STLP_DECLSPEC explicit messages(size_t __refs = 0);
1.119 +
1.120 + inline catalog open(const string& __fn, const locale& __loc) const
1.121 + { return do_open(__fn, __loc); }
1.122 + inline string_type get(catalog __c, int __set, int __msgid,
1.123 + const string_type& __dfault) const
1.124 + { return do_get(__c, __set, __msgid, __dfault); }
1.125 + inline void close(catalog __c) const
1.126 + { do_close(__c); }
1.127 +
1.128 +#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.129 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
1.130 +#else
1.131 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
1.132 +#endif
1.133 +
1.134 + _STLP_DECLSPEC messages(_Messages*);
1.135 +
1.136 +protected:
1.137 +
1.138 +_STLP_DECLSPEC messages(size_t, _Locale_messages*);
1.139 +_STLP_DECLSPEC ~messages();
1.140 +
1.141 +_STLP_DECLSPEC virtual catalog do_open(const string& __fn, const locale& __loc) const;
1.142 +_STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
1.143 + const string_type& __dfault) const;
1.144 +_STLP_DECLSPEC virtual void do_close(catalog __c) const;
1.145 +
1.146 + void _M_initialize(const char* __name);
1.147 +
1.148 +private:
1.149 + _Messages* _M_impl;
1.150 +};
1.151 +
1.152 +# endif /* WCHAR_T */
1.153 +
1.154 +template <class _CharT> class messages_byname {};
1.155 +
1.156 +_STLP_TEMPLATE_NULL
1.157 +class _STLP_CLASS_DECLSPEC messages_byname<char> : public messages<char> {
1.158 +public:
1.159 + typedef messages_base::catalog catalog;
1.160 + typedef string string_type;
1.161 +
1.162 + _STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0);
1.163 +
1.164 +protected:
1.165 +_STLP_DECLSPEC ~messages_byname();
1.166 +};
1.167 +
1.168 +# ifndef _STLP_NO_WCHAR_T
1.169 +_STLP_TEMPLATE_NULL
1.170 +class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
1.171 +public:
1.172 + typedef messages_base::catalog catalog;
1.173 + typedef wstring string_type;
1.174 +
1.175 +_STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0);
1.176 +
1.177 +protected:
1.178 +_STLP_DECLSPEC ~messages_byname();
1.179 +};
1.180 +# endif /* WCHAR_T */
1.181 +
1.182 +_STLP_END_NAMESPACE
1.183 +
1.184 +#endif /* _STLP_INTERNAL_MESSAGES_H */
1.185 +
1.186 +// Local Variables:
1.187 +// mode:C++
1.188 +// End:
1.189 +