Address Generator 2.1.2
Postal addresses with real streets by place, laid out in each country's format for C++23
Loading...
Searching...
No Matches
dasmig::address_request Struct Reference

What an address call asks for. More...

#include <addressgen.hpp>

Public Attributes

std::optional< std::string > country {std::nullopt}
 ISO-3166 two-letter country code, or a country drawn when absent.
 
std::optional< place_ref > place {std::nullopt}
 Anchor the address to this place instead of drawing one.
 
bool weighted {true}
 Weighted selection (default): countries and places by population, streets by address count. False selects uniformly.
 
std::optional< double > unit_chance {std::nullopt}
 Chance of a unit (apartment, flat) in the address; the country's default when absent. Countries without a unit style never have one.
 
address_script script {address_script::local}
 The script of the layout and of the street name. With latin, a street named in another script is given by its Latin name when the data has one (OpenStreetMap's name:en and similar tags); otherwise it keeps the local name. Place names are Latin either way.
 

Detailed Description

What an address call asks for.

Every generation call takes one; address_request{} asks for the defaults. Choices are never stored on the generator, so one call cannot change the next.

Definition at line 66 of file addressgen.hpp.

Member Data Documentation

◆ country

std::optional<std::string> dasmig::address_request::country {std::nullopt}

ISO-3166 two-letter country code, or a country drawn when absent.

Definition at line 69 of file addressgen.hpp.

◆ place

std::optional<place_ref> dasmig::address_request::place {std::nullopt}

Anchor the address to this place instead of drawing one.

A place the data does not know is used as given (its street comes from the composed fallback and its postcode from the country's pattern), which needs country.

Definition at line 76 of file addressgen.hpp.

◆ script

address_script dasmig::address_request::script {address_script::local}

The script of the layout and of the street name. With latin, a street named in another script is given by its Latin name when the data has one (OpenStreetMap's name:en and similar tags); otherwise it keeps the local name. Place names are Latin either way.

Definition at line 91 of file addressgen.hpp.

◆ unit_chance

std::optional<double> dasmig::address_request::unit_chance {std::nullopt}

Chance of a unit (apartment, flat) in the address; the country's default when absent. Countries without a unit style never have one.

Definition at line 85 of file addressgen.hpp.

◆ weighted

bool dasmig::address_request::weighted {true}

Weighted selection (default): countries and places by population, streets by address count. False selects uniformly.

Definition at line 80 of file addressgen.hpp.


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