Add a TimeZoneProvider::dump().

Because gdb can't always see clearly inside m_zone_vector.
This commit is contained in:
John Ralls 2018-04-27 13:27:28 -07:00
parent f6855bc0f8
commit 83e993fb80
2 changed files with 8 additions and 0 deletions

View File

@ -739,3 +739,10 @@ TimeZoneProvider::get(int year) const noexcept
return m_zone_vector.front().second;
return iter->second;
}
void
TimeZoneProvider::dump() const noexcept
{
for (auto zone : m_zone_vector)
std::cout << zone.first << ": " << zone.second->to_posix_string() << "\n";
}

View File

@ -55,6 +55,7 @@ public:
TimeZoneProvider operator=(const TimeZoneProvider&) = delete;
TimeZoneProvider operator=(const TimeZoneProvider&&) = delete;
TZ_Ptr get (int year) const noexcept;
void dump() const noexcept;
static const unsigned int min_year; //1400
static const unsigned int max_year; //9999
private: