From 83e993fb80ebc94c13fd4239e0321406bdf4bc6f Mon Sep 17 00:00:00 2001 From: John Ralls Date: Fri, 27 Apr 2018 13:27:28 -0700 Subject: [PATCH] Add a TimeZoneProvider::dump(). Because gdb can't always see clearly inside m_zone_vector. --- libgnucash/engine/gnc-timezone.cpp | 7 +++++++ libgnucash/engine/gnc-timezone.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/libgnucash/engine/gnc-timezone.cpp b/libgnucash/engine/gnc-timezone.cpp index a60436ad65..3d6959fb5f 100644 --- a/libgnucash/engine/gnc-timezone.cpp +++ b/libgnucash/engine/gnc-timezone.cpp @@ -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"; +} diff --git a/libgnucash/engine/gnc-timezone.hpp b/libgnucash/engine/gnc-timezone.hpp index 425bd9497e..c533cfdd6f 100644 --- a/libgnucash/engine/gnc-timezone.hpp +++ b/libgnucash/engine/gnc-timezone.hpp @@ -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: