Hegel 0.18.3
Property-based testing for C++
Loading...
Searching...
No Matches
hegel::extras::chrono_tzdb Namespace Reference

Zone sources from std::chrono::tzdb; see hegel/extras/chrono_tzdb.h. More...

Functions

generators::temporal::ZoneOracle oracle (const std::chrono::time_zone &zone, int32_t first_year=1800, int32_t last_year=2100)
 An offset oracle over a standard library time zone.
generators::temporal::ZoneSource zone_source ()
 A zone source over the standard library's time zone database, std::chrono::get_tzdb().

Detailed Description

Zone sources from std::chrono::tzdb; see hegel/extras/chrono_tzdb.h.

Function Documentation

◆ oracle()

generators::temporal::ZoneOracle hegel::extras::chrono_tzdb::oracle ( const std::chrono::time_zone & zone,
int32_t first_year = 1800,
int32_t last_year = 2100 )
inline

An offset oracle over a standard library time zone.

Parameters
zoneThe zone, which must outlive the call it is probed in.
first_yearThe first year probed.
last_yearThe last year probed; after it the yearly rule of the last two years holds.
Returns
The oracle, for ZoneSource::add_oracle().

◆ zone_source()

generators::temporal::ZoneSource hegel::extras::chrono_tzdb::zone_source ( )
inline

A zone source over the standard library's time zone database, std::chrono::get_tzdb().

Every zone and link name of the database is declared, its links added, and its release recorded as the version; each zone is probed through oracle() the first time a draw or query needs it, in the database as it is then. The names, the links and the version are those of the database when the source is built: after std::chrono::reload_tzdb(), build a new source.

Returns
A new source.
Exceptions
std::runtime_errorwhen the standard library cannot load its database.