epoc32/include/stdapis/stlportv5/stl/_messages_facets.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/stlportv5/stl/_messages_facets.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_messages_facets.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,22 +1,22 @@
     1.4  /*
     1.5 - * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
     1.6 + * Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
     1.7   *
     1.8   * Copyright (c) 1999
     1.9   * Silicon Graphics Computer Systems, Inc.
    1.10   *
    1.11 - * Copyright (c) 1999 
    1.12 + * Copyright (c) 1999
    1.13   * Boris Fomitchev
    1.14   *
    1.15   * This material is provided "as is", with absolutely no warranty expressed
    1.16   * or implied. Any use is at your own risk.
    1.17   *
    1.18 - * Permission to use or copy this software for any purpose is hereby granted 
    1.19 + * Permission to use or copy this software for any purpose is hereby granted
    1.20   * without fee, provided the above notices are retained on all copies.
    1.21   * Permission to modify the code and to distribute modified code is granted,
    1.22   * provided the above notices are retained, and a notice that the code was
    1.23   * modified is included with the above copyright notice.
    1.24   *
    1.25 - */ 
    1.26 + */
    1.27  
    1.28  // WARNING: This is an internal header file, included by other C++
    1.29  // standard library headers.  You should not attempt to use this header
    1.30 @@ -27,15 +27,15 @@
    1.31  #define _STLP_INTERNAL_MESSAGES_H
    1.32  
    1.33  #ifndef _STLP_IOS_BASE_H
    1.34 -# include <stl/_ios_base.h>
    1.35 +#  include <stl/_ios_base.h>
    1.36  #endif
    1.37  
    1.38 -# ifndef _STLP_C_LOCALE_H
    1.39 +#ifndef _STLP_C_LOCALE_H
    1.40  #  include <stl/c_locale.h>
    1.41 -# endif
    1.42 +#endif
    1.43  
    1.44 -#ifndef _STLP_STRING_H
    1.45 -# include <stl/_string.h>
    1.46 +#ifndef _STLP_INTERNAL_STRING_H
    1.47 +#  include <stl/_string.h>
    1.48  #endif
    1.49  
    1.50  _STLP_BEGIN_NAMESPACE
    1.51 @@ -43,77 +43,76 @@
    1.52  // messages facets
    1.53  
    1.54  class messages_base {
    1.55 -public:
    1.56 -  typedef int catalog;
    1.57 +  public:
    1.58 +    typedef int catalog;
    1.59  };
    1.60  
    1.61  template <class _CharT> class messages {};
    1.62  
    1.63 +_STLP_MOVE_TO_PRIV_NAMESPACE
    1.64  class _Messages;
    1.65 +_STLP_MOVE_TO_STD_NAMESPACE
    1.66  
    1.67  _STLP_TEMPLATE_NULL
    1.68 -#ifdef __SYMBIAN32__
    1.69 -class messages<char> : public locale::facet, public messages_base
    1.70 -#else
    1.71 -class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base
    1.72 -#endif
    1.73 -{
    1.74 -  friend class _Locale;
    1.75 +class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base {
    1.76 +  friend class _Locale_impl;
    1.77  public:
    1.78    typedef messages_base::catalog catalog;
    1.79    typedef char                   char_type;
    1.80    typedef string    string_type;
    1.81  
    1.82 - _STLP_DECLSPEC explicit messages(size_t __refs = 0);
    1.83 +  _STLP_DECLSPEC explicit messages(size_t __refs = 0);
    1.84  
    1.85 - catalog open(const string& __fn, const locale& __loc) const
    1.86 -    { return do_open(__fn, __loc); }
    1.87 +  catalog open(const string& __fn, const locale& __loc) const
    1.88 +  { return do_open(__fn, __loc); }
    1.89    string_type get(catalog __c, int __set, int __msgid,
    1.90 -		  const string_type& __dfault) const
    1.91 -    { return do_get(__c, __set, __msgid, __dfault); }
    1.92 +                  const string_type& __dfault) const
    1.93 +  { return do_get(__c, __set, __msgid, __dfault); }
    1.94    inline void close(catalog __c) const
    1.95 -    { do_close(__c); }
    1.96 +  { do_close(__c); }
    1.97  
    1.98 -#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
    1.99 -    _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
   1.100 +#if defined(__SYMBIAN32__WSD__) 
   1.101 +  static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
   1.102 +#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)    
   1.103 +  static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
   1.104 +  static locale::id id;           
   1.105  #else
   1.106 -	_STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
   1.107 +  // NOTE: Symbian doesn't support exporting static data.  
   1.108 +  // Users of this class should use GetFacetLocaleId() to access the data member id  
   1.109 +  static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
   1.110  #endif
   1.111  
   1.112 -  _STLP_DECLSPEC  messages(_Messages*);
   1.113 +private:
   1.114 +  _STLP_DECLSPEC messages(_STLP_PRIV _Messages*);
   1.115  
   1.116  protected:
   1.117 - _STLP_DECLSPEC  messages(size_t, _Locale_messages*);
   1.118 -_STLP_DECLSPEC   ~messages();
   1.119 +  _STLP_DECLSPEC messages(size_t, _Locale_messages*);
   1.120 +  _STLP_DECLSPEC ~messages();
   1.121  
   1.122 -_STLP_DECLSPEC   virtual catalog     do_open(const string& __fn, const locale& __loc) const;
   1.123 -_STLP_DECLSPEC   virtual string_type do_get(catalog __c, int __set, int __msgid,
   1.124 +
   1.125 +  _STLP_DECLSPEC virtual catalog     do_open(const string& __fn, const locale& __loc) const;
   1.126 +  _STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
   1.127                               const string_type& __dfault) const;
   1.128 -_STLP_DECLSPEC   virtual void        do_close(catalog __c) const;
   1.129 +  _STLP_DECLSPEC virtual void        do_close(catalog __c) const;
   1.130  
   1.131    void _M_initialize(const char* __name);
   1.132  
   1.133  private:
   1.134 -  _Messages* _M_impl;
   1.135 +  _STLP_PRIV _Messages* _M_impl;
   1.136  };
   1.137  
   1.138 -# if !defined (_STLP_NO_WCHAR_T)
   1.139 +#if !defined (_STLP_NO_WCHAR_T)
   1.140  
   1.141  _STLP_TEMPLATE_NULL
   1.142 -#ifdef __SYMBIAN32__
   1.143 -class messages<wchar_t> : public locale::facet, public messages_base
   1.144 -#else
   1.145 -class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base
   1.146 -#endif
   1.147 -{
   1.148 -  friend class _Locale;
   1.149 +class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base {
   1.150 +  friend class _Locale_impl;
   1.151  public:
   1.152    typedef messages_base::catalog catalog;
   1.153    typedef wchar_t                char_type;
   1.154    typedef wstring  string_type;
   1.155  
   1.156 -_STLP_DECLSPEC   explicit messages(size_t __refs = 0);
   1.157 -  
   1.158 +  explicit messages(size_t __refs = 0);
   1.159 +
   1.160    inline catalog open(const string& __fn, const locale& __loc) const
   1.161      { return do_open(__fn, __loc); }
   1.162    inline string_type get(catalog __c, int __set, int __msgid,
   1.163 @@ -122,31 +121,36 @@
   1.164    inline void close(catalog __c) const
   1.165      { do_close(__c); }
   1.166  
   1.167 -#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
   1.168 -    _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
   1.169 +#if defined(__SYMBIAN32__WSD__) 
   1.170 +  static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
   1.171 +#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)    
   1.172 +  static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
   1.173 +  static locale::id id;        
   1.174  #else
   1.175 -  _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
   1.176 +  // NOTE: Symbian doesn't support exporting static data.  
   1.177 +  // Users of this class should use GetFacetLocaleId() to access the data member id  
   1.178 +  static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
   1.179  #endif
   1.180  
   1.181 -  _STLP_DECLSPEC  messages(_Messages*);
   1.182 +private:
   1.183 +  _STLP_DECLSPEC messages(_STLP_PRIV _Messages*);
   1.184  
   1.185  protected:
   1.186 +  _STLP_DECLSPEC messages(size_t, _Locale_messages*);
   1.187 +  _STLP_DECLSPEC ~messages();
   1.188  
   1.189 -_STLP_DECLSPEC   messages(size_t, _Locale_messages*);
   1.190 -_STLP_DECLSPEC   ~messages();
   1.191 -
   1.192 -_STLP_DECLSPEC   virtual catalog     do_open(const string& __fn, const locale& __loc) const;
   1.193 -_STLP_DECLSPEC   virtual string_type do_get(catalog __c, int __set, int __msgid,
   1.194 +  _STLP_DECLSPEC virtual catalog     do_open(const string& __fn, const locale& __loc) const;
   1.195 +  _STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
   1.196                               const string_type& __dfault) const;
   1.197 -_STLP_DECLSPEC   virtual void        do_close(catalog __c) const;
   1.198 +  _STLP_DECLSPEC virtual void        do_close(catalog __c) const;
   1.199  
   1.200    void _M_initialize(const char* __name);
   1.201  
   1.202  private:
   1.203 -  _Messages* _M_impl;
   1.204 +  _STLP_PRIV _Messages* _M_impl;
   1.205  };
   1.206  
   1.207 -# endif /* WCHAR_T */
   1.208 +#endif
   1.209  
   1.210  template <class _CharT> class messages_byname {};
   1.211  
   1.212 @@ -156,25 +160,37 @@
   1.213    typedef messages_base::catalog catalog;
   1.214    typedef string     string_type;
   1.215  
   1.216 - _STLP_DECLSPEC  explicit messages_byname(const char* __name, size_t __refs = 0);
   1.217 +  _STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
   1.218  
   1.219  protected:
   1.220 -_STLP_DECLSPEC   ~messages_byname();
   1.221 +  ~messages_byname();
   1.222 +
   1.223 +private:
   1.224 +  typedef messages_byname<char> _Self;
   1.225 +  //explicitely defined as private to avoid warnings:
   1.226 +  messages_byname(_Self const&);
   1.227 +  _Self& operator = (_Self const&);
   1.228  };
   1.229  
   1.230 -# ifndef _STLP_NO_WCHAR_T
   1.231 +#if !defined (_STLP_NO_WCHAR_T)
   1.232  _STLP_TEMPLATE_NULL
   1.233  class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
   1.234  public:
   1.235    typedef messages_base::catalog catalog;
   1.236    typedef wstring                string_type;
   1.237  
   1.238 -_STLP_DECLSPEC   explicit messages_byname(const char* __name, size_t __refs = 0);
   1.239 +  _STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
   1.240  
   1.241  protected:
   1.242 -_STLP_DECLSPEC   ~messages_byname();
   1.243 +  ~messages_byname();
   1.244 +
   1.245 +private:
   1.246 +  typedef messages_byname<wchar_t> _Self;
   1.247 +  //explicitely defined as private to avoid warnings:
   1.248 +  messages_byname(_Self const&);
   1.249 +  _Self& operator = (_Self const&);
   1.250  };
   1.251 -# endif /* WCHAR_T */
   1.252 +#endif /* WCHAR_T */
   1.253  
   1.254  _STLP_END_NAMESPACE
   1.255