Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

241 #327

Merged
merged 8 commits into from
Nov 26, 2023
Merged

241 #327

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/faker-cxx/Phone.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class Phone
* @endcode
*/
static std::string number(std::optional<std::string> = std::nullopt);
static std::string platform();
static std::string modelName();
static std::string manufacturer();

SidMalladi marked this conversation as resolved.
Show resolved Hide resolved

/**
* @brief Returns a random phone number based on country phone number template.
Expand Down
18 changes: 18 additions & 0 deletions src/modules/phone/Phone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ std::string Phone::imei()
return Helper::replaceCreditCardSymbols("##-######-######-L", '#');
}

std::string Phone::platform()
{
std::vector<std::string> platforms = {"Android OS", "iOS", "Windows Phone"};
return Helper::arrayElement(platforms);
}

std::string Phone::modelName()
{
std::vector<std::string> modelNames = {"Samsung Galaxy S9", "iPhone X", "Google Pixel 4"};
return Helper::arrayElement(modelNames);
}

std::string Phone::manufacturer()
{
std::vector<std::string> manufacturers = {"Samsung", "Apple", "Google"};
return Helper::arrayElement(manufacturers);
SidMalladi marked this conversation as resolved.
Show resolved Hide resolved
}

std::map<PhoneNumberCountryFormat, std::string> Phone::createPhoneNumberFormatMap()
{
std::map<PhoneNumberCountryFormat, std::string> formatMap;
Expand Down