Esempio n. 1
0
TimeZoneInfo TimeZone::GetTimeZoneInfo(char* name, const timelib_tzdb* db) {
  MapStringToTimeZoneInfo &Cache = s_timezone_data->Cache;

  MapStringToTimeZoneInfo::const_iterator iter = Cache.find(name);
  if (iter != Cache.end()) {
    return iter->second;
  }

  TimeZoneInfo tzi(timelib_parse_tzfile(name, db), tzinfo_deleter());
  if (tzi) {
    Cache[name] = tzi;
  }
  return tzi;
}
Esempio n. 2
0
TimeZoneInfo TimeZone::GetTimeZoneInfo(CStrRef name) {
  MapStringToTimeZoneInfo &Cache = s_timezone_data->Cache;

  MapStringToTimeZoneInfo::const_iterator iter = Cache.find(name.data());
  if (iter != Cache.end()) {
    return iter->second;
  }

  TimeZoneInfo tzi(timelib_parse_tzfile((char *)name.data(), GetDatabase()),
                   tzinfo_deleter());
  if (tzi) {
    Cache[name.data()] = tzi;
  }
  return tzi;
}
Esempio n. 3
0
TimeZone::TimeZone(timelib_tzinfo *tzi) {
  m_tzi = TimeZoneInfo(tzi, tzinfo_deleter());
}