-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add address country enum * add address country enum 2
- Loading branch information
1 parent
70cde2a
commit fc84291
Showing
7 changed files
with
97 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#pragma once | ||
|
||
#include <array> | ||
#include <optional> | ||
#include <string> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include <map> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace faker | ||
{ | ||
// TODO: remove when AddressCountry enum values will be same as Country values | ||
enum class AddressCountry | ||
{ | ||
Usa, | ||
Poland, | ||
France, | ||
Russia, | ||
}; | ||
|
||
const std::vector<AddressCountry> addressCountries{ | ||
AddressCountry::Usa, | ||
AddressCountry::Poland, | ||
AddressCountry::France, | ||
AddressCountry::Russia, | ||
}; | ||
|
||
inline std::string toString(AddressCountry country) | ||
{ | ||
std::map<AddressCountry, std::string> countryToStringMapping{ | ||
{AddressCountry::Usa, "Usa"}, | ||
{AddressCountry::Poland, "Poland"}, | ||
{AddressCountry::France, "France"}, | ||
{AddressCountry::Russia, "Russia"}, | ||
}; | ||
|
||
return countryToStringMapping.at(country); | ||
} | ||
|
||
inline std::ostream& operator<<(std::ostream& os, AddressCountry country) | ||
{ | ||
return os << toString(country); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include "faker-cxx/Internet.h" | ||
|
||
#include <array> | ||
#include <map> | ||
#include <utility> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#include "faker-cxx/Internet.h" | ||
|
||
#include <algorithm> | ||
#include <array> | ||
#include <charconv> | ||
#include <optional> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters