os/ossrv/genericopenlibs/cppstdlib/stl/src/time_facets.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
 * Portions Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
sl@0
     3
 *
sl@0
     4
 * Copyright (c) 1999
sl@0
     5
 * Silicon Graphics Computer Systems, Inc.
sl@0
     6
 *
sl@0
     7
 * Copyright (c) 1999
sl@0
     8
 * Boris Fomitchev
sl@0
     9
 *
sl@0
    10
 * This material is provided "as is", with absolutely no warranty expressed
sl@0
    11
 * or implied. Any use is at your own risk.
sl@0
    12
 *
sl@0
    13
 * Permission to use or copy this software for any purpose is hereby granted
sl@0
    14
 * without fee, provided the above notices are retained on all copies.
sl@0
    15
 * Permission to modify the code and to distribute modified code is granted,
sl@0
    16
 * provided the above notices are retained, and a notice that the code was
sl@0
    17
 * modified is included with the above copyright notice.
sl@0
    18
 *
sl@0
    19
 */
sl@0
    20
sl@0
    21
#include "stlport_prefix.h"
sl@0
    22
sl@0
    23
#include <cstdio>
sl@0
    24
#include <locale>
sl@0
    25
#include <istream>
sl@0
    26
sl@0
    27
#ifndef __SYMBIAN32__
sl@0
    28
#include <cstdio>
sl@0
    29
#endif
sl@0
    30
sl@0
    31
#include "c_locale.h"
sl@0
    32
sl@0
    33
#ifdef __SYMBIAN32__WSD__
sl@0
    34
#include <libstdcppwsd.h>
sl@0
    35
#endif //__SYMBIAN32__WSD__
sl@0
    36
sl@0
    37
_STLP_BEGIN_NAMESPACE
sl@0
    38
sl@0
    39
_STLP_MOVE_TO_PRIV_NAMESPACE
sl@0
    40
sl@0
    41
// default "C" values for month and day names
sl@0
    42
sl@0
    43
const char default_dayname[][14] = {
sl@0
    44
  "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
sl@0
    45
  "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
sl@0
    46
  "Friday", "Saturday"};
sl@0
    47
sl@0
    48
const char default_monthname[][24] = {
sl@0
    49
  "Jan", "Feb", "Mar", "Apr", "May", "Jun",
sl@0
    50
  "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
sl@0
    51
  "January", "February", "March", "April", "May", "June",
sl@0
    52
  "July", "August", "September", "October", "November", "December"};
sl@0
    53
sl@0
    54
// _Init_time_info: initialize table with
sl@0
    55
// "C" values (note these are not defined in the C standard, so this
sl@0
    56
// is somewhat arbitrary).
sl@0
    57
sl@0
    58
_STLP_DECLSPEC void _STLP_CALL _Init_timeinfo(_Time_Info& table) {
sl@0
    59
  int i;
sl@0
    60
  for (i = 0; i < 14; ++i)
sl@0
    61
    table._M_dayname[i] = default_dayname[i];
sl@0
    62
  for (i = 0; i < 24; ++i)
sl@0
    63
    table._M_monthname[i] = default_monthname[i];
sl@0
    64
  table._M_am_pm[0] = "AM";
sl@0
    65
  table._M_am_pm[1] = "PM";
sl@0
    66
  table._M_time_format = "%H:%M:%S";
sl@0
    67
  table._M_date_format = "%m/%d/%y";
sl@0
    68
  table._M_date_time_format = "%m/%d/%y";
sl@0
    69
}
sl@0
    70
sl@0
    71
_STLP_DECLSPEC void _STLP_CALL _Init_timeinfo(_Time_Info& table, _Locale_time * time) {
sl@0
    72
  if(!time)
sl@0
    73
    locale::_M_throw_runtime_error();
sl@0
    74
sl@0
    75
  int i;
sl@0
    76
  for (i = 0; i < 7; ++i)
sl@0
    77
    table._M_dayname[i] = _Locale_abbrev_dayofweek(time, i);
sl@0
    78
  for (i = 0; i < 7; ++i)
sl@0
    79
    table._M_dayname[i+7] = _Locale_full_dayofweek(time, i);
sl@0
    80
  for (i = 0; i < 12; ++i)
sl@0
    81
    table._M_monthname[i] = _Locale_abbrev_monthname(time, i);
sl@0
    82
  for (i = 0; i < 12; ++i)
sl@0
    83
    table._M_monthname[i+12] = _Locale_full_monthname(time, i);
sl@0
    84
  table._M_am_pm[0] = _Locale_am_str(time);
sl@0
    85
  table._M_am_pm[1] = _Locale_pm_str(time);
sl@0
    86
  table._M_time_format = _Locale_t_fmt(time);
sl@0
    87
  if ( table._M_time_format == "%T" ) {
sl@0
    88
    table._M_time_format = "%H:%M:%S";
sl@0
    89
  } else if ( table._M_time_format == "%r" ) {
sl@0
    90
    table._M_time_format = "%I:%M:%S %p";
sl@0
    91
  } else if ( table._M_time_format == "%R" ) {
sl@0
    92
    table._M_time_format = "%H:%M";
sl@0
    93
  }
sl@0
    94
  table._M_date_format = _Locale_d_fmt(time);
sl@0
    95
  table._M_date_time_format = _Locale_d_t_fmt(time);
sl@0
    96
  table._M_long_date_format = _Locale_long_d_fmt(time);
sl@0
    97
  table._M_long_date_time_format = _Locale_long_d_t_fmt(time);
sl@0
    98
}
sl@0
    99
sl@0
   100
inline char* __subformat(const string& format, char*& buf, size_t buf_size,
sl@0
   101
                         const _Time_Info&  table, const tm* t) {
sl@0
   102
  const char * cp = format.data();
sl@0
   103
  const char * cp_end = cp + format.size();
sl@0
   104
  while (cp != cp_end) {
sl@0
   105
    if (*cp == '%') {
sl@0
   106
      char mod = 0;
sl@0
   107
      ++cp;
sl@0
   108
      if(*cp == '#') {
sl@0
   109
        mod = *cp; ++cp;
sl@0
   110
      }
sl@0
   111
      char *former_buf = buf;
sl@0
   112
      buf = __write_formatted_time(buf, buf_size, *cp++, mod, table, t);
sl@0
   113
      buf_size -= (buf - former_buf);
sl@0
   114
    } else
sl@0
   115
      *buf++ = *cp++;
sl@0
   116
  }
sl@0
   117
  return buf;
sl@0
   118
}
sl@0
   119
sl@0
   120
#if defined (__GNUC__)
sl@0
   121
/* The number of days from the first day of the first ISO week of this
sl@0
   122
   year to the year day YDAY with week day WDAY.  ISO weeks start on
sl@0
   123
   Monday; the first ISO week has the year's first Thursday.  YDAY may
sl@0
   124
   be as small as YDAY_MINIMUM.  */
sl@0
   125
#  define __ISO_WEEK_START_WDAY 1 /* Monday */
sl@0
   126
#  define __ISO_WEEK1_WDAY 4 /* Thursday */
sl@0
   127
#  define __YDAY_MINIMUM (-366)
sl@0
   128
#  define __TM_YEAR_BASE 1900
sl@0
   129
static int
sl@0
   130
__iso_week_days(int yday, int wday) {
sl@0
   131
  /* Add enough to the first operand of % to make it nonnegative.  */
sl@0
   132
  int big_enough_multiple_of_7 = (-__YDAY_MINIMUM / 7 + 2) * 7;
sl@0
   133
  return (yday
sl@0
   134
          - (yday - wday + __ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7
sl@0
   135
          + __ISO_WEEK1_WDAY - __ISO_WEEK_START_WDAY);
sl@0
   136
}
sl@0
   137
sl@0
   138
#  define __is_leap(year)\
sl@0
   139
  ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
sl@0
   140
sl@0
   141
#endif
sl@0
   142
sl@0
   143
#define __hour12(hour) \
sl@0
   144
  (((hour) % 12 == 0) ? (12) : (hour) % 12)
sl@0
   145
sl@0
   146
#if !defined (_STLP_USE_SAFE_STRING_FUNCTIONS)
sl@0
   147
#  define _STLP_SPRINTF(B, BS, F, D) sprintf(B, F, D)
sl@0
   148
#else
sl@0
   149
#  define _STLP_SPRINTF(B, BS, F, D) sprintf_s(B, BS, F, D)
sl@0
   150
#endif
sl@0
   151
sl@0
   152
_STLP_DECLSPEC char * _STLP_CALL __write_formatted_time(char* buf, size_t buf_size, char format, char modifier,
sl@0
   153
                                         const _Time_Info& table, const tm* t) {
sl@0
   154
  switch (format) {
sl@0
   155
    case 'a':
sl@0
   156
      return copy(table._M_dayname[t->tm_wday].begin(),
sl@0
   157
                  table._M_dayname[t->tm_wday].end(),
sl@0
   158
                  buf);
sl@0
   159
sl@0
   160
    case 'A':
sl@0
   161
      return copy(table._M_dayname[t->tm_wday+7].begin(),
sl@0
   162
                  table._M_dayname[t->tm_wday+7].end(),
sl@0
   163
                  buf);
sl@0
   164
sl@0
   165
    case 'b':
sl@0
   166
      return copy(table._M_monthname[t->tm_mon].begin(),
sl@0
   167
                  table._M_monthname[t->tm_mon].end(),
sl@0
   168
                  buf);
sl@0
   169
sl@0
   170
    case 'B':
sl@0
   171
      return copy(table._M_monthname[t->tm_mon+12].begin(),
sl@0
   172
                  table._M_monthname[t->tm_mon+12].end(),
sl@0
   173
                  buf);
sl@0
   174
sl@0
   175
    case 'c': {
sl@0
   176
      const char *cp = (modifier != '#') ?
sl@0
   177
        table._M_date_time_format.data() :
sl@0
   178
        table._M_long_date_time_format.data();
sl@0
   179
      const char* cp_end = cp +
sl@0
   180
        ((modifier != '#') ? table._M_date_time_format.size() :
sl@0
   181
         table._M_long_date_time_format.size() );
sl@0
   182
      char mod;
sl@0
   183
      while (cp != cp_end) {
sl@0
   184
        if (*cp == '%') {
sl@0
   185
          ++cp; if(*cp == '#') mod = *cp++; else mod = 0;
sl@0
   186
          char *buf_pos = buf;
sl@0
   187
          buf = __write_formatted_time(buf, buf_size, *cp++, mod, table, t);
sl@0
   188
          buf_size -= (buf - buf_pos);
sl@0
   189
        }
sl@0
   190
        else {
sl@0
   191
          *buf++ = *cp++; --buf_size;
sl@0
   192
        }
sl@0
   193
      }
sl@0
   194
      return buf;
sl@0
   195
    }
sl@0
   196
sl@0
   197
    case 'd':
sl@0
   198
      _STLP_SPRINTF(buf, buf_size, (modifier != '#')?"%.2ld":"%ld", (long)t->tm_mday);
sl@0
   199
      return ((long)t->tm_mday < 10L && modifier == '#')?buf+1:buf + 2;
sl@0
   200
sl@0
   201
    case 'e':
sl@0
   202
      _STLP_SPRINTF(buf, buf_size, "%2ld", (long)t->tm_mday);
sl@0
   203
      return buf + 2;
sl@0
   204
sl@0
   205
    case 'H':
sl@0
   206
      _STLP_SPRINTF(buf, buf_size, (modifier != '#')?"%.2ld":"%ld", (long)t->tm_hour);
sl@0
   207
      return ((long)t->tm_hour < 10L && modifier == '#')?buf+1:buf + 2;
sl@0
   208
sl@0
   209
    case 'I':
sl@0
   210
      _STLP_SPRINTF(buf, buf_size, (modifier != '#')?"%.2ld":"%ld", (long)__hour12(t->tm_hour));
sl@0
   211
      return ((long)__hour12(t->tm_hour) < 10L && modifier == '#')?buf+1:buf + 2;
sl@0
   212
sl@0
   213
    case 'j':
sl@0
   214
      return __write_integer(buf, 0, (long)((long)t->tm_yday + 1));
sl@0
   215
sl@0
   216
    case 'm':
sl@0
   217
      _STLP_SPRINTF(buf, buf_size, (modifier != '#')?"%.2ld":"%ld", (long)t->tm_mon + 1);
sl@0
   218
      return ((long)(t->tm_mon + 1) < 10L && modifier == '#')?buf+1:buf + 2;
sl@0
   219
sl@0
   220
    case 'M':
sl@0
   221
      _STLP_SPRINTF(buf, buf_size, (modifier != '#')?"%.2ld":"%ld", (long)t->tm_min);
sl@0
   222
      return ((long)t->tm_min < 10L && modifier == '#')?buf+1:buf + 2;
sl@0
   223
sl@0
   224
    case 'p':
sl@0
   225
      return copy(table._M_am_pm[t->tm_hour/12].begin(),
sl@0
   226
                  table._M_am_pm[t->tm_hour/12].end(),
sl@0
   227
                  buf);
sl@0
   228
sl@0
   229
    case 'S': // pad with zeros
sl@0
   230
       _STLP_SPRINTF(buf, buf_size, (modifier != '#')?"%.2ld":"%ld", (long)t->tm_sec);
sl@0
   231
       return ((long)t->tm_sec < 10L && modifier == '#')?buf+1:buf + 2;
sl@0
   232
sl@0
   233
    case 'U':
sl@0
   234
      return __write_integer(buf, 0,
sl@0
   235
                             long((t->tm_yday - t->tm_wday + 7) / 7));
sl@0
   236
      //      break;
sl@0
   237
sl@0
   238
    case 'w':
sl@0
   239
      return __write_integer(buf, 0, (long)t->tm_wday);
sl@0
   240
      //      break;
sl@0
   241
sl@0
   242
    case 'W':
sl@0
   243
      return __write_integer(buf, 0,
sl@0
   244
                             (long)(t->tm_wday == 0 ? (t->tm_yday + 1) / 7 :
sl@0
   245
                                                      (t->tm_yday + 8 - t->tm_wday) / 7));
sl@0
   246
sl@0
   247
    case'x': {
sl@0
   248
      const char * cp = (modifier != '#') ? table._M_date_format.data():
sl@0
   249
                                            table._M_long_date_format.data();
sl@0
   250
      const char* cp_end = (modifier != '#') ? cp + table._M_date_format.size():
sl@0
   251
                                               cp + table._M_long_date_format.size();
sl@0
   252
      char mod;
sl@0
   253
      while (cp != cp_end) {
sl@0
   254
        if (*cp == '%') {
sl@0
   255
          ++cp; if(*cp == '#') mod = *cp++; else mod = 0;
sl@0
   256
          char *buf_pos = buf;
sl@0
   257
          buf = __write_formatted_time(buf, buf_size, *cp++, mod, table, t);
sl@0
   258
          buf_size -= (buf - buf_pos);
sl@0
   259
        }
sl@0
   260
        else {
sl@0
   261
          *buf++ = *cp++; --buf_size;
sl@0
   262
        }
sl@0
   263
      }
sl@0
   264
      return buf;
sl@0
   265
    }
sl@0
   266
sl@0
   267
    case 'X': {
sl@0
   268
      const char * cp = table._M_time_format.data();
sl@0
   269
      const char* cp_end = cp + table._M_time_format.size();
sl@0
   270
      char mod;
sl@0
   271
      while (cp != cp_end) {
sl@0
   272
        if (*cp == '%') {
sl@0
   273
          ++cp; if(*cp == '#') mod = *cp++; else mod = 0;
sl@0
   274
          char *buf_pos = buf;
sl@0
   275
          buf = __write_formatted_time(buf, buf_size, *cp++, mod, table, t);
sl@0
   276
          buf_size -= (buf - buf_pos);
sl@0
   277
        }
sl@0
   278
        else {
sl@0
   279
          *buf++ = *cp++; --buf_size;
sl@0
   280
        }
sl@0
   281
      }
sl@0
   282
      return buf;
sl@0
   283
    }
sl@0
   284
    case 'y':
sl@0
   285
      return __write_integer(buf, 0, (long)((long)(t->tm_year + 1900) % 100));
sl@0
   286
sl@0
   287
    case 'Y':
sl@0
   288
      return __write_integer(buf, 0, (long)((long)t->tm_year + 1900));
sl@0
   289
sl@0
   290
    case '%':
sl@0
   291
      *buf++ = '%';
sl@0
   292
      return buf;
sl@0
   293
sl@0
   294
#if defined (__GNUC__)
sl@0
   295
      // fbp : at least on SUN
sl@0
   296
#  if defined (_STLP_UNIX) && !defined (__linux__)
sl@0
   297
#    define __USE_BSD 1
sl@0
   298
#  endif
sl@0
   299
sl@0
   300
   /*********************************************
sl@0
   301
    *     JGS, handle various extensions        *
sl@0
   302
    *********************************************/
sl@0
   303
sl@0
   304
    case 'h': /* POSIX.2 extension */
sl@0
   305
      // same as 'b', abbrev month name
sl@0
   306
      return copy(table._M_monthname[t->tm_mon].begin(),
sl@0
   307
                  table._M_monthname[t->tm_mon].end(),
sl@0
   308
                  buf);
sl@0
   309
sl@0
   310
    case 'C': /* POSIX.2 extension */
sl@0
   311
      // same as 'd', the day
sl@0
   312
      _STLP_SPRINTF(buf, buf_size, "%2ld", (long)t->tm_mday);
sl@0
   313
      return buf + 2;
sl@0
   314
sl@0
   315
    case 'D': /* POSIX.2 extension */
sl@0
   316
      // same as 'x'
sl@0
   317
      return __subformat(table._M_date_format, buf, buf_size, table, t);
sl@0
   318
sl@0
   319
    case 'k': /* GNU extension */
sl@0
   320
      _STLP_SPRINTF(buf, buf_size, "%2ld", (long)t->tm_hour);
sl@0
   321
      return buf + 2;
sl@0
   322
sl@0
   323
    case 'l': /* GNU extension */
sl@0
   324
      _STLP_SPRINTF(buf, buf_size, "%2ld", (long)t->tm_hour % 12);
sl@0
   325
      return buf + 2;
sl@0
   326
sl@0
   327
    case 'n': /* POSIX.2 extension */
sl@0
   328
      *buf++ = '\n';
sl@0
   329
      return buf;
sl@0
   330
sl@0
   331
    case 'R': /* GNU extension */
sl@0
   332
      return __subformat("%H:%M", buf, buf_size, table, t);
sl@0
   333
sl@0
   334
    case 'r': /* POSIX.2 extension */
sl@0
   335
      return __subformat("%I:%M:%S %p", buf, buf_size, table, t);
sl@0
   336
sl@0
   337
    case 'T': /* POSIX.2 extension.  */
sl@0
   338
      return __subformat("%H:%M:%S", buf, buf_size, table, t);
sl@0
   339
sl@0
   340
    case 't': /* POSIX.2 extension.  */
sl@0
   341
      *buf++ = '\t';
sl@0
   342
      return buf;
sl@0
   343
sl@0
   344
    case 'u': /* POSIX.2 extension.  */
sl@0
   345
      return __write_integer(buf, 0, long((t->tm_wday - 1 + 7)) % 7 + 1);
sl@0
   346
sl@0
   347
    case 's': {
sl@0
   348
      time_t __t;
sl@0
   349
      __t = mktime(__CONST_CAST(tm*, t));
sl@0
   350
      return __write_integer(buf, 0, (long)__t );
sl@0
   351
    }
sl@0
   352
    case 'g': /* GNU extension */
sl@0
   353
    case 'G': {
sl@0
   354
      int year = t->tm_year + __TM_YEAR_BASE;
sl@0
   355
      int days = __iso_week_days (t->tm_yday, t->tm_wday);
sl@0
   356
      if (days < 0) {
sl@0
   357
        /* This ISO week belongs to the previous year.  */
sl@0
   358
        year--;
sl@0
   359
        days = __iso_week_days (t->tm_yday + (365 + __is_leap (year)), t->tm_wday);
sl@0
   360
      }
sl@0
   361
      else {
sl@0
   362
        int d = __iso_week_days (t->tm_yday - (365 + __is_leap (year)), t->tm_wday);
sl@0
   363
        if (0 <= d) {
sl@0
   364
          /* This ISO week belongs to the next year.  */
sl@0
   365
          ++year;
sl@0
   366
          days = d;
sl@0
   367
        }
sl@0
   368
      }
sl@0
   369
      switch (format) {
sl@0
   370
      case 'g':
sl@0
   371
        return __write_integer(buf, 0, (long)(year % 100 + 100) % 100);
sl@0
   372
      case 'G':
sl@0
   373
        return __write_integer(buf, 0, (long)year);
sl@0
   374
      default:
sl@0
   375
        return __write_integer(buf, 0, (long)days / 7 + 1);
sl@0
   376
      }
sl@0
   377
    }
sl@0
   378
sl@0
   379
#  if defined (_STLP_USE_GLIBC) && ! defined (__CYGWIN__)
sl@0
   380
    case 'z':   /* GNU extension.  */
sl@0
   381
      if (t->tm_isdst < 0)
sl@0
   382
        break;
sl@0
   383
      {
sl@0
   384
        int diff;
sl@0
   385
#    if defined (__USE_BSD) || defined (__BEOS__)
sl@0
   386
        diff = t->tm_gmtoff;
sl@0
   387
#    else
sl@0
   388
        diff = t->__tm_gmtoff;
sl@0
   389
#    endif
sl@0
   390
        if (diff < 0) {
sl@0
   391
          *buf++ = '-';
sl@0
   392
          diff = -diff;
sl@0
   393
        } else
sl@0
   394
          *buf++ = '+';
sl@0
   395
        diff /= 60;
sl@0
   396
        _STLP_SPRINTF(buf, buf_size, "%.4d", (diff / 60) * 100 + diff % 60);
sl@0
   397
        return buf + 4;
sl@0
   398
      }
sl@0
   399
#  endif /* __GLIBC__ */
sl@0
   400
#endif /* __GNUC__ */
sl@0
   401
sl@0
   402
    default:
sl@0
   403
      //      return buf;
sl@0
   404
      break;
sl@0
   405
  }
sl@0
   406
  return buf;
sl@0
   407
}
sl@0
   408
sl@0
   409
_STLP_DECLSPEC time_base::dateorder _STLP_CALL
sl@0
   410
__get_date_order(_Locale_time* time) {
sl@0
   411
  const char * fmt = _Locale_d_fmt(time);
sl@0
   412
  char first, second, third;
sl@0
   413
sl@0
   414
  while (*fmt != 0 && *fmt != '%') ++fmt;
sl@0
   415
  if (*fmt == 0)
sl@0
   416
    return time_base::no_order;
sl@0
   417
  first = *++fmt;
sl@0
   418
  while (*fmt != 0 && *fmt != '%') ++fmt;
sl@0
   419
  if (*fmt == 0)
sl@0
   420
    return time_base::no_order;
sl@0
   421
  second = *++fmt;
sl@0
   422
  while (*fmt != 0 && *fmt != '%') ++fmt;
sl@0
   423
  if (*fmt == 0)
sl@0
   424
    return time_base::no_order;
sl@0
   425
  third = *++fmt;
sl@0
   426
sl@0
   427
  switch (first) {
sl@0
   428
    case 'd':
sl@0
   429
      return (second == 'm' && third == 'y') ? time_base::dmy
sl@0
   430
                                             : time_base::no_order;
sl@0
   431
    case 'm':
sl@0
   432
      return (second == 'd' && third == 'y') ? time_base::mdy
sl@0
   433
                                             : time_base::no_order;
sl@0
   434
    case 'y':
sl@0
   435
      switch (second) {
sl@0
   436
        case 'd':
sl@0
   437
          return third == 'm' ? time_base::ydm : time_base::no_order;
sl@0
   438
        case 'm':
sl@0
   439
          return third == 'd' ? time_base::ymd : time_base::no_order;
sl@0
   440
        default:
sl@0
   441
          return time_base::no_order;
sl@0
   442
      }
sl@0
   443
    default:
sl@0
   444
      return time_base::no_order;
sl@0
   445
  }
sl@0
   446
}
sl@0
   447
sl@0
   448
_STLP_MOVE_TO_STD_NAMESPACE
sl@0
   449
sl@0
   450
sl@0
   451
#if defined (__SYMBIAN32__WSD__)
sl@0
   452
sl@0
   453
template <>
sl@0
   454
_STLP_DECLSPEC locale::id&
sl@0
   455
time_get<char, istreambuf_iterator<char, char_traits<char> > >::GetFacetLocaleId()
sl@0
   456
    {
sl@0
   457
	return get_libcpp_wsd().time_get_char_istreambuf_iterator_id;
sl@0
   458
    }
sl@0
   459
template <>
sl@0
   460
_STLP_DECLSPEC locale::id&
sl@0
   461
time_put<char, ostreambuf_iterator<char, char_traits<char> > >::GetFacetLocaleId()
sl@0
   462
	{
sl@0
   463
	return get_libcpp_wsd().time_put_char_ostreambuf_iterator_id;
sl@0
   464
	}
sl@0
   465
#  ifndef _STLP_NO_WCHAR_T
sl@0
   466
template <>
sl@0
   467
_STLP_DECLSPEC locale::id&
sl@0
   468
time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::GetFacetLocaleId()
sl@0
   469
	{
sl@0
   470
	return get_libcpp_wsd().time_get_wchar_istreambuf_iterator_id;
sl@0
   471
	}
sl@0
   472
template <>
sl@0
   473
_STLP_DECLSPEC locale::id&
sl@0
   474
time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::GetFacetLocaleId()
sl@0
   475
	{
sl@0
   476
	return get_libcpp_wsd().time_put_wchar_ostreambuf_iterator_id;
sl@0
   477
	}
sl@0
   478
#  endif /* _STLP_NO_WCHAR_T */
sl@0
   479
#endif /* __SYMBIAN32__WSD__ */
sl@0
   480
sl@0
   481
sl@0
   482
#if !defined(_STLP_NO_FORCE_INSTANTIATE)
sl@0
   483
template class time_get<char, istreambuf_iterator<char, char_traits<char> > >;
sl@0
   484
template class time_put<char, ostreambuf_iterator<char, char_traits<char> > >;
sl@0
   485
sl@0
   486
#  if !defined (_STLP_NO_WCHAR_T)
sl@0
   487
template class time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
sl@0
   488
template class time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
sl@0
   489
#  endif
sl@0
   490
sl@0
   491
#endif
sl@0
   492
sl@0
   493
#if defined(__EPOC32__)
sl@0
   494
sl@0
   495
template <>
sl@0
   496
locale::id time_get<char, istreambuf_iterator<char, char_traits<char> > >::id={16};
sl@0
   497
sl@0
   498
template <>
sl@0
   499
locale::id time_put<char, ostreambuf_iterator<char, char_traits<char> > >::id={18};
sl@0
   500
sl@0
   501
# ifndef _STLP_NO_WCHAR_T
sl@0
   502
template <>
sl@0
   503
locale::id time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id={35};
sl@0
   504
sl@0
   505
template <>
sl@0
   506
locale::id time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id={37};
sl@0
   507
# endif
sl@0
   508
sl@0
   509
#endif // __EPOC32__
sl@0
   510
sl@0
   511
_STLP_END_NAMESPACE