Country Generator 3.3.2
Procedural country generation for C++23
Loading...
Searching...
No Matches
countrygen.hpp File Reference

Country generator library — procedural country generation for C++23. More...

#include "core.hpp"
#include <algorithm>
#include <array>
#include <charconv>
#include <chrono>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <filesystem>
#include <map>
#include <optional>
#include <ostream>
#include <set>
#include <span>
#include <stdexcept>
#include <string>
#include <string_view>
#include <system_error>
#include <tuple>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  dasmig::language_share
 One language of a country and the share of its population that speaks it. More...
 
class  dasmig::country
 Return type for country generation, holding all data fields. More...
 
struct  dasmig::country_request
 Per-call country selection options. More...
 
struct  dasmig::year_span
 The years a country's holidays are served for (holiday_years()). More...
 
struct  dasmig::locale_request
 Per-call locale selection options (cntg::get_locale()). More...
 
class  dasmig::locale
 A locale of a country: its tag, CLDR formats and calendar data. More...
 
struct  dasmig::time_zone_request
 Per-call time-zone selection options (cntg::get_time_zone()). More...
 
class  dasmig::time_zone
 An IANA time zone of a country, with its rules. More...
 
struct  dasmig::holiday_request
 What cntg::holidays() returns. More...
 
struct  dasmig::holiday
 One day of a holiday in a year. More...
 
class  dasmig::cntg
 Country generator that produces random countries from aggregated open-data sources. More...
 

Enumerations

enum class  dasmig::date_style : std::uint8_t { short_ , medium , long_ , full }
 The length of a date format (CLDR dateFormats). More...
 
enum class  dasmig::time_style : std::uint8_t { short_ , medium }
 The length of a time format (CLDR timeFormats; the long and full ones name a zone and are not stored). More...
 
enum class  dasmig::measurement : std::uint8_t { metric , us , uk }
 A country's measurement system (CLDR measurementData). More...
 
enum class  dasmig::holiday_kind : std::uint8_t { public_ , bank , optional , observance }
 What kind of day a holiday is (python-holidays' categories). More...
 
enum class  dasmig::country_table : std::uint8_t {
  countries , locales , zones , zone_links ,
  currencies , holidays , holiday_events , holiday_years
}
 The tables of the country data, for loading and extending it. More...
 

Detailed Description

Country generator library — procedural country generation for C++23.

Author
Diego Dasso Migotto (diegomigotto at hotmail dot com)
See also
See doc/usage.md for the narrative tutorial.

Definition in file countrygen.hpp.

Enumeration Type Documentation

◆ country_table

enum class dasmig::country_table : std::uint8_t
strong

The tables of the country data, for loading and extending it.

Enumerator
countries 

countries.tsv: the countries.

locales 

locales.tsv: each country's locale tags and their CLDR formats.

zones 

zones.tsv: each country's IANA zones and their rules.

zone_links 

zone_links.tsv: old zone names and the zones they now name.

currencies 

currencies.tsv: the ISO 4217 minor unit of each currency.

holidays 

holidays.tsv: each country's holiday rules.

holiday_events 

holiday_events.tsv: the dates of lunar and other calendar events.

holiday_years 

holiday_years.tsv: the years each country's holidays are served for.

Definition at line 408 of file countrygen.hpp.

◆ date_style

enum class dasmig::date_style : std::uint8_t
strong

The length of a date format (CLDR dateFormats).

Enumerator
short_ 

dd/MM/y in pt-BR.

medium 

‘d 'de’ MMM 'de' y`.

long_ 

‘d 'de’ MMMM 'de' y`.

full 

‘EEEE, d 'de’ MMMM 'de' y`.

Definition at line 374 of file countrygen.hpp.

◆ holiday_kind

enum class dasmig::holiday_kind : std::uint8_t
strong

What kind of day a holiday is (python-holidays' categories).

Enumerator
public_ 

A public holiday; always returned.

bank 

A bank holiday; always returned.

optional 

A day off for some (Brazil's Carnival, government-only days); on request.

observance 

A named day that is not a day off (Mother's Day); on request.

Definition at line 399 of file countrygen.hpp.

◆ measurement

enum class dasmig::measurement : std::uint8_t
strong

A country's measurement system (CLDR measurementData).

Enumerator
metric 

Everywhere else.

us 

The United States and Liberia.

uk 

The United Kingdom and, in CLDR 47, Myanmar.

Definition at line 391 of file countrygen.hpp.

◆ time_style

enum class dasmig::time_style : std::uint8_t
strong

The length of a time format (CLDR timeFormats; the long and full ones name a zone and are not stored).

Enumerator
short_ 

HH:mm.

medium 

HH:mm:ss.

Definition at line 384 of file countrygen.hpp.