|
User Generator 2.1.2
Synthetic user records for apps and test data, composed from the other dasmig generators for C++23
|
Return type for user generation. More...
#include <usergen.hpp>
Public Member Functions | |
| std::uint64_t | seed () const |
| Retrieve the random seed used to generate this user. | |
| const core::seed_signature & | signature () const |
| The seed and the data this user was generated from. | |
| sex | person_sex () const |
| Biological sex of the user. | |
| unsigned | age () const |
| Age in completed years at the request's reference date. | |
| std::string | to_string () const |
| One-line summary: name, username, email and country. | |
| void | to_json (core::json_writer &w) const |
| Write this user as a JSON object. | |
| std::string | to_json () const |
| This user as a JSON document. | |
| operator std::string () const | |
| Implicit conversion to std::string. | |
Public Attributes | |
| std::string | name |
| Full name (UTF-8), from the country's culture and the sex. | |
| std::string | given |
| The given name. | |
| std::string | family |
| The family name; empty when the name has one part. | |
| std::string | country_code |
| ISO 3166-1 alpha-2. | |
| std::string | country_name |
| Common name of the country. | |
| dasmig::birth | birthday |
| Birth date, completed-year age and sex. | |
| dasmig::address | location |
| The postal address, in the country. | |
| dasmig::phone | mobile |
| A phone number of the country. | |
| dasmig::email | |
| An email address, in the person's name. | |
| user_account | account |
| The login, dates, device and regional settings. | |
| std::optional< dasmig::device > | client |
| The device of the last sign-in; only with user_request::device. | |
Friends | |
| class | usg |
| std::ostream & | operator<< (std::ostream &os, const user &v) |
| Stream the summary to an output stream. | |
Return type for user generation.
Holds the typed result of every library in the pipeline. Supports implicit conversion to std::string (a one-line summary), streaming via operator<< and JSON output via to_json().
Definition at line 159 of file usergen.hpp.
|
inline |
Age in completed years at the request's reference date.
Definition at line 194 of file usergen.hpp.
|
inline |
Implicit conversion to std::string.
Definition at line 266 of file usergen.hpp.
|
inline |
Biological sex of the user.
Definition at line 190 of file usergen.hpp.
|
inline |
Retrieve the random seed used to generate this user.
Definition at line 177 of file usergen.hpp.
|
inline |
The seed and the data this user was generated from.
data combines the data hashes of the libraries and this one's (and device-generator's, for a user with a device). Definition at line 183 of file usergen.hpp.
|
inline |
|
inline |
Write this user as a JSON object.
Each library's result is written as that library writes it (birth, address, phone, email), next to name, given, family, sex, age, country, account and signature. account has last_login as null for an account that never logged in. With user_request::device, device follows account, as device-generator writes it; without, the key is left out.
| w | Writer positioned where a value is allowed. |
Definition at line 212 of file usergen.hpp.
|
inline |
One-line summary: name, username, email and country.
Ana Silva (ana.silva92) <ana.silva92@gmail.com>, Brazil. Definition at line 198 of file usergen.hpp.
|
friend |
Stream the summary to an output stream.
| os | Output stream. |
| v | The user to stream. |
Definition at line 275 of file usergen.hpp.
|
friend |
Definition at line 283 of file usergen.hpp.
| user_account dasmig::user::account |
The login, dates, device and regional settings.
Definition at line 171 of file usergen.hpp.
| dasmig::birth dasmig::user::birthday |
Birth date, completed-year age and sex.
Definition at line 167 of file usergen.hpp.
| std::optional<dasmig::device> dasmig::user::client |
The device of the last sign-in; only with user_request::device.
Definition at line 172 of file usergen.hpp.
| std::string dasmig::user::country_code |
ISO 3166-1 alpha-2.
Definition at line 165 of file usergen.hpp.
| std::string dasmig::user::country_name |
Common name of the country.
Definition at line 166 of file usergen.hpp.
| std::string dasmig::user::family |
The family name; empty when the name has one part.
Definition at line 164 of file usergen.hpp.
| std::string dasmig::user::given |
The given name.
Definition at line 163 of file usergen.hpp.
| dasmig::address dasmig::user::location |
The postal address, in the country.
Definition at line 168 of file usergen.hpp.
| dasmig::email dasmig::user::mail |
An email address, in the person's name.
Definition at line 170 of file usergen.hpp.
| dasmig::phone dasmig::user::mobile |
A phone number of the country.
Definition at line 169 of file usergen.hpp.
| std::string dasmig::user::name |
Full name (UTF-8), from the country's culture and the sex.
Definition at line 162 of file usergen.hpp.