![]() |
Country Generator 3.3.2
Procedural country generation for C++23
|
An IANA time zone of a country, with its rules. More...
#include <countrygen.hpp>
Public Member Functions | |
| std::chrono::local_seconds | to_local (std::chrono::sys_seconds t) const |
| Local time at a UTC instant. | |
| std::chrono::sys_seconds | to_utc (std::chrono::local_seconds t, core::tz_choose choose=core::tz_choose::earliest) const |
| The UTC instant of a local time. | |
| std::uint64_t | seed () const |
| The seed this zone was drawn with. | |
| const core::seed_signature & | signature () const |
| The seed and the data this zone was drawn from. | |
| void | to_json (core::json_writer &w) const |
Write this zone as a JSON object; the offset as ±HH:MM. | |
| std::string | to_json () const |
| This zone as a JSON document. | |
| operator std::string () const | |
| Implicit conversion to std::string. | |
Public Attributes | |
| std::string | name |
| IANA name: "America/Sao_Paulo". | |
| std::string | country_code |
| ISO 3166-1 alpha-2: "BR". | |
| double | share {0.0} |
| Percent of the country's population in the zone (GeoNames). | |
| std::string | basis |
| "tzdata", "geonames" or "fallback" (doc/data.md). | |
| core::tz_rules | rules |
| The zone's rules, from the tier's first year on. | |
| std::chrono::seconds | utc_offset {} |
| At the reference date, 12:00 UTC: east of UTC. | |
| std::string | abbreviation |
| At the reference date: "-03", "CEST". | |
| bool | dst {false} |
| At the reference date: daylight time. | |
| bool | observes_dst {false} |
| Any daylight time from the reference date on. | |
Friends | |
| class | cntg |
| std::ostream & | operator<< (std::ostream &os, const time_zone &z) |
| Stream the IANA name. | |
An IANA time zone of a country, with its rules.
Definition at line 1573 of file countrygen.hpp.
|
inline |
Implicit conversion to std::string.
Definition at line 1651 of file countrygen.hpp.
|
inline |
The seed this zone was drawn with.
Definition at line 1606 of file countrygen.hpp.
|
inline |
The seed and the data this zone was drawn from.
Definition at line 1610 of file countrygen.hpp.
|
inline |
|
inline |
Write this zone as a JSON object; the offset as ±HH:MM.
| w | Writer positioned where a value is allowed. |
Definition at line 1614 of file countrygen.hpp.
|
inline |
Local time at a UTC instant.
| t | The instant. |
| std::out_of_range | Before the zone's data (core::tz_rules). |
Definition at line 1591 of file countrygen.hpp.
|
inline |
The UTC instant of a local time.
| t | The local time. |
| choose | Which instant, for a local time that occurs twice. |
| std::out_of_range | Before the zone's data (core::tz_rules). |
Definition at line 1598 of file countrygen.hpp.
|
friend |
Definition at line 1668 of file countrygen.hpp.
|
friend |
Stream the IANA name.
| os | Output stream. |
| z | Zone to stream. |
Definition at line 1660 of file countrygen.hpp.
| std::string dasmig::time_zone::abbreviation |
At the reference date: "-03", "CEST".
Definition at line 1583 of file countrygen.hpp.
| std::string dasmig::time_zone::basis |
"tzdata", "geonames" or "fallback" (doc/data.md).
Definition at line 1579 of file countrygen.hpp.
| std::string dasmig::time_zone::country_code |
ISO 3166-1 alpha-2: "BR".
Definition at line 1577 of file countrygen.hpp.
| bool dasmig::time_zone::dst {false} |
At the reference date: daylight time.
Definition at line 1584 of file countrygen.hpp.
| std::string dasmig::time_zone::name |
IANA name: "America/Sao_Paulo".
Definition at line 1576 of file countrygen.hpp.
| bool dasmig::time_zone::observes_dst {false} |
Any daylight time from the reference date on.
Definition at line 1585 of file countrygen.hpp.
| core::tz_rules dasmig::time_zone::rules |
The zone's rules, from the tier's first year on.
Definition at line 1580 of file countrygen.hpp.
| double dasmig::time_zone::share {0.0} |
Percent of the country's population in the zone (GeoNames).
Definition at line 1578 of file countrygen.hpp.
| std::chrono::seconds dasmig::time_zone::utc_offset {} |
At the reference date, 12:00 UTC: east of UTC.
Definition at line 1582 of file countrygen.hpp.