epoc32/include/stdapis/stlportv5/stl/_messages_facets.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@4
     2
 * Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
williamr@2
     3
 *
williamr@2
     4
 * Copyright (c) 1999
williamr@2
     5
 * Silicon Graphics Computer Systems, Inc.
williamr@2
     6
 *
williamr@4
     7
 * Copyright (c) 1999
williamr@2
     8
 * Boris Fomitchev
williamr@2
     9
 *
williamr@2
    10
 * This material is provided "as is", with absolutely no warranty expressed
williamr@2
    11
 * or implied. Any use is at your own risk.
williamr@2
    12
 *
williamr@4
    13
 * Permission to use or copy this software for any purpose is hereby granted
williamr@2
    14
 * without fee, provided the above notices are retained on all copies.
williamr@2
    15
 * Permission to modify the code and to distribute modified code is granted,
williamr@2
    16
 * provided the above notices are retained, and a notice that the code was
williamr@2
    17
 * modified is included with the above copyright notice.
williamr@2
    18
 *
williamr@4
    19
 */
williamr@2
    20
williamr@2
    21
// WARNING: This is an internal header file, included by other C++
williamr@2
    22
// standard library headers.  You should not attempt to use this header
williamr@2
    23
// file directly.
williamr@2
    24
williamr@2
    25
williamr@2
    26
#ifndef _STLP_INTERNAL_MESSAGES_H
williamr@2
    27
#define _STLP_INTERNAL_MESSAGES_H
williamr@2
    28
williamr@2
    29
#ifndef _STLP_IOS_BASE_H
williamr@4
    30
#  include <stl/_ios_base.h>
williamr@2
    31
#endif
williamr@2
    32
williamr@4
    33
#ifndef _STLP_C_LOCALE_H
williamr@2
    34
#  include <stl/c_locale.h>
williamr@4
    35
#endif
williamr@2
    36
williamr@4
    37
#ifndef _STLP_INTERNAL_STRING_H
williamr@4
    38
#  include <stl/_string.h>
williamr@2
    39
#endif
williamr@2
    40
williamr@2
    41
_STLP_BEGIN_NAMESPACE
williamr@2
    42
williamr@2
    43
// messages facets
williamr@2
    44
williamr@2
    45
class messages_base {
williamr@4
    46
  public:
williamr@4
    47
    typedef int catalog;
williamr@2
    48
};
williamr@2
    49
williamr@2
    50
template <class _CharT> class messages {};
williamr@2
    51
williamr@4
    52
_STLP_MOVE_TO_PRIV_NAMESPACE
williamr@2
    53
class _Messages;
williamr@4
    54
_STLP_MOVE_TO_STD_NAMESPACE
williamr@2
    55
williamr@2
    56
_STLP_TEMPLATE_NULL
williamr@4
    57
class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base {
williamr@4
    58
  friend class _Locale_impl;
williamr@2
    59
public:
williamr@2
    60
  typedef messages_base::catalog catalog;
williamr@2
    61
  typedef char                   char_type;
williamr@2
    62
  typedef string    string_type;
williamr@2
    63
williamr@4
    64
  _STLP_DECLSPEC explicit messages(size_t __refs = 0);
williamr@2
    65
williamr@4
    66
  catalog open(const string& __fn, const locale& __loc) const
williamr@4
    67
  { return do_open(__fn, __loc); }
williamr@2
    68
  string_type get(catalog __c, int __set, int __msgid,
williamr@4
    69
                  const string_type& __dfault) const
williamr@4
    70
  { return do_get(__c, __set, __msgid, __dfault); }
williamr@2
    71
  inline void close(catalog __c) const
williamr@4
    72
  { do_close(__c); }
williamr@2
    73
williamr@4
    74
#if defined(__SYMBIAN32__WSD__) 
williamr@4
    75
  static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
williamr@4
    76
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)    
williamr@4
    77
  static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
williamr@4
    78
  static locale::id id;           
williamr@2
    79
#else
williamr@4
    80
  // NOTE: Symbian doesn't support exporting static data.  
williamr@4
    81
  // Users of this class should use GetFacetLocaleId() to access the data member id  
williamr@4
    82
  static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
williamr@2
    83
#endif
williamr@2
    84
williamr@4
    85
private:
williamr@4
    86
  _STLP_DECLSPEC messages(_STLP_PRIV _Messages*);
williamr@2
    87
williamr@2
    88
protected:
williamr@4
    89
  _STLP_DECLSPEC messages(size_t, _Locale_messages*);
williamr@4
    90
  _STLP_DECLSPEC ~messages();
williamr@2
    91
williamr@4
    92
williamr@4
    93
  _STLP_DECLSPEC virtual catalog     do_open(const string& __fn, const locale& __loc) const;
williamr@4
    94
  _STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
williamr@2
    95
                             const string_type& __dfault) const;
williamr@4
    96
  _STLP_DECLSPEC virtual void        do_close(catalog __c) const;
williamr@2
    97
williamr@2
    98
  void _M_initialize(const char* __name);
williamr@2
    99
williamr@2
   100
private:
williamr@4
   101
  _STLP_PRIV _Messages* _M_impl;
williamr@2
   102
};
williamr@2
   103
williamr@4
   104
#if !defined (_STLP_NO_WCHAR_T)
williamr@2
   105
williamr@2
   106
_STLP_TEMPLATE_NULL
williamr@4
   107
class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base {
williamr@4
   108
  friend class _Locale_impl;
williamr@2
   109
public:
williamr@2
   110
  typedef messages_base::catalog catalog;
williamr@2
   111
  typedef wchar_t                char_type;
williamr@2
   112
  typedef wstring  string_type;
williamr@2
   113
williamr@4
   114
  explicit messages(size_t __refs = 0);
williamr@4
   115
williamr@2
   116
  inline catalog open(const string& __fn, const locale& __loc) const
williamr@2
   117
    { return do_open(__fn, __loc); }
williamr@2
   118
  inline string_type get(catalog __c, int __set, int __msgid,
williamr@2
   119
                         const string_type& __dfault) const
williamr@2
   120
    { return do_get(__c, __set, __msgid, __dfault); }
williamr@2
   121
  inline void close(catalog __c) const
williamr@2
   122
    { do_close(__c); }
williamr@2
   123
williamr@4
   124
#if defined(__SYMBIAN32__WSD__) 
williamr@4
   125
  static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
williamr@4
   126
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)    
williamr@4
   127
  static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
williamr@4
   128
  static locale::id id;        
williamr@2
   129
#else
williamr@4
   130
  // NOTE: Symbian doesn't support exporting static data.  
williamr@4
   131
  // Users of this class should use GetFacetLocaleId() to access the data member id  
williamr@4
   132
  static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
williamr@2
   133
#endif
williamr@2
   134
williamr@4
   135
private:
williamr@4
   136
  _STLP_DECLSPEC messages(_STLP_PRIV _Messages*);
williamr@2
   137
williamr@2
   138
protected:
williamr@4
   139
  _STLP_DECLSPEC messages(size_t, _Locale_messages*);
williamr@4
   140
  _STLP_DECLSPEC ~messages();
williamr@2
   141
williamr@4
   142
  _STLP_DECLSPEC virtual catalog     do_open(const string& __fn, const locale& __loc) const;
williamr@4
   143
  _STLP_DECLSPEC virtual string_type do_get(catalog __c, int __set, int __msgid,
williamr@2
   144
                             const string_type& __dfault) const;
williamr@4
   145
  _STLP_DECLSPEC virtual void        do_close(catalog __c) const;
williamr@2
   146
williamr@2
   147
  void _M_initialize(const char* __name);
williamr@2
   148
williamr@2
   149
private:
williamr@4
   150
  _STLP_PRIV _Messages* _M_impl;
williamr@2
   151
};
williamr@2
   152
williamr@4
   153
#endif
williamr@2
   154
williamr@2
   155
template <class _CharT> class messages_byname {};
williamr@2
   156
williamr@2
   157
_STLP_TEMPLATE_NULL
williamr@2
   158
class _STLP_CLASS_DECLSPEC messages_byname<char> : public messages<char> {
williamr@2
   159
public:
williamr@2
   160
  typedef messages_base::catalog catalog;
williamr@2
   161
  typedef string     string_type;
williamr@2
   162
williamr@4
   163
  _STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
williamr@2
   164
williamr@2
   165
protected:
williamr@4
   166
  ~messages_byname();
williamr@4
   167
williamr@4
   168
private:
williamr@4
   169
  typedef messages_byname<char> _Self;
williamr@4
   170
  //explicitely defined as private to avoid warnings:
williamr@4
   171
  messages_byname(_Self const&);
williamr@4
   172
  _Self& operator = (_Self const&);
williamr@2
   173
};
williamr@2
   174
williamr@4
   175
#if !defined (_STLP_NO_WCHAR_T)
williamr@2
   176
_STLP_TEMPLATE_NULL
williamr@2
   177
class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
williamr@2
   178
public:
williamr@2
   179
  typedef messages_base::catalog catalog;
williamr@2
   180
  typedef wstring                string_type;
williamr@2
   181
williamr@4
   182
  _STLP_DECLSPEC explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
williamr@2
   183
williamr@2
   184
protected:
williamr@4
   185
  ~messages_byname();
williamr@4
   186
williamr@4
   187
private:
williamr@4
   188
  typedef messages_byname<wchar_t> _Self;
williamr@4
   189
  //explicitely defined as private to avoid warnings:
williamr@4
   190
  messages_byname(_Self const&);
williamr@4
   191
  _Self& operator = (_Self const&);
williamr@2
   192
};
williamr@4
   193
#endif /* WCHAR_T */
williamr@2
   194
williamr@2
   195
_STLP_END_NAMESPACE
williamr@2
   196
williamr@2
   197
#endif /* _STLP_INTERNAL_MESSAGES_H */
williamr@2
   198
williamr@2
   199
// Local Variables:
williamr@2
   200
// mode:C++
williamr@2
   201
// End:
williamr@2
   202