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

Enumerations

enum class  PhoneNumberCountryFormat {
  Default , Afghanistan , AlandIslands , Albania ,
  Algeria , AmericanSamoa , Andorra , Angola ,
  Anguilla , AntiguaAndBarbuda , Argentina , Armenia ,
  Aruba , Australia , Austria , Azerbaijan ,
  Bahamas , Bahrain , Bangladesh , Barbados ,
  Belarus , Belgium , Belize , Benin ,
  Bermuda , Bhutan , Bolivia , BosniaAndHerzegovina ,
  Botswana , Brazil , BruneiDarussalam , Bulgaria ,
  BurkinaFaso , Burundi , Cambodia , Cameroon ,
  Canada , CapeVerde , CaymanIslands , CentralAfricanRepublic ,
  Chad , Chile , China , Colombia ,
  Comoros , Congo , CookIslands , CostaRica ,
  Croatia , Cuba , Curacao , Cyprus ,
  Czechia , DemocraticRepublicOfTheCongo , Denmark , Djibouti ,
  Dominica , DominicanRepublic , Ecuador , Egypt ,
  ElSalvador , EquatorialGuinea , Eritrea , Estonia ,
  Eswatini , Ethiopia , FaroeIslands , Fiji ,
  Finland , France , FrenchGuiana , FrenchPolynesia ,
  Gabon , Gambia , Georgia , Germany ,
  Ghana , Gibraltar , Greece , Greenland ,
  Grenada , Guadeloupe , Guam , Guatemala ,
  Guernsey , Guinea , GuineaBissau , Guyana ,
  Haiti , HolySeeVaticanCityState , Honduras , HongKong ,
  Hungary , Iceland , India , Indonesia ,
  Iran , Iraq , Ireland , IsleOfMan ,
  Israel , Italy , Jamaica , Japan ,
  Jersey , Jordan , RepublicOfKorea , Kuwait ,
  KyrgyzRepublic , Latvia , Lebanon , Lesotho ,
  Liberia , LibyanArabJamahiriya , Liechtenstein , Lithuania ,
  Luxembourg , Macao , Madagascar , Malawi ,
  Malaysia , Maldives , Mali , Malta ,
  MarshallIslands , Martinique , Mauritania , Mauritius ,
  Mayotte , Mexico , Micronesia , Moldova ,
  Monaco , Mongolia , Montenegro , Montserrat ,
  Morocco , Mozambique , Myanmar , Namibia ,
  Nauru , Nepal , Netherlands , NewCaledonia ,
  NewZealand , Nicaragua , Niger , Nigeria ,
  Niue , NorthMacedonia , NorthernMarianaIslands , Norway ,
  Oman , Pakistan , Palau , Palestine ,
  Panama , PapuaNewGuinea , Paraguay , Peru ,
  Philippines , Poland , Portugal , PuertoRico ,
  Qatar , Reunion , Romania , RussianFederation ,
  Rwanda , SaintBarthelemy , SaintHelena , SaintKittsAndNevis ,
  SaintLucia , SaintMartin , SaintPierreAndMiquelon , SaintVincentAndTheGrenadines ,
  Samoa , SanMarino , SaoTomeAndPrincipe , SaudiArabia ,
  Senegal , Serbia , Seychelles , SierraLeone ,
  Singapore , SintMaarten , Slovakia , Slovenia ,
  SolomonIslands , Somalia , SouthAfrica , SouthSudan ,
  Spain , SriLanka , Sudan , Suriname ,
  SvalbardAndJanMayenIslands , Sweden , Switzerland , SyrianArabRepublic ,
  Taiwan , Tajikistan , Tanzania , Thailand ,
  TimorLeste , Togo , Tonga , TrinidadAndTobago ,
  Tunisia , Turkey , Turkmenistan , TurksAndCaicosIslands ,
  Tuvalu , Uganda , Ukraine , UnitedArabEmirates ,
  UK , Usa , Uruguay , Uzbekistan ,
  Vanuatu , Venezuela , Vietnam , VirginIslandsBritish ,
  VirginIslandsUS , WallisAndFutuna , WesternSahara , Yemen ,
  Zambia , Zimbabwe
}
 

Functions

FAKER_CXX_EXPORT std::string phoneNumberByFormat (std::optional< std::string >=std::nullopt)
 Returns a random phone number.
 
FAKER_CXX_EXPORT std::string_view platform ()
 Returns a random phone platform.
 
FAKER_CXX_EXPORT std::string_view modelName ()
 Returns a random phone model.
 
FAKER_CXX_EXPORT std::string_view manufacturer ()
 Returns a random phone manufacturer.
 
FAKER_CXX_EXPORT std::string phoneNumberByCountry (std::optional< PhoneNumberCountryFormat > format=std::nullopt)
 Returns a random phone number based on country phone number template.
 
FAKER_CXX_EXPORT std::string imei ()
 Returns IMEI number.
 
FAKER_CXX_EXPORT std::string_view areaCode ()
 returns a random country area code
 
FAKER_CXX_EXPORT std::unordered_map< PhoneNumberCountryFormat, std::string > createPhoneNumberFormatMap ()
 

Enumeration Type Documentation

◆ PhoneNumberCountryFormat

Enumerator
Default 
Afghanistan 
AlandIslands 
Albania 
Algeria 
AmericanSamoa 
Andorra 
Angola 
Anguilla 
AntiguaAndBarbuda 
Argentina 
Armenia 
Aruba 
Australia 
Austria 
Azerbaijan 
Bahamas 
Bahrain 
Bangladesh 
Barbados 
Belarus 
Belgium 
Belize 
Benin 
Bermuda 
Bhutan 
Bolivia 
BosniaAndHerzegovina 
Botswana 
Brazil 
BruneiDarussalam 
Bulgaria 
BurkinaFaso 
Burundi 
Cambodia 
Cameroon 
Canada 
CapeVerde 
CaymanIslands 
CentralAfricanRepublic 
Chad 
Chile 
China 
Colombia 
Comoros 
Congo 
CookIslands 
CostaRica 
Croatia 
Cuba 
Curacao 
Cyprus 
Czechia 
DemocraticRepublicOfTheCongo 
Denmark 
Djibouti 
Dominica 
DominicanRepublic 
Ecuador 
Egypt 
ElSalvador 
EquatorialGuinea 
Eritrea 
Estonia 
Eswatini 
Ethiopia 
FaroeIslands 
Fiji 
Finland 
France 
FrenchGuiana 
FrenchPolynesia 
Gabon 
Gambia 
Georgia 
Germany 
Ghana 
Gibraltar 
Greece 
Greenland 
Grenada 
Guadeloupe 
Guam 
Guatemala 
Guernsey 
Guinea 
GuineaBissau 
Guyana 
Haiti 
HolySeeVaticanCityState 
Honduras 
HongKong 
Hungary 
Iceland 
India 
Indonesia 
Iran 
Iraq 
Ireland 
IsleOfMan 
Israel 
Italy 
Jamaica 
Japan 
Jersey 
Jordan 
RepublicOfKorea 
Kuwait 
KyrgyzRepublic 
Latvia 
Lebanon 
Lesotho 
Liberia 
LibyanArabJamahiriya 
Liechtenstein 
Lithuania 
Luxembourg 
Macao 
Madagascar 
Malawi 
Malaysia 
Maldives 
Mali 
Malta 
MarshallIslands 
Martinique 
Mauritania 
Mauritius 
Mayotte 
Mexico 
Micronesia 
Moldova 
Monaco 
Mongolia 
Montenegro 
Montserrat 
Morocco 
Mozambique 
Myanmar 
Namibia 
Nauru 
Nepal 
Netherlands 
NewCaledonia 
NewZealand 
Nicaragua 
Niger 
Nigeria 
Niue 
NorthMacedonia 
NorthernMarianaIslands 
Norway 
Oman 
Pakistan 
Palau 
Palestine 
Panama 
PapuaNewGuinea 
Paraguay 
Peru 
Philippines 
Poland 
Portugal 
PuertoRico 
Qatar 
Reunion 
Romania 
RussianFederation 
Rwanda 
SaintBarthelemy 
SaintHelena 
SaintKittsAndNevis 
SaintLucia 
SaintMartin 
SaintPierreAndMiquelon 
SaintVincentAndTheGrenadines 
Samoa 
SanMarino 
SaoTomeAndPrincipe 
SaudiArabia 
Senegal 
Serbia 
Seychelles 
SierraLeone 
Singapore 
SintMaarten 
Slovakia 
Slovenia 
SolomonIslands 
Somalia 
SouthAfrica 
SouthSudan 
Spain 
SriLanka 
Sudan 
Suriname 
SvalbardAndJanMayenIslands 
Sweden 
Switzerland 
SyrianArabRepublic 
Taiwan 
Tajikistan 
Tanzania 
Thailand 
TimorLeste 
Togo 
Tonga 
TrinidadAndTobago 
Tunisia 
Turkey 
Turkmenistan 
TurksAndCaicosIslands 
Tuvalu 
Uganda 
Ukraine 
UnitedArabEmirates 
UK 
Usa 
Uruguay 
Uzbekistan 
Vanuatu 
Venezuela 
Vietnam 
VirginIslandsBritish 
VirginIslandsUS 
WallisAndFutuna 
WesternSahara 
Yemen 
Zambia 
Zimbabwe 

Function Documentation

◆ areaCode()

FAKER_CXX_EXPORT std::string_view faker::phone::areaCode ( )

returns a random country area code

Returns
Random country area code
FAKER_CXX_EXPORT std::string_view areaCode()
returns a random country area code

◆ createPhoneNumberFormatMap()

FAKER_CXX_EXPORT std::unordered_map< PhoneNumberCountryFormat, std::string > faker::phone::createPhoneNumberFormatMap ( )

◆ imei()

FAKER_CXX_EXPORT std::string faker::phone::imei ( )

Returns IMEI number.

Returns
IMEI number.
faker::phone::imei() // "13-850175-913761-7"
FAKER_CXX_EXPORT std::string imei()
Returns IMEI number.

◆ manufacturer()

FAKER_CXX_EXPORT std::string_view faker::phone::manufacturer ( )

Returns a random phone manufacturer.

Returns
Random phone manufacturer.
FAKER_CXX_EXPORT std::string_view manufacturer()
Returns a random phone manufacturer.

◆ modelName()

FAKER_CXX_EXPORT std::string_view faker::phone::modelName ( )

Returns a random phone model.

Returns
Random phone model.
faker::phone::modelName() // "Samsung Galaxy S22"
FAKER_CXX_EXPORT std::string_view modelName()
Returns a random phone model.

◆ phoneNumberByCountry()

FAKER_CXX_EXPORT std::string faker::phone::phoneNumberByCountry ( std::optional< PhoneNumberCountryFormat > format = std::nullopt)

Returns a random phone number based on country phone number template.

Parameters
formatEnum country format, more details in PhoneNumberCountryFormat.h.
Returns
Random phone number based on country phone number template.
faker::phone::number() // "234-532-654"
faker::phone::number(PhoneNumberCountryFormat::Usa) // "+1 (395) 714-1494"
PhoneNumberCountryFormat
Definition phone.h:100
Definition airline.h:9

◆ phoneNumberByFormat()

FAKER_CXX_EXPORT std::string faker::phone::phoneNumberByFormat ( std::optional< std::string > = std::nullopt)

Returns a random phone number.

Parameters
stringThe optional string to use.
Returns
Random phone number.
faker::phone::phoneNumberByFormat("501-###-###") // "501-039-841"
faker::phone::phoneNumberByFormat("+48 91 ### ## ##") // "+48 91 463 61 70"
FAKER_CXX_EXPORT std::string phoneNumberByFormat(std::optional< std::string >=std::nullopt)
Returns a random phone number.

◆ platform()

FAKER_CXX_EXPORT std::string_view faker::phone::platform ( )

Returns a random phone platform.

Returns
Random phone platform.
FAKER_CXX_EXPORT std::string_view platform()
Returns a random phone platform.