This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Status of time_get and time_put facets
- From: Martin Sebor <sebor at roguewave dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Wed, 29 Jan 2003 10:52:26 -0700
- Subject: Re: Status of time_get and time_put facets
- Organization: Rogue Wave Software, Inc.
- References: <3E381212.6090901@roguewave.com>
- Reply-to: libstdc++ at gcc dot gnu dot org
L. Nicoara wrote:
Hi all!
While using the time_get facet I noticed that the get_monthname and
get_weekday operations fail. While stepping through the code I noticed
that regardless the locale name (tried a few - fr_FR, de_DE, etc.) these
operations set the failbit because they always compare the input against
the english locale names for days and months.
The time_put facet also seems broken (see below).
Regards
Martin
$ cat t.cpp; g++ --version; g++ t.cpp; LC_TIME=de_DE locale -ck LC_TIME && .
/a.out
#include <iostream>
#include <locale>
int main ()
{
const std::locale loc ("de_DE");
const std::time_put<char> &tpc =
std::use_facet<std::time_put<char> >(loc);
std::tm t = std::tm ();
for (t.tm_wday = 0; t.tm_wday != 7; ++t.tm_wday)
tpc.put (std::cout.rdbuf (), std::cout, ' ', &t, 'A') = '\n';
}
g++ (GCC) 3.2.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
LC_TIME
abday="Son;Mon;Die;Mit;Don;Fre;Sam"
day="Sonntag;Montag;Dienstag;Mittwoch;Donnerstag;Freitag;Samstag"
abmon="Jan;Feb;M<0xe4>r;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez"
mon="Januar;Februar;M<0xe4>rz;April;Mai;Juni;Juli;August;September;Oktober;Novem
ber;Dezember"
am_pm=";"
d_t_fmt="%a %d %b %Y %T %Z"
d_fmt="%d.%m.%Y"
t_fmt="%T"
t_fmt_ampm=""
era=""
era_year=""
era_d_fmt=""
alt_digits=";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
era_d_t_fmt=""
era_t_fmt=""
time-num-alt-digits=0
time-era-num-entries=0
time-era-entries-eb=""
time-era-entries-el=""
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday