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

Classes

struct  Currency
 

Enumerations

enum class  CreditCardType { AmericanExpress , Discover , MasterCard , Visa }
 

Functions

FAKER_CXX_EXPORT Currency currency ()
 Returns a random currency.
 
FAKER_CXX_EXPORT std::string_view currencyName ()
 Returns a random currency name.
 
FAKER_CXX_EXPORT std::string_view currencyCode ()
 Returns a random currency code.
 
FAKER_CXX_EXPORT std::string_view currencySymbol ()
 Returns a random currency symbol.
 
FAKER_CXX_EXPORT std::string_view accountType ()
 Returns a random account type.
 
FAKER_CXX_EXPORT std::string amount (double min=0, double max=1000, Precision precision=Precision::TwoDp, const std::string &symbol="")
 Generates a random amount between the given bounds (inclusive).
 
FAKER_CXX_EXPORT std::string iban (Locale locale=Locale::de_DE)
 Generates a random IBAN.
 
FAKER_CXX_EXPORT std::string_view bic (Locale locale=Locale::en_US)
 Generates a random BIC.
 
FAKER_CXX_EXPORT std::string accountNumber (unsigned length=8)
 Generates a random account number.
 
FAKER_CXX_EXPORT std::string pin (unsigned length=4)
 Generates a random PIN number.
 
FAKER_CXX_EXPORT std::string routingNumber ()
 Generates a random routing number.
 
FAKER_CXX_EXPORT std::string creditCardNumber (CreditCardType creditCardType=CreditCardType::Visa)
 Generates a random credit card number.
 
FAKER_CXX_EXPORT std::string creditCardCvv ()
 Generates a random credit card CVV.
 
FAKER_CXX_EXPORT std::string bitcoinAddress ()
 Generates a random bitcoin address.
 
FAKER_CXX_EXPORT std::string litecoinAddress ()
 Generates a random litecoin address.
 
FAKER_CXX_EXPORT std::string ethereumAddress ()
 Generates a random ethereum address.
 
FAKER_CXX_EXPORT std::string creditCardExpirationDate ()
 Generates a random expiration date.
 
FAKER_CXX_EXPORT std::string_view creditCardType ()
 Generates a random credit card type.
 

Enumeration Type Documentation

◆ CreditCardType

enum class faker::finance::CreditCardType
strong
Enumerator
AmericanExpress 
Discover 
MasterCard 
Visa 

Function Documentation

◆ accountNumber()

FAKER_CXX_EXPORT std::string faker::finance::accountNumber ( unsigned length = 8)

Generates a random account number.

Parameters
lengthThe length of the account number. Defaults to `8`.
Returns
Account number.
faker::finance::accountNumber(26) // "55875455514825927518796290"
FAKER_CXX_EXPORT std::string accountNumber(unsigned length=8)
Generates a random account number.
Definition airline.h:9

◆ accountType()

FAKER_CXX_EXPORT std::string_view faker::finance::accountType ( )

Returns a random account type.

Returns
Account type.
FAKER_CXX_EXPORT std::string_view accountType()
Returns a random account type.

◆ amount()

FAKER_CXX_EXPORT std::string faker::finance::amount ( double min = 0,
double max = 1000,
Precision precision = Precision::TwoDp,
const std::string & symbol = "" )

Generates a random amount between the given bounds (inclusive).

Parameters
minThe lower bound for the amount. Defaults to `0`.
maxThe upper bound for the amount. Defaults to `1000`.
precisionThe number of decimal points of precision for the amount. Defaults to `Precision::TwoDp`.
symbolThe symbol used to prefix the amount. Defaults to `""`.
Returns
Amount of money as string.
faker::finance::amount(5, 10) // "4.22"
faker::finance::amount(5, 10, Precision::ZeroDp) // "4"
faker::finance::amount(5, 10, Precision::TwoDp, "$") // "$5.85"
FAKER_CXX_EXPORT std::string amount(double min=0, double max=1000, Precision precision=Precision::TwoDp, const std::string &symbol="")
Generates a random amount between the given bounds (inclusive).

◆ bic()

FAKER_CXX_EXPORT std::string_view faker::finance::bic ( Locale locale = Locale::en_US)

Generates a random BIC.

Parameters
localeThe locale. Defaults to `Locale::en_US`.
Returns
BIC.
faker::finance::bic(Locale::pl_PL) // "BREXPLPWMUL"
FAKER_CXX_EXPORT std::string_view bic(Locale locale=Locale::en_US)
Generates a random BIC.

◆ bitcoinAddress()

FAKER_CXX_EXPORT std::string faker::finance::bitcoinAddress ( )

Generates a random bitcoin address.

Returns
Bitcoin address.
faker::finance::bitcoinAddress() // "3ySdvCkTLVy7gKD4j6JfSaf5d"
FAKER_CXX_EXPORT std::string bitcoinAddress()
Generates a random bitcoin address.

◆ creditCardCvv()

FAKER_CXX_EXPORT std::string faker::finance::creditCardCvv ( )

Generates a random credit card CVV.

Returns
Credit card CVV.
FAKER_CXX_EXPORT std::string creditCardCvv()
Generates a random credit card CVV.

◆ creditCardExpirationDate()

FAKER_CXX_EXPORT std::string faker::finance::creditCardExpirationDate ( )

Generates a random expiration date.

Returns
std::string date.
FAKER_CXX_EXPORT std::string creditCardExpirationDate()
Generates a random expiration date.

◆ creditCardNumber()

FAKER_CXX_EXPORT std::string faker::finance::creditCardNumber ( CreditCardType creditCardType = CreditCardType::Visa)

Generates a random credit card number.

Parameters
creditCardTypeThe type of the credit card. Defaults to `CreditCardTypeVisa`.
Returns
Credit card number.
FAKER_CXX_EXPORT std::string creditCardNumber(CreditCardType creditCardType=CreditCardType::Visa)
Generates a random credit card number.

◆ creditCardType()

FAKER_CXX_EXPORT std::string_view faker::finance::creditCardType ( )

Generates a random credit card type.

Returns
std::string creditCardType.
FAKER_CXX_EXPORT std::string_view creditCardType()
Generates a random credit card type.

◆ currency()

FAKER_CXX_EXPORT Currency faker::finance::currency ( )

Returns a random currency.

Returns
Currency.
faker::finance::currency() // "{"US Dollar","USD","$"}"
FAKER_CXX_EXPORT Currency currency()
Returns a random currency.

◆ currencyCode()

FAKER_CXX_EXPORT std::string_view faker::finance::currencyCode ( )

Returns a random currency code.

Returns
Code of the currency.
FAKER_CXX_EXPORT std::string_view currencyCode()
Returns a random currency code.

◆ currencyName()

FAKER_CXX_EXPORT std::string_view faker::finance::currencyName ( )

Returns a random currency name.

Returns
Name of the currency.
FAKER_CXX_EXPORT std::string_view currencyName()
Returns a random currency name.

◆ currencySymbol()

FAKER_CXX_EXPORT std::string_view faker::finance::currencySymbol ( )

Returns a random currency symbol.

Returns
Symbol of the currency.
FAKER_CXX_EXPORT std::string_view currencySymbol()
Returns a random currency symbol.

◆ ethereumAddress()

FAKER_CXX_EXPORT std::string faker::finance::ethereumAddress ( )

Generates a random ethereum address.

Returns
Ethereum address.
faker::finance::ethereumAddress() // "0xf03dfeecbafc5147241cc4c4ca20b3c9dfd04c4a"
FAKER_CXX_EXPORT std::string ethereumAddress()
Generates a random ethereum address.

◆ iban()

FAKER_CXX_EXPORT std::string faker::finance::iban ( Locale locale = Locale::de_DE)

Generates a random IBAN.

Parameters
localeThe locale. Defaults to `Locale::de_DE`.
Returns
IBAN.
faker::finance::iban(Locale::pl_PL) // "PL61109010140000071219812874"
FAKER_CXX_EXPORT std::string iban(Locale locale=Locale::de_DE)
Generates a random IBAN.

◆ litecoinAddress()

FAKER_CXX_EXPORT std::string faker::finance::litecoinAddress ( )

Generates a random litecoin address.

Returns
Litecoin address.
faker::finance::litecoinAddress() // "LoQaSTGWBRXkWfyxKbNKuPrAWGELzcW"
FAKER_CXX_EXPORT std::string litecoinAddress()
Generates a random litecoin address.

◆ pin()

FAKER_CXX_EXPORT std::string faker::finance::pin ( unsigned length = 4)

Generates a random PIN number.

Parameters
lengthThe length of the PIN to generate. Defaults to `4`.
Returns
PIN number.
faker::finance::pin(8) // "21378928"
FAKER_CXX_EXPORT std::string pin(unsigned length=4)
Generates a random PIN number.

◆ routingNumber()

FAKER_CXX_EXPORT std::string faker::finance::routingNumber ( )

Generates a random routing number.

Returns
Routing number.
FAKER_CXX_EXPORT std::string routingNumber()
Generates a random routing number.