Faker C++
Loading...
Searching...
No Matches
faker::person Namespace Reference

Enumerations

enum class  Sex { Female , Male }
 

Functions

FAKER_CXX_EXPORT std::string_view firstName (Locale locale=Locale::en_US, std::optional< Sex > sex=std::nullopt)
 Returns a random first name.
 
FAKER_CXX_EXPORT std::string_view lastName (Locale locale=Locale::en_US, std::optional< Sex > sex=std::nullopt)
 Returns a random last name.
 
FAKER_CXX_EXPORT std::string fullName (Locale locale=Locale::en_US, std::optional< Sex > sex=std::nullopt)
 Returns a random full name.
 
FAKER_CXX_EXPORT std::string_view prefix (Locale locale=Locale::en_US, std::optional< Sex > sex=std::nullopt)
 Returns a random name prefix.
 
FAKER_CXX_EXPORT std::string_view suffix (Locale locale=Locale::en_US, std::optional< Sex > sex=std::nullopt)
 Returns a random name suffix.
 
FAKER_CXX_EXPORT std::string bio ()
 Returns a random bio.
 
FAKER_CXX_EXPORT std::string_view sex (Locale locale=Locale::en_US)
 Returns a random sex of the locale passed.
 
FAKER_CXX_EXPORT std::string_view gender ()
 Returns a random gender.
 
FAKER_CXX_EXPORT std::string jobTitle ()
 Returns a random job title.
 
FAKER_CXX_EXPORT std::string_view jobDescriptor ()
 Returns a random job descriptor.
 
FAKER_CXX_EXPORT std::string_view jobArea ()
 Returns a random job area.
 
FAKER_CXX_EXPORT std::string_view jobType ()
 Returns a random job type.
 
FAKER_CXX_EXPORT std::string_view hobby ()
 Returns a random hobby.
 
FAKER_CXX_EXPORT std::string_view language ()
 Returns a random language.
 
FAKER_CXX_EXPORT std::string_view nationality ()
 Returns a random nationality.
 
FAKER_CXX_EXPORT std::string ssn (Locale locale=Locale::en_US)
 Returns a random SSN.
 
FAKER_CXX_EXPORT std::string_view westernZodiac ()
 Returns a random Western Zodiac.
 
FAKER_CXX_EXPORT std::string_view chineseZodiac ()
 Returns a random Chinese Zodiac.
 
FAKER_CXX_EXPORT std::string passport (Locale locale=Locale::en_US)
 Returns a random passport number from a given country.
 

Enumeration Type Documentation

◆ Sex

enum class faker::person::Sex
strong
Enumerator
Female 
Male 

Function Documentation

◆ bio()

FAKER_CXX_EXPORT std::string faker::person::bio ( )

Returns a random bio.

Returns
Bio.
faker::person::bio() //"Developer"
FAKER_CXX_EXPORT std::string bio()
Returns a random bio.

◆ chineseZodiac()

FAKER_CXX_EXPORT std::string_view faker::person::chineseZodiac ( )

Returns a random Chinese Zodiac.

Returns
Chinese Zodiac
FAKER_CXX_EXPORT std::string_view chineseZodiac()
Returns a random Chinese Zodiac.

◆ firstName()

FAKER_CXX_EXPORT std::string_view faker::person::firstName ( Locale locale = Locale::en_US,
std::optional< Sex > sex = std::nullopt )

Returns a random first name.

Parameters
localeThe locale. Defaults to `Locale::en_US`.
sexThe optional sex to use.
Returns
First name starting with a capital letter.
faker::person::firstName(Locale::en_US, Sex::Female) // "Emma"
faker::person::firstName(Locale::en_US, Sex::Male) // "Arthur"
FAKER_CXX_EXPORT std::string_view firstName(Locale locale=Locale::en_US, std::optional< Sex > sex=std::nullopt)
Returns a random first name.
Sex
Definition person.h:13
Definition airline.h:9

◆ fullName()

FAKER_CXX_EXPORT std::string faker::person::fullName ( Locale locale = Locale::en_US,
std::optional< Sex > sex = std::nullopt )

Returns a random full name.

Parameters
localeThe locale. Defaults to `Locale::en_US`.
sexThe optional sex to use.
Returns
Full name starting with first name.
faker::person::fullName() // "Marcia Robinson"
faker::person::fullName(Locale::en_US, Sex::Female) // "Jennifer Martin"
faker::person::fullName(Locale::en_US, Sex::Male) // "Samuel Walker"
FAKER_CXX_EXPORT std::string fullName(Locale locale=Locale::en_US, std::optional< Sex > sex=std::nullopt)
Returns a random full name.

◆ gender()

FAKER_CXX_EXPORT std::string_view faker::person::gender ( )

Returns a random gender.

Returns
Gender.
faker::person::gender() // "Transexual woman"
FAKER_CXX_EXPORT std::string_view gender()
Returns a random gender.

◆ hobby()

FAKER_CXX_EXPORT std::string_view faker::person::hobby ( )

Returns a random hobby.

Returns
Hobby.
faker::person::hobby() // "Gaming"
FAKER_CXX_EXPORT std::string_view hobby()
Returns a random hobby.

◆ jobArea()

FAKER_CXX_EXPORT std::string_view faker::person::jobArea ( )

Returns a random job area.

Returns
Job area.
faker::person::jobArea() // "Software"
FAKER_CXX_EXPORT std::string_view jobArea()
Returns a random job area.

◆ jobDescriptor()

FAKER_CXX_EXPORT std::string_view faker::person::jobDescriptor ( )

Returns a random job descriptor.

Returns
Job descriptor.
FAKER_CXX_EXPORT std::string_view jobDescriptor()
Returns a random job descriptor.

◆ jobTitle()

FAKER_CXX_EXPORT std::string faker::person::jobTitle ( )

Returns a random job title.

Returns
Job title.
faker::person::jobTitle() // "Global Accounts Engineer"
FAKER_CXX_EXPORT std::string jobTitle()
Returns a random job title.

◆ jobType()

FAKER_CXX_EXPORT std::string_view faker::person::jobType ( )

Returns a random job type.

Returns
Job type.
faker::person::jobType() // "Engineer"
FAKER_CXX_EXPORT std::string_view jobType()
Returns a random job type.

◆ language()

FAKER_CXX_EXPORT std::string_view faker::person::language ( )

Returns a random language.

Returns
Language.
FAKER_CXX_EXPORT std::string_view language()
Returns a random language.

◆ lastName()

FAKER_CXX_EXPORT std::string_view faker::person::lastName ( Locale locale = Locale::en_US,
std::optional< Sex > sex = std::nullopt )

Returns a random last name.

Parameters
localeThe locale. Defaults to `Locale::en_US`.
sexThe optional sex to use.
Returns
Last name starting with a capital letter.
faker::person::lastName() // "Peterson"
FAKER_CXX_EXPORT std::string_view lastName(Locale locale=Locale::en_US, std::optional< Sex > sex=std::nullopt)
Returns a random last name.

◆ nationality()

FAKER_CXX_EXPORT std::string_view faker::person::nationality ( )

Returns a random nationality.

Returns
Nationality.
FAKER_CXX_EXPORT std::string_view nationality()
Returns a random nationality.

◆ passport()

FAKER_CXX_EXPORT std::string faker::person::passport ( Locale locale = Locale::en_US)

Returns a random passport number from a given country.

Parameters
localeThe optional locale to use. Defaults to `Locale::en_US`.
Returns
Passport
faker::person::passport(Locale::pl_PL) // "12345678"
FAKER_CXX_EXPORT std::string passport(Locale locale=Locale::en_US)
Returns a random passport number from a given country.

◆ prefix()

FAKER_CXX_EXPORT std::string_view faker::person::prefix ( Locale locale = Locale::en_US,
std::optional< Sex > sex = std::nullopt )

Returns a random name prefix.

Parameters
localeThe locale. Defaults to `Locale::en_US`.
sexThe optional sex to use.
Returns
Name prefix.
faker::person::prefix(Locale::en_US, Sex::Female) // "Ms."
faker::person::prefix(Locale::en_US, Sex::Male) // "Mr."
FAKER_CXX_EXPORT std::string_view prefix(Locale locale=Locale::en_US, std::optional< Sex > sex=std::nullopt)
Returns a random name prefix.

◆ sex()

FAKER_CXX_EXPORT std::string_view faker::person::sex ( Locale locale = Locale::en_US)

Returns a random sex of the locale passed.

Parameters
localeThe locale. Defaults to `Locale::en_US`.
Returns
Sex.
faker::person::sex() // "Male"
faker::person::sex(Locale::en_US) // "Male"
FAKER_CXX_EXPORT std::string_view sex(Locale locale=Locale::en_US)
Returns a random sex of the locale passed.

◆ ssn()

FAKER_CXX_EXPORT std::string faker::person::ssn ( Locale locale = Locale::en_US)

Returns a random SSN.

Parameters
localeThe optional locale to use. Defaults to `Locale::en_US`.
Returns
Social Security Number.
faker::person::ssn() // "437-12-6854"
faker::person::ssn(Locale::pl_PL) // "95111901567"
FAKER_CXX_EXPORT std::string ssn(Locale locale=Locale::en_US)
Returns a random SSN.

◆ suffix()

FAKER_CXX_EXPORT std::string_view faker::person::suffix ( Locale locale = Locale::en_US,
std::optional< Sex > sex = std::nullopt )

Returns a random name suffix.

Parameters
localeThe locale. Defaults to `Locale::en_US`.
sexThe optional sex to use.
Returns
Name suffix.
faker::person::suffix(Locale::en_US, Sex::Male) // "Jr."
FAKER_CXX_EXPORT std::string_view suffix(Locale locale=Locale::en_US, std::optional< Sex > sex=std::nullopt)
Returns a random name suffix.

◆ westernZodiac()

FAKER_CXX_EXPORT std::string_view faker::person::westernZodiac ( )

Returns a random Western Zodiac.

Returns
Western Zodiac
FAKER_CXX_EXPORT std::string_view westernZodiac()
Returns a random Western Zodiac.