Country Generator 1.0.1
Procedural country generation for C++23
Loading...
Searching...
No Matches
dasmig::country Class Reference

Return type for country generation, holding all data fields. More...

#include <countrygen.hpp>

Public Member Functions

std::uint64_t seed () const
 Retrieve the random seed used to generate this country.
 
 operator std::string () const
 Implicit conversion to std::string.
 

Public Attributes

std::string cca2
 ISO 3166-1 alpha-2 code (e.g. "BR").
 
std::string cca3
 ISO 3166-1 alpha-3 code (e.g. "BRA").
 
std::string ccn3
 ISO 3166-1 numeric code (e.g. "076").
 
std::string name_common
 Common English name (e.g. "Brazil").
 
std::string name_official
 Official English name (e.g. "Federative Republic of Brazil").
 
std::string capital
 Capital city (semicolon-separated if multiple).
 
std::string region
 UN geoscheme region (e.g. "Americas").
 
std::string subregion
 UN geoscheme subregion (e.g. "South America").
 
std::string continent
 Continent (semicolon-separated if multiple).
 
double latitude {0.0}
 WGS84 latitude in decimal degrees.
 
double longitude {0.0}
 WGS84 longitude in decimal degrees.
 
std::uint64_t area {0}
 Total land area in km².
 
std::uint64_t population {0}
 Total population.
 
bool landlocked {false}
 Whether the country is landlocked.
 
bool independent {false}
 Whether the country is an independent sovereign state.
 
bool un_member {false}
 Whether the country is a UN member.
 
std::string languages
 Semicolon-separated language names (e.g. "Portuguese").
 
std::string currency_code
 Primary ISO 4217 currency code (e.g. "BRL").
 
std::string currency_name
 Primary currency name (e.g. "Brazilian real").
 
std::string currency_symbol
 Primary currency symbol (e.g. "R$").
 
std::string borders
 Semicolon-separated ISO alpha-3 border codes.
 
std::string timezones
 Semicolon-separated UTC offset strings.
 
std::string driving_side
 Driving side: "right" or "left".
 
std::string tld
 Country-code top-level domain (e.g. ".br").
 
std::string idd_root
 IDD root (e.g. "+5").
 
std::string idd_suffix
 IDD primary suffix (e.g. "5").
 
std::string demonym_m
 English male demonym (e.g. "Brazilian").
 
std::string demonym_f
 English female demonym (e.g. "Brazilian").
 
std::string flag_emoji
 Unicode flag emoji.
 
std::string income_level
 World Bank income level (e.g. "Upper middle income").
 
std::string start_of_week
 Start of the week: "monday", "sunday", or "saturday".
 

Friends

class cntg
 
std::ostream & operator<< (std::ostream &os, const country &c)
 Stream the common name to an output stream.
 

Detailed Description

Return type for country generation, holding all data fields.

Supports implicit conversion to std::string (returns the common name) and streaming via operator<<.

Definition at line 43 of file countrygen.hpp.

Member Function Documentation

◆ operator std::string()

dasmig::country::operator std::string ( ) const
inline

Implicit conversion to std::string.

Returns
The common English name.

Definition at line 165 of file countrygen.hpp.

◆ seed()

std::uint64_t dasmig::country::seed ( ) const
inline

Retrieve the random seed used to generate this country.

Returns
The per-call seed for replay.
See also
cntg::get_country(std::uint64_t)

Definition at line 158 of file countrygen.hpp.

Friends And Related Symbol Documentation

◆ cntg

friend class cntg
friend

Definition at line 180 of file countrygen.hpp.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const country c 
)
friend

Stream the common name to an output stream.

Definition at line 171 of file countrygen.hpp.

Member Data Documentation

◆ area

std::uint64_t dasmig::country::area {0}

Total land area in km².

Definition at line 84 of file countrygen.hpp.

◆ borders

std::string dasmig::country::borders

Semicolon-separated ISO alpha-3 border codes.

Definition at line 117 of file countrygen.hpp.

◆ capital

std::string dasmig::country::capital

Capital city (semicolon-separated if multiple).

Definition at line 64 of file countrygen.hpp.

◆ cca2

std::string dasmig::country::cca2

ISO 3166-1 alpha-2 code (e.g. "BR").

Definition at line 49 of file countrygen.hpp.

◆ cca3

std::string dasmig::country::cca3

ISO 3166-1 alpha-3 code (e.g. "BRA").

Definition at line 52 of file countrygen.hpp.

◆ ccn3

std::string dasmig::country::ccn3

ISO 3166-1 numeric code (e.g. "076").

Definition at line 55 of file countrygen.hpp.

◆ continent

std::string dasmig::country::continent

Continent (semicolon-separated if multiple).

Definition at line 75 of file countrygen.hpp.

◆ currency_code

std::string dasmig::country::currency_code

Primary ISO 4217 currency code (e.g. "BRL").

Definition at line 106 of file countrygen.hpp.

◆ currency_name

std::string dasmig::country::currency_name

Primary currency name (e.g. "Brazilian real").

Definition at line 109 of file countrygen.hpp.

◆ currency_symbol

std::string dasmig::country::currency_symbol

Primary currency symbol (e.g. "R$").

Definition at line 112 of file countrygen.hpp.

◆ demonym_f

std::string dasmig::country::demonym_f

English female demonym (e.g. "Brazilian").

Definition at line 142 of file countrygen.hpp.

◆ demonym_m

std::string dasmig::country::demonym_m

English male demonym (e.g. "Brazilian").

Definition at line 139 of file countrygen.hpp.

◆ driving_side

std::string dasmig::country::driving_side

Driving side: "right" or "left".

Definition at line 123 of file countrygen.hpp.

◆ flag_emoji

std::string dasmig::country::flag_emoji

Unicode flag emoji.

Definition at line 145 of file countrygen.hpp.

◆ idd_root

std::string dasmig::country::idd_root

IDD root (e.g. "+5").

Definition at line 131 of file countrygen.hpp.

◆ idd_suffix

std::string dasmig::country::idd_suffix

IDD primary suffix (e.g. "5").

Definition at line 134 of file countrygen.hpp.

◆ income_level

std::string dasmig::country::income_level

World Bank income level (e.g. "Upper middle income").

Definition at line 148 of file countrygen.hpp.

◆ independent

bool dasmig::country::independent {false}

Whether the country is an independent sovereign state.

Definition at line 95 of file countrygen.hpp.

◆ landlocked

bool dasmig::country::landlocked {false}

Whether the country is landlocked.

Definition at line 90 of file countrygen.hpp.

◆ languages

std::string dasmig::country::languages

Semicolon-separated language names (e.g. "Portuguese").

Definition at line 103 of file countrygen.hpp.

◆ latitude

double dasmig::country::latitude {0.0}

WGS84 latitude in decimal degrees.

Definition at line 78 of file countrygen.hpp.

◆ longitude

double dasmig::country::longitude {0.0}

WGS84 longitude in decimal degrees.

Definition at line 81 of file countrygen.hpp.

◆ name_common

std::string dasmig::country::name_common

Common English name (e.g. "Brazil").

Definition at line 58 of file countrygen.hpp.

◆ name_official

std::string dasmig::country::name_official

Official English name (e.g. "Federative Republic of Brazil").

Definition at line 61 of file countrygen.hpp.

◆ population

std::uint64_t dasmig::country::population {0}

Total population.

Definition at line 87 of file countrygen.hpp.

◆ region

std::string dasmig::country::region

UN geoscheme region (e.g. "Americas").

Definition at line 69 of file countrygen.hpp.

◆ start_of_week

std::string dasmig::country::start_of_week

Start of the week: "monday", "sunday", or "saturday".

Definition at line 151 of file countrygen.hpp.

◆ subregion

std::string dasmig::country::subregion

UN geoscheme subregion (e.g. "South America").

Definition at line 72 of file countrygen.hpp.

◆ timezones

std::string dasmig::country::timezones

Semicolon-separated UTC offset strings.

Definition at line 120 of file countrygen.hpp.

◆ tld

std::string dasmig::country::tld

Country-code top-level domain (e.g. ".br").

Definition at line 128 of file countrygen.hpp.

◆ un_member

bool dasmig::country::un_member {false}

Whether the country is a UN member.

Definition at line 98 of file countrygen.hpp.


The documentation for this class was generated from the following file: