void _STLP_CALL _Init_timeinfo(_Time_Info& table, _Locale_time * time) {
  int i;
  for (i = 0; i < 7; ++i)
    table._M_dayname[i] = _Locale_abbrev_dayofweek(time, i);
  for (i = 0; i < 7; ++i)
    table._M_dayname[i+7] = _Locale_full_dayofweek(time, i);
  for (i = 0; i < 12; ++i)
    table._M_monthname[i] = _Locale_abbrev_monthname(time, i);
  for (i = 0; i < 12; ++i)
    table._M_monthname[i+12] = _Locale_full_monthname(time, i);
  table._M_am_pm[0] = _Locale_am_str(time);
  table._M_am_pm[1] = _Locale_pm_str(time);
  table._M_time_format = _Locale_t_fmt(time);
  if ( table._M_time_format == "%T" ) {
    table._M_time_format = "%H:%M:%S";
  } else if ( table._M_time_format == "%r" ) {
    table._M_time_format = "%I:%M:%S %p";
  } else if ( table._M_time_format == "%R" ) {
    table._M_time_format = "%H:%M";
  }
  table._M_date_format = _Locale_d_fmt(time);
  table._M_date_time_format = _Locale_d_t_fmt(time);
  table._M_long_date_format = _Locale_long_d_fmt(time);
  table._M_long_date_time_format = _Locale_long_d_t_fmt(time);
}
Esempio n. 2
0
static void _Init_timeinfo(_Time_Info& table, _Locale_time * time) {
  int i;
  for (i = 0; i < 7; ++i)
    table._M_dayname[i] = _Locale_abbrev_dayofweek(time, i);
  for (i = 0; i < 7; ++i)
    table._M_dayname[i+7] = _Locale_full_dayofweek(time, i);
  for (i = 0; i < 12; ++i)
    table._M_monthname[i] = _Locale_abbrev_monthname(time, i);
  for (i = 0; i < 12; ++i)
    table._M_monthname[i+12] = _Locale_full_monthname(time, i);
  table._M_am_pm[0] = _Locale_am_str(time);
  table._M_am_pm[1] = _Locale_pm_str(time);
  _Init_timeinfo_base(table, time);
}
Esempio n. 3
0
void __STL_CALL __init_timeinfo(_Time_Info& table, _Locale_time * time) {
  int i;
  for (i = 0; i < 7; ++i)
    copy_cstring(_Locale_abbrev_dayofweek(time)[i],
		 table._M_dayname[i]);
  for (i = 0; i < 7; ++i)
    copy_cstring(_Locale_full_dayofweek(time)[i],
		 table._M_dayname[i+7]); 
  for (i = 0; i < 12; ++i)
    copy_cstring(_Locale_abbrev_monthname(time)[i],
		 table._M_monthname[i]);
  for (i = 0; i < 12; ++i)
    copy_cstring(_Locale_full_monthname(time)[i],
		 table._M_monthname[i+12]);
  copy_cstring(_Locale_am_str(time),
		 table._M_am_pm[0]);
  copy_cstring(_Locale_pm_str(time),
	       table._M_am_pm[1]);
  copy_cstring(_Locale_t_fmt(time), table._M_time_format);
  copy_cstring(_Locale_d_fmt(time), table._M_date_format);
  copy_cstring(_Locale_d_t_fmt(time), table._M_date_time_format);
}