summaryrefslogtreecommitdiff
path: root/src/tz_info.hh
blob: eb44e589820ce3cee357f6236e3a52f1a5f07697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef TZ_INFO_HH
#define TZ_INFO_HH

#include <filesystem>
#include <memory>
#include <optional>
#include <string_view>

class Logger;

class TzInfo {
public:
  virtual ~TzInfo() = default;

  static std::unique_ptr<TzInfo> create(std::shared_ptr<Logger> logger,
                                        std::filesystem::path tzinfo_dir);

  virtual std::optional<time_t> get_local_time(std::string_view tzname,
                                               time_t utc_time) const = 0;


protected:
  TzInfo() = default;
  TzInfo(TzInfo const&) = delete;
  TzInfo& operator=(TzInfo const&) = delete;
};

#endif  // TZ_INFO_HH