|
Address Generator 2.1.2
Postal addresses with real streets by place, laid out in each country's format for C++23
|
Return type for address generation. More...
#include <addressgen.hpp>
Public Member Functions | |
| const std::vector< std::string > & | lines () const |
| The address lines in the country's order. | |
| std::string | formatted (std::string_view separator=", ") const |
| The address on one line. | |
| std::uint64_t | seed () const |
| Retrieve the random seed used to generate this address. | |
| const core::seed_signature & | signature () const |
| The seed and the data this address was generated from. | |
| std::string | to_string () const |
| Human-readable summary string. | |
| void | to_json (core::json_writer &w) const |
| Write this address as a JSON object. | |
| std::string | to_json () const |
| This address as a JSON document. | |
| operator std::string () const | |
| Implicit conversion to std::string. | |
Public Attributes | |
| std::string | country_code |
| ISO 3166-1 alpha-2. | |
| std::string | city |
| The place's name. | |
| std::string | region |
| The region as the country writes it (an abbreviation in the US). | |
| std::string | street |
| The street's name, with its type. | |
| std::uint32_t | number {0} |
| House number; 0 when the street has none. | |
| std::string | unit |
| Apartment or flat, empty when there is none. | |
| std::string | postcode |
| In the country's format; empty where there are no postcodes. | |
| bool | real_street {false} |
| True when the street comes from the place's own data, false when composed. | |
| std::uint32_t | geonameid {0} |
| The place's GeoNames id (city-generator's); 0 for a place given by name only. | |
Friends | |
| class | adg |
| std::ostream & | operator<< (std::ostream &os, const address &v) |
| Stream the summary to an output stream. | |
Return type for address generation.
Supports implicit conversion to std::string (the address on one line), streaming via operator<< and JSON output via to_json().
Definition at line 116 of file addressgen.hpp.
|
inline |
The address on one line.
| separator | Placed between the lines. |
Definition at line 136 of file addressgen.hpp.
|
inline |
The address lines in the country's order.
Definition at line 131 of file addressgen.hpp.
|
inline |
Implicit conversion to std::string.
Definition at line 197 of file addressgen.hpp.
|
inline |
Retrieve the random seed used to generate this address.
Definition at line 150 of file addressgen.hpp.
|
inline |
The seed and the data this address was generated from.
data is adg::data_hash() at the time of generation. Definition at line 155 of file addressgen.hpp.
|
inline |
This address as a JSON document.
Definition at line 188 of file addressgen.hpp.
|
inline |
Write this address as a JSON object.
| w | Writer positioned where a value is allowed. |
Definition at line 166 of file addressgen.hpp.
|
inline |
Human-readable summary string.
Definition at line 162 of file addressgen.hpp.
|
friend |
Definition at line 216 of file addressgen.hpp.
|
friend |
Stream the summary to an output stream.
| os | Output stream. |
| v | The address to stream. |
Definition at line 206 of file addressgen.hpp.
| std::string dasmig::address::city |
The place's name.
Definition at line 120 of file addressgen.hpp.
| std::string dasmig::address::country_code |
ISO 3166-1 alpha-2.
Definition at line 119 of file addressgen.hpp.
| std::uint32_t dasmig::address::geonameid {0} |
The place's GeoNames id (city-generator's); 0 for a place given by name only.
Definition at line 127 of file addressgen.hpp.
| std::uint32_t dasmig::address::number {0} |
House number; 0 when the street has none.
Definition at line 123 of file addressgen.hpp.
| std::string dasmig::address::postcode |
In the country's format; empty where there are no postcodes.
Definition at line 125 of file addressgen.hpp.
| bool dasmig::address::real_street {false} |
True when the street comes from the place's own data, false when composed.
Definition at line 126 of file addressgen.hpp.
| std::string dasmig::address::region |
The region as the country writes it (an abbreviation in the US).
Definition at line 121 of file addressgen.hpp.
| std::string dasmig::address::street |
The street's name, with its type.
Definition at line 122 of file addressgen.hpp.
| std::string dasmig::address::unit |
Apartment or flat, empty when there is none.
Definition at line 124 of file addressgen.hpp.