![]() |
Faker C++
|
Functions | |
| template<std::integral I> requires (sizeof(I) <= sizeof(long long)) | |
| I | integer (I min, I max) |
| Generates a random integer number in the given range, bounds included. | |
| template<std::integral I> requires (sizeof(I) <= sizeof(long long)) | |
| I | integer (I max) |
| Generates a random integer between 0 and the given maximum value, bounds included. | |
| FAKER_CXX_EXPORT std::string | hexadecimal (unsigned length=1, HexCasing casing=HexCasing::Lower, HexPrefix prefix=HexPrefix::ZeroX) |
| Generates a random decimal number in the given range, bounds included. | |
| FAKER_CXX_EXPORT std::string | hexadecimal (std::optional< int > min=std::nullopt, std::optional< int > max=std::nullopt) |
| Returns a lowercase hexadecimal number. | |
| FAKER_CXX_EXPORT std::string | octal (unsigned length=1) |
| Generates an octal string. | |
| FAKER_CXX_EXPORT std::string | binary (int length=1) |
| Generates a binary string of a specified length. | |
| FAKER_CXX_EXPORT std::string | binary (int min, int max) |
| Generates a random binary string which has its decimal equivalent between min and max inclusive. | |
| FAKER_CXX_EXPORT std::string | roman (std::optional< int > min=std::nullopt, std::optional< int > max=std::nullopt) |
| Returns a roman numeral in String format. | |
| FAKER_CXX_EXPORT std::string faker::number::binary | ( | int | length = 1 | ) |
Generates a binary string of a specified length.
| length | The number of digits to generate. Defaults to `1`. |
| std::invalid_argument,if | length is negative |
| FAKER_CXX_EXPORT std::string faker::number::binary | ( | int | min, |
| int | max ) |
Generates a random binary string which has its decimal equivalent between min and max inclusive.
| min | the minimum possible decimal equivalent of the output |
| max | the maximum possible decimal equivalent of the output |
| std::invalid_argument,if | min > max, std::invalid_argument if min or max are negative |
| FAKER_CXX_EXPORT std::string faker::number::hexadecimal | ( | std::optional< int > | min = std::nullopt, |
| std::optional< int > | max = std::nullopt ) |
Returns a lowercase hexadecimal number.
| min | Optional parameter for lower bound of generated number. |
| max | Optional parameter for upper bound of generated number. |
| FAKER_CXX_EXPORT std::string faker::number::hexadecimal | ( | unsigned | length = 1, |
| HexCasing | casing = HexCasing::Lower, | ||
| HexPrefix | prefix = HexPrefix::ZeroX ) |
Generates a random decimal number in the given range, bounds included.
| F | the type of the generated number, must be a floating point type (float, double, long double). |
| min | The minimum value of the range. |
| max | The maximum value of the range. |
| std::invalid_argument | if min is greater than max. |
| I faker::number::integer | ( | I | max | ) |
Generates a random integer between 0 and the given maximum value, bounds included.
| I | the type of the generated number, must be an integral type whose size is not larger than sizeof(long long). |
| max | the maximum value of the range. |
| std::invalid_argument | if min is greater than max. |
| I faker::number::integer | ( | I | min, |
| I | max ) |
Generates a random integer number in the given range, bounds included.
| min | The minimum value of the range. |
| max | The maximum value of the range. |
| I | the type of the generated number, must be an integral type whose size is not larger than sizeof(long long). |
| std::invalid_argument | if min is greater than max. |
| FAKER_CXX_EXPORT std::string faker::number::octal | ( | unsigned | length = 1 | ) |
Generates an octal string.
| length | The number of digits to generate. Defaults to `1`. |
| FAKER_CXX_EXPORT std::string faker::number::roman | ( | std::optional< int > | min = std::nullopt, |
| std::optional< int > | max = std::nullopt ) |
Returns a roman numeral in String format.
| min | Optional parameter for lower bound of generated number. |
| max | Optional parameter for upper bound of generated number. |
| std::invalid_argument,if | min > max, std::invalid_argument if min or max are negative |
| std::invalid_argument,if | min<1, value less than 1 cannot be represented |
| std::invalid_argument,if | max>3999, value greater than 3999 cannot be represented |