Skip to content

Commit

Permalink
added romanian location addresses and fixed estonian ones (#514)
Browse files Browse the repository at this point in the history
* added romanian location addresses and fixed estonian ones

I know that estonia has counties not states, as well as romania... but I'm in a really tight situation right now and can't really work. Maybe todo for location::state is check if country doesnt have states, but rather counties.

* remove cout
  • Loading branch information
eric-bodhi authored Mar 9, 2024
1 parent dcd3210 commit 1e05cac
Show file tree
Hide file tree
Showing 11 changed files with 527 additions and 215 deletions.
92 changes: 51 additions & 41 deletions include/faker-cxx/types/AddressCountry.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,59 @@
namespace faker
{
// TODO: remove when AddressCountry enum values will be same as Country values
enum class AddressCountry
{
Usa,
Poland,
France,
Russia,
Ukraine,
Italy,
Germany,
Czech,
Australia,
India,
Denmark,
Spain,
Brazil,
Finland,
Estonia
};
enum class AddressCountry
{
Usa,
Poland,
France,
Russia,
Ukraine,
Italy,
Germany,
Czech,
Australia,
India,
Denmark,
Spain,
Brazil,
Finland,
Estonia,
Romania,
};

const std::vector<AddressCountry> addressCountries{
AddressCountry::Usa, AddressCountry::Poland, AddressCountry::France,
AddressCountry::Russia, AddressCountry::Ukraine, AddressCountry::Italy,
AddressCountry::Germany, AddressCountry::Czech, AddressCountry::India,
AddressCountry::Denmark, AddressCountry::Australia, AddressCountry::Spain,
AddressCountry::Brazil, AddressCountry::Finland,
};
const std::vector<AddressCountry> addressCountries{
AddressCountry::Usa, AddressCountry::Poland, AddressCountry::France, AddressCountry::Russia,
AddressCountry::Ukraine, AddressCountry::Italy, AddressCountry::Germany, AddressCountry::Czech,
AddressCountry::India, AddressCountry::Denmark, AddressCountry::Australia, AddressCountry::Spain,
AddressCountry::Brazil, AddressCountry::Finland, AddressCountry::Estonia, AddressCountry::Romania,
};

inline std::string toString(AddressCountry country)
{
std::map<AddressCountry, std::string> countryToStringMapping{
{AddressCountry::Usa, "Usa"}, {AddressCountry::Poland, "Poland"}, {AddressCountry::France, "France"},
{AddressCountry::Russia, "Russia"}, {AddressCountry::Ukraine, "Ukraine"}, {AddressCountry::Italy, "Italy"},
{AddressCountry::Germany, "Germany"}, {AddressCountry::Czech, "Czech"}, {AddressCountry::Australia, "Australia"},
{AddressCountry::India, "India"}, {AddressCountry::Denmark, "Denmark"},
{AddressCountry::Spain, "Spain"}, {AddressCountry::Brazil, "Brazil"},
{AddressCountry::Finland, "Finland"},
};
inline std::string toString(AddressCountry country)
{
std::map<AddressCountry, std::string> countryToStringMapping{
{AddressCountry::Usa, "Usa"},
{AddressCountry::Poland, "Poland"},
{AddressCountry::France, "France"},
{AddressCountry::Russia, "Russia"},
{AddressCountry::Ukraine, "Ukraine"},
{AddressCountry::Italy, "Italy"},
{AddressCountry::Germany, "Germany"},
{AddressCountry::Czech, "Czech"},
{AddressCountry::Australia, "Australia"},
{AddressCountry::India, "India"},
{AddressCountry::Denmark, "Denmark"},
{AddressCountry::Spain, "Spain"},
{AddressCountry::Brazil, "Brazil"},
{AddressCountry::Finland, "Finland"},
{AddressCountry::Estonia, "Estonia"},
{AddressCountry::Romania, "Romania"},
};

return countryToStringMapping.at(country);
}
return countryToStringMapping.at(country);
}

inline std::ostream& operator<<(std::ostream& os, AddressCountry country)
{
return os << toString(country);
}
inline std::ostream& operator<<(std::ostream& os, AddressCountry country)
{
return os << toString(country);
}
}
Loading

0 comments on commit 1e05cac

Please sign in to comment.