1226584Sdim// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
2226584Sdim// Free Software Foundation, Inc.
3226584Sdim//
4226584Sdim// This file is part of the GNU ISO C++ Library.  This library is free
5226584Sdim// software; you can redistribute it and/or modify it under the
6226584Sdim// terms of the GNU General Public License as published by the
7226584Sdim// Free Software Foundation; either version 2, or (at your option)
8226584Sdim// any later version.
9226584Sdim
10226584Sdim// This library is distributed in the hope that it will be useful,
11226584Sdim// but WITHOUT ANY WARRANTY; without even the implied warranty of
12226584Sdim// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13226584Sdim// GNU General Public License for more details.
14226584Sdim
15226584Sdim// You should have received a copy of the GNU General Public License along
16226584Sdim// with this library; see the file COPYING.  If not, write to the Free
17226584Sdim// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18226584Sdim// USA.
19226584Sdim
20226584Sdim// As a special exception, you may use this file as part of a free software
21249423Sdim// library without restriction.  Specifically, if other files instantiate
22249423Sdim// templates or use macros or inline functions from this file, or you compile
23226584Sdim// this file and link it with other files to produce an executable, this
24226584Sdim// file does not by itself cause the resulting executable to be covered by
25226584Sdim// the GNU General Public License.  This exception does not however
26226584Sdim// invalidate any other reasons why the executable file might be covered by
27226584Sdim// the GNU General Public License.
28226584Sdim
29226584Sdim#include <locale>
30226584Sdim
31226584Sdim_GLIBCXX_BEGIN_NAMESPACE(std)
32226584Sdim
33226584Sdim  // Definitions for static const data members of time_base.
34226584Sdim  template<>
35226584Sdim    const char*
36226584Sdim    __timepunct_cache<char>::_S_timezones[14] =
37226584Sdim    {
38226584Sdim      "GMT", "HST", "AKST", "PST", "MST", "CST", "EST", "AST", "NST", "CET",
39226584Sdim      "IST", "EET", "CST", "JST"
40226584Sdim    };
41226584Sdim
42226584Sdim#ifdef _GLIBCXX_USE_WCHAR_T
43226584Sdim  template<>
44226584Sdim    const wchar_t*
45226584Sdim    __timepunct_cache<wchar_t>::_S_timezones[14] =
46226584Sdim    {
47226584Sdim      L"GMT", L"HST", L"AKST", L"PST", L"MST", L"CST", L"EST", L"AST",
48226584Sdim      L"NST", L"CET", L"IST", L"EET", L"CST", L"JST"
49226584Sdim    };
50226584Sdim#endif
51226584Sdim
52226584Sdim  // Definitions for static const data members of money_base.
53226584Sdim  const money_base::pattern
54226584Sdim  money_base::_S_default_pattern =  { {symbol, sign, none, value} };
55226584Sdim
56226584Sdim  const char* money_base::_S_atoms = "-0123456789";
57226584Sdim
58226584Sdim  const char* __num_base::_S_atoms_in = "-+xX0123456789abcdefABCDEF";
59226584Sdim  const char* __num_base::_S_atoms_out ="-+xX0123456789abcdef0123456789ABCDEF";
60226584Sdim
61226584Sdim  // _GLIBCXX_RESOLVE_LIB_DEFECTS
62226584Sdim  // According to the resolution of DR 231, about 22.2.2.2.2, p11,
63226584Sdim  // "str.precision() is specified in the conversion specification".
64226584Sdim  void
65226584Sdim  __num_base::_S_format_float(const ios_base& __io, char* __fptr, char __mod)
66226584Sdim  {
67226584Sdim    ios_base::fmtflags __flags = __io.flags();
68226584Sdim    *__fptr++ = '%';
69226584Sdim    // [22.2.2.2.2] Table 60
70226584Sdim    if (__flags & ios_base::showpos)
71226584Sdim      *__fptr++ = '+';
72226584Sdim    if (__flags & ios_base::showpoint)
73226584Sdim      *__fptr++ = '#';
74226584Sdim
75226584Sdim    // As per DR 231: _always_, not only when
76226584Sdim    // __flags & ios_base::fixed || __prec > 0
77226584Sdim    *__fptr++ = '.';
78226584Sdim    *__fptr++ = '*';
79226584Sdim
80226584Sdim    if (__mod)
81226584Sdim      *__fptr++ = __mod;
82226584Sdim    ios_base::fmtflags __fltfield = __flags & ios_base::floatfield;
83226584Sdim    // [22.2.2.2.2] Table 58
84226584Sdim    if (__fltfield == ios_base::fixed)
85226584Sdim      *__fptr++ = 'f';
86226584Sdim    else if (__fltfield == ios_base::scientific)
87226584Sdim      *__fptr++ = (__flags & ios_base::uppercase) ? 'E' : 'e';
88226584Sdim    else
89226584Sdim      *__fptr++ = (__flags & ios_base::uppercase) ? 'G' : 'g';
90226584Sdim    *__fptr = '\0';
91226584Sdim  }
92226584Sdim
93226584Sdim_GLIBCXX_END_NAMESPACE
94226584Sdim
95226584Sdim