|
Phone Generator 2.1.1
Phone numbers valid in each country's numbering plan for C++23
|
What a phone call asks for. More...
#include <phonegen.hpp>
Public Attributes | |
| std::optional< std::string > | country {std::nullopt} |
| ISO-3166 two-letter country code (any case), or a country drawn when absent. | |
| std::optional< phone_type > | type {std::nullopt} |
| Mobile or fixed line; drawn when absent (mobile seven times in ten, or the only type the country has). | |
| bool | safe {false} |
| Use numbers the regulators set aside for fiction. | |
| bool | weighted {true} |
| Weighted selection (default): countries by population and ranges by their weight: within a length every valid number is equally likely, and a plan with several lengths is drawn mostly at the length of its example number. False selects countries and ranges uniformly. | |
What a phone call asks for.
Every generation call takes one; phone_request{} asks for the defaults. Choices are never stored on the generator, so one call cannot change the next.
Definition at line 52 of file phonegen.hpp.
| std::optional<std::string> dasmig::phone_request::country {std::nullopt} |
ISO-3166 two-letter country code (any case), or a country drawn when absent.
Definition at line 56 of file phonegen.hpp.
| bool dasmig::phone_request::safe {false} |
Use numbers the regulators set aside for fiction.
Where the country has such a range the number comes from it and phone::reserved is true. Elsewhere the number is drawn outside the country's allocated ranges and phone::reserved is false; no error, so batches over random countries do not fail.
Definition at line 68 of file phonegen.hpp.
| std::optional<phone_type> dasmig::phone_request::type {std::nullopt} |
Mobile or fixed line; drawn when absent (mobile seven times in ten, or the only type the country has).
Definition at line 60 of file phonegen.hpp.
| bool dasmig::phone_request::weighted {true} |
Weighted selection (default): countries by population and ranges by their weight: within a length every valid number is equally likely, and a plan with several lengths is drawn mostly at the length of its example number. False selects countries and ranges uniformly.
Definition at line 75 of file phonegen.hpp.