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::street Class Reference

Return type for street generation: a street of a place. More...

#include <addressgen.hpp>

Public Member Functions

std::uint64_t seed () const
 Retrieve the random seed used to generate this street.
 
const core::seed_signature & signature () const
 The seed and the data this street was generated from.
 
void to_json (core::json_writer &w) const
 Write this street as a JSON object.
 
std::string to_json () const
 This street as a JSON document.
 
 operator std::string () const
 Implicit conversion to std::string.
 

Public Attributes

std::string name
 The street's name, with its type.
 
std::string country_code
 ISO 3166-1 alpha-2.
 
std::string city
 The place the street is in.
 
bool real_street {false}
 True when it comes from the place's own data, false when composed.
 
std::uint32_t geonameid {0}
 The place's GeoNames id; 0 for a place given by name only.
 

Friends

class adg
 
std::ostream & operator<< (std::ostream &os, const street &v)
 Stream the name to an output stream.
 

Detailed Description

Return type for street generation: a street of a place.

Converts to the street's name, streams as it and writes JSON.

Definition at line 222 of file addressgen.hpp.

Member Function Documentation

◆ operator std::string()

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

Implicit conversion to std::string.

Returns
The street's name.

Definition at line 265 of file addressgen.hpp.

◆ seed()

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

Retrieve the random seed used to generate this street.

Returns
The call seed.

Definition at line 233 of file addressgen.hpp.

◆ signature()

const core::seed_signature & dasmig::street::signature ( ) const
inline

The seed and the data this street was generated from.

Returns
The replay signature.

Definition at line 237 of file addressgen.hpp.

◆ to_json() [1/2]

std::string dasmig::street::to_json ( ) const
inline

This street as a JSON document.

Returns
Compact JSON.

Definition at line 256 of file addressgen.hpp.

◆ to_json() [2/2]

void dasmig::street::to_json ( core::json_writer &  w) const
inline

Write this street as a JSON object.

Parameters
wWriter positioned where a value is allowed.

Definition at line 241 of file addressgen.hpp.

Friends And Related Symbol Documentation

◆ adg

friend class adg
friend

Definition at line 279 of file addressgen.hpp.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const street &  v 
)
friend

Stream the name to an output stream.

Parameters
osOutput stream.
vThe street to stream.
Returns
The stream.

Definition at line 271 of file addressgen.hpp.

Member Data Documentation

◆ city

std::string dasmig::street::city

The place the street is in.

Definition at line 227 of file addressgen.hpp.

◆ country_code

std::string dasmig::street::country_code

ISO 3166-1 alpha-2.

Definition at line 226 of file addressgen.hpp.

◆ geonameid

std::uint32_t dasmig::street::geonameid {0}

The place's GeoNames id; 0 for a place given by name only.

Definition at line 229 of file addressgen.hpp.

◆ name

std::string dasmig::street::name

The street's name, with its type.

Definition at line 225 of file addressgen.hpp.

◆ real_street

bool dasmig::street::real_street {false}

True when it comes from the place's own data, false when composed.

Definition at line 228 of file addressgen.hpp.


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