|
Phone Generator 2.1.1
Phone numbers valid in each country's numbering plan for C++23
|
Return type for phone number generation. More...
#include <phonegen.hpp>
Public Member Functions | |
| std::string | e164 () const |
| The number in E.164. | |
| std::string | international () const |
| The number as written for international dialling. | |
| std::string | national () const |
| The number as written inside its country. | |
| std::string | rfc3966 () const |
| The number as an RFC 3966 URI. | |
| std::uint64_t | seed () const |
| Retrieve the random seed used to generate this phone number. | |
| const core::seed_signature & | signature () const |
| The seed and the data this number was generated from. | |
| std::string | to_string () const |
| Human-readable summary string. | |
| void | to_json (core::json_writer &w) const |
| Write this number as a JSON object. | |
| std::string | to_json () const |
| This number as a JSON document. | |
| operator std::string () const | |
| Implicit conversion to std::string. | |
Public Attributes | |
| std::string | country_code |
| ISO 3166-1 alpha-2 of the region the number belongs to. | |
| std::string | calling_code |
| Calling code without the plus sign ("55"). | |
| std::string | national_number |
| The digits after the calling code, without a national prefix. | |
| phone_type | type {phone_type::mobile} |
| Mobile or fixed line. | |
| bool | reserved {false} |
| True when the number comes from a range set aside for fiction. | |
Friends | |
| class | phg |
| std::ostream & | operator<< (std::ostream &os, const phone &v) |
| Stream the summary to an output stream. | |
Return type for phone number generation.
Supports implicit conversion to std::string (the international format), streaming via operator<< and JSON output via to_json().
Definition at line 82 of file phonegen.hpp.
|
inline |
|
inline |
The number as written for international dialling.
+55 11 98765-4321. Definition at line 97 of file phonegen.hpp.
|
inline |
The number as written inside its country.
(11) 98765-4321; with the national prefix where the country dials one. Definition at line 106 of file phonegen.hpp.
|
inline |
Implicit conversion to std::string.
Definition at line 173 of file phonegen.hpp.
|
inline |
The number as an RFC 3966 URI.
tel:+55-11-98765-4321. Definition at line 110 of file phonegen.hpp.
|
inline |
Retrieve the random seed used to generate this phone number.
Definition at line 134 of file phonegen.hpp.
|
inline |
The seed and the data this number was generated from.
data is phg::data_hash() at the time of generation. Definition at line 139 of file phonegen.hpp.
|
inline |
This number as a JSON document.
{"country_code":"BR","type":"mobile","e164":"+55...",...}. Definition at line 164 of file phonegen.hpp.
|
inline |
Write this number as a JSON object.
| w | Writer positioned where a value is allowed. |
Definition at line 147 of file phonegen.hpp.
|
inline |
Human-readable summary string.
Definition at line 143 of file phonegen.hpp.
|
friend |
Stream the summary to an output stream.
| os | Output stream. |
| v | The number to stream. |
Definition at line 182 of file phonegen.hpp.
|
friend |
Definition at line 214 of file phonegen.hpp.
| std::string dasmig::phone::calling_code |
Calling code without the plus sign ("55").
Definition at line 86 of file phonegen.hpp.
| std::string dasmig::phone::country_code |
ISO 3166-1 alpha-2 of the region the number belongs to.
Definition at line 85 of file phonegen.hpp.
| std::string dasmig::phone::national_number |
The digits after the calling code, without a national prefix.
Definition at line 87 of file phonegen.hpp.
| bool dasmig::phone::reserved {false} |
True when the number comes from a range set aside for fiction.
Definition at line 89 of file phonegen.hpp.
| phone_type dasmig::phone::type {phone_type::mobile} |
Mobile or fixed line.
Definition at line 88 of file phonegen.hpp.