Faker C++
|
Enumerations | |
enum class | DateFormat { ISO , Timestamp } |
Functions | |
FAKER_CXX_EXPORT std::string | anytime (DateFormat dateFormat=DateFormat::ISO) |
Generates a random date between UNIX epoch and 200 years from now. | |
FAKER_CXX_EXPORT std::string | pastDate (int years=1, DateFormat dateFormat=DateFormat::ISO) |
Generates a random date in the past. | |
FAKER_CXX_EXPORT std::string | futureDate (int years=1, DateFormat dateFormat=DateFormat::ISO) |
Generates a random date in the future. | |
FAKER_CXX_EXPORT std::string | recentDate (int days=3, DateFormat dateFormat=DateFormat::ISO) |
Generates a random date in the recent past. | |
FAKER_CXX_EXPORT std::string | soonDate (int days=3, DateFormat dateFormat=DateFormat::ISO) |
Generates a random date in the soon future. | |
FAKER_CXX_EXPORT std::string | birthdateByAge (int minAge=18, int maxAge=80, DateFormat dateFormat=DateFormat::ISO) |
Generates a random birthdate by age. | |
FAKER_CXX_EXPORT std::string | birthdateByYear (int minYear=1920, int maxYear=2000, DateFormat dateFormat=DateFormat::ISO) |
Generates a random birthdate by year. | |
FAKER_CXX_EXPORT std::string_view | weekdayName () |
Returns a name of random day of the week. | |
FAKER_CXX_EXPORT std::string_view | weekdayAbbreviatedName () |
Returns an abbreviated name of random day of the week. | |
FAKER_CXX_EXPORT std::string_view | monthName () |
Returns a random name of a month. | |
FAKER_CXX_EXPORT std::string_view | monthAbbreviatedName () |
Returns an abbreviated name of random month. | |
FAKER_CXX_EXPORT unsigned | year () |
Returns random year. | |
FAKER_CXX_EXPORT unsigned | month () |
Returns random month. | |
FAKER_CXX_EXPORT unsigned | hour () |
Returns random hour. | |
FAKER_CXX_EXPORT unsigned | minute () |
Returns random minute. | |
FAKER_CXX_EXPORT unsigned | second () |
Returns random second. | |
FAKER_CXX_EXPORT std::string | time () |
Returns random time string. | |
FAKER_CXX_EXPORT unsigned | dayOfMonth () |
Returns random day of month. | |
FAKER_CXX_EXPORT unsigned | dayOfWeek () |
Returns random day of week. | |
FAKER_CXX_EXPORT std::string_view | timezoneRandom () |
Returns random timezone. | |
|
strong |
FAKER_CXX_EXPORT std::string faker::date::anytime | ( | DateFormat | dateFormat = DateFormat::ISO | ) |
Generates a random date between UNIX epoch and 200 years from now.
FAKER_CXX_EXPORT std::string faker::date::birthdateByAge | ( | int | minAge = 18, |
int | maxAge = 80, | ||
DateFormat | dateFormat = DateFormat::ISO ) |
Generates a random birthdate by age.
minAge | The minimum age to generate a birthdate. Defaults to `18`. |
maxAge | The maximum age to generate a birthdate. Defaults to `80`. |
FAKER_CXX_EXPORT std::string faker::date::birthdateByYear | ( | int | minYear = 1920, |
int | maxYear = 2000, | ||
DateFormat | dateFormat = DateFormat::ISO ) |
Generates a random birthdate by year.
minYear | The minimum year to generate a birthdate. Defaults to `1920`. |
maxYear | The maximum year to generate a birthdate. Defaults to `2000`. |
FAKER_CXX_EXPORT unsigned faker::date::dayOfMonth | ( | ) |
FAKER_CXX_EXPORT unsigned faker::date::dayOfWeek | ( | ) |
FAKER_CXX_EXPORT std::string faker::date::futureDate | ( | int | years = 1, |
DateFormat | dateFormat = DateFormat::ISO ) |
Generates a random date in the future.
years | The range of years the date may be in the future. Defaults to `1`. |
FAKER_CXX_EXPORT unsigned faker::date::hour | ( | ) |
FAKER_CXX_EXPORT unsigned faker::date::minute | ( | ) |
FAKER_CXX_EXPORT unsigned faker::date::month | ( | ) |
FAKER_CXX_EXPORT std::string_view faker::date::monthAbbreviatedName | ( | ) |
Returns an abbreviated name of random month.
FAKER_CXX_EXPORT std::string_view faker::date::monthName | ( | ) |
Returns a random name of a month.
FAKER_CXX_EXPORT std::string faker::date::pastDate | ( | int | years = 1, |
DateFormat | dateFormat = DateFormat::ISO ) |
Generates a random date in the past.
years | The range of years the date may be in the past. Defaults to `1`. |
FAKER_CXX_EXPORT std::string faker::date::recentDate | ( | int | days = 3, |
DateFormat | dateFormat = DateFormat::ISO ) |
Generates a random date in the recent past.
days | The range of days the date may be in the past. Defaults to `3`. |
FAKER_CXX_EXPORT unsigned faker::date::second | ( | ) |
FAKER_CXX_EXPORT std::string faker::date::soonDate | ( | int | days = 3, |
DateFormat | dateFormat = DateFormat::ISO ) |
Generates a random date in the soon future.
days | The range of days the date may be in the future. Defaults to `3`. |
FAKER_CXX_EXPORT std::string faker::date::time | ( | ) |
FAKER_CXX_EXPORT std::string_view faker::date::timezoneRandom | ( | ) |
Returns random timezone.
FAKER_CXX_EXPORT std::string_view faker::date::weekdayAbbreviatedName | ( | ) |
Returns an abbreviated name of random day of the week.
FAKER_CXX_EXPORT std::string_view faker::date::weekdayName | ( | ) |
Returns a name of random day of the week.
FAKER_CXX_EXPORT unsigned faker::date::year | ( | ) |