diff --git a/include/faker-cxx/types/Country.h b/include/faker-cxx/types/Country.h index bcabe430..e03de92a 100644 --- a/include/faker-cxx/types/Country.h +++ b/include/faker-cxx/types/Country.h @@ -25,13 +25,15 @@ enum class Country Slovakia, Ukraine, Denmark, - Sweden + Sweden, + Brazil }; -const std::vector countries{ - Country::Usa, Country::England, Country::Poland, Country::Italy, Country::France, Country::Germany, - Country::Russia, Country::Romania, Country::India, Country::Finland, Country::Nepal, Country::Spain, - Country::Turkey, Country::Czech, Country::Slovakia, Country::Ukraine, Country::Denmark, Country::Sweden}; +const std::vector countries{Country::Usa, Country::England, Country::Poland, Country::Italy, + Country::France, Country::Germany, Country::Russia, Country::Romania, + Country::India, Country::Finland, Country::Nepal, Country::Spain, + Country::Turkey, Country::Czech, Country::Slovakia, Country::Ukraine, + Country::Denmark, Country::Sweden, Country::Brazil}; inline std::string toString(Country country) { @@ -41,7 +43,8 @@ inline std::string toString(Country country) {Country::Russia, "Russia"}, {Country::Romania, "Romania"}, {Country::India, "India"}, {Country::Finland, "Finland"}, {Country::Nepal, "Nepal"}, {Country::Spain, "Spain"}, {Country::Turkey, "Turkey"}, {Country::Czech, "Czech"}, {Country::Slovakia, "Slovakia"}, - {Country::Ukraine, "Ukraine"}, {Country::Denmark, "Denmark"}, {Country::Sweden, "Sweden"}}; + {Country::Ukraine, "Ukraine"}, {Country::Denmark, "Denmark"}, {Country::Sweden, "Sweden"}, + {Country::Brazil, "Brazil"}}; return countryToStringMapping.at(country); } diff --git a/src/modules/person/Person.cpp b/src/modules/person/Person.cpp index 093c27fe..658de1f4 100644 --- a/src/modules/person/Person.cpp +++ b/src/modules/person/Person.cpp @@ -5,6 +5,7 @@ #include #include "../../common/FormatHelper.h" +#include "data/brazil/BrazilianPeopleNames.h" #include "data/czech/CzechPeopleNames.h" #include "data/denmark/DanishPeopleNames.h" #include "data/england/EnglishPeopleNames.h" @@ -46,7 +47,8 @@ const std::map countryToPeopleNamesMapping{ {Country::Spain, spanishPeopleNames}, {Country::Turkey, turkishPeopleNames}, {Country::Czech, czechPeopleNames}, {Country::Slovakia, slovakPeopleNames}, {Country::Ukraine, ukrainianPeopleNames}, {Country::Denmark, danishPeopleNames}, - {Country::Sweden, swedishPeopleNames}, {Country::Usa, usaPeopleNames}}; + {Country::Sweden, swedishPeopleNames}, {Country::Usa, usaPeopleNames}, + {Country::Brazil, brazilianPeopleNames}}; std::string middleNameForCountry(Country country, std::optional sex); std::string prefixForCountry(Country country, std::optional sex); diff --git a/src/modules/person/PersonTest.cpp b/src/modules/person/PersonTest.cpp index c3cca5dd..5ccc9af8 100644 --- a/src/modules/person/PersonTest.cpp +++ b/src/modules/person/PersonTest.cpp @@ -27,6 +27,7 @@ #include "data/turkey/TurkishPeopleNames.h" #include "data/ukraine/UkrainianPeopleNames.h" #include "data/ZodiacSigns.h" +#include "src/modules/person/data/brazil/BrazilianPeopleNames.h" #include "src/modules/person/data/PeopleNames.h" #include "src/modules/person/data/usa/UsaPeopleNames.h" @@ -46,7 +47,8 @@ const std::map countryToPeopleNamesMapping{ {Country::Spain, spanishPeopleNames}, {Country::Turkey, turkishPeopleNames}, {Country::Czech, czechPeopleNames}, {Country::Slovakia, slovakPeopleNames}, {Country::Ukraine, ukrainianPeopleNames}, {Country::Denmark, danishPeopleNames}, - {Country::Sweden, swedishPeopleNames}, {Country::Usa, usaPeopleNames}}; + {Country::Sweden, swedishPeopleNames}, {Country::Usa, usaPeopleNames}, + {Country::Brazil, brazilianPeopleNames}}; const std::map generatedTestName{ {Country::England, "shouldGenerateEnglishName"}, {Country::France, "shouldGenerateFrenchName"}, @@ -57,7 +59,8 @@ const std::map generatedTestName{ {Country::Spain, "shouldGenerateSpanishName"}, {Country::Turkey, "shouldGenerateTurkishName"}, {Country::Czech, "shouldGenerateCzechName"}, {Country::Slovakia, "shouldGenerateSlovakName"}, {Country::Ukraine, "shouldGenerateUkrainianName"}, {Country::Denmark, "shouldGenerateDanishName"}, - {Country::Sweden, "shouldGenerateSwedishName"}, {Country::Usa, "shouldGenerateAmericanName"}}; + {Country::Sweden, "shouldGenerateSwedishName"}, {Country::Usa, "shouldGenerateAmericanName"}, + {Country::Brazil, "shouldGenerateBrazilianName"}}; } class PersonTest : public TestWithParam diff --git a/src/modules/person/data/brazil/BrazilianFirstNames.h b/src/modules/person/data/brazil/BrazilianFirstNames.h new file mode 100644 index 00000000..502581da --- /dev/null +++ b/src/modules/person/data/brazil/BrazilianFirstNames.h @@ -0,0 +1,34 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector brazilianMalesFirstNames = { + "Alessandro", "Alexandre", "Anthony", "Antônio", "Arthur", "Benjamin", "Benício", "Bernardo", + "Breno", "Bryan", "Caio", "Calebe", "Carlos", "Cauã", "César", "Daniel", + "Danilo", "Davi", "Davi Lucca", "Deneval", "Eduardo", "Elísio", "Emanuel", "Enzo", + "Enzo Gabriel", "Fabiano", "Fabrício", "Feliciano", "Felipe", "Frederico", "Fábio", "Félix", + "Gabriel", "Gael", "Guilherme", "Gustavo", "Gúbio", "Heitor", "Henrique", "Hugo", + "Hélio", "Isaac", "Joaquim", "João", "João Lucas", "João Miguel", "João Pedro", "Júlio", + "Júlio César", "Kléber", "Ladislau", "Leonardo", "Lorenzo", "Lucas", "Lucca", "Marcelo", + "Marcos", "Matheus", "Miguel", "Murilo", "Nataniel", "Nicolas", "Noah", "Norberto", + "Pablo", "Paulo", "Pedro", "Pedro Henrique", "Pietro", "Rafael", "Raul", "Ricardo", + "Roberto", "Salvador", "Samuel", "Silas", "Sirineu", "Tertuliano", "Théo", "Vicente", + "Vitor", "Víctor", "Warley", "Washington", "Yago", "Yango", "Yuri", "Ígor"}; + +const std::vector brazilianFemalesFirstNames = { + "Alessandra", "Alice", "Aline", "Alícia", "Ana Clara", "Ana Júlia", "Ana Laura", + "Ana Luiza", "Antonella", "Beatriz", "Bruna", "Carla", "Cecília", "Clara", + "Célia", "Dalila", "Eduarda", "Elisa", "Eloá", "Emanuelly", "Esther", + "Fabrícia", "Felícia", "Giovanna", "Helena", "Heloísa", "Isabel", "Isabela", + "Isabella", "Isabelly", "Isis", "Janaína", "Joana", "Júlia", "Karla", + "Lara", "Larissa", "Laura", "Lavínia", "Liz", "Lorena", "Lorraine", + "Luiza", "Lívia", "Maitê", "Manuela", "Marcela", "Margarida", "Maria", + "Maria Alice", "Maria Cecília", "Maria Clara", "Maria Eduarda", "Maria Helena", "Maria Júlia", "Maria Luiza", + "Mariana", "Marina", "Marli", "Meire", "Melissa", "Morgana", "Márcia", + "Mércia", "Natália", "Núbia", "Ofélia", "Paula", "Rafaela", "Rebeca", + "Roberta", "Sara", "Sarah", "Sophia", "Suélen", "Sílvia", "Talita", + "Valentina", "Vitória", "Yasmin"}; +} diff --git a/src/modules/person/data/brazil/BrazilianLastNames.h b/src/modules/person/data/brazil/BrazilianLastNames.h new file mode 100644 index 00000000..459b926b --- /dev/null +++ b/src/modules/person/data/brazil/BrazilianLastNames.h @@ -0,0 +1,12 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector brazilianLastNames = { + "Silva", "Souza", "Carvalho", "Santos", "Reis", "Xavier", "Franco", + "Braga", "Macedo", "Batista", "Barros", "Moraes", "Costa", "Pereira", + "Melo", "Saraiva", "Nogueira", "Oliveira", "Martins", "Moreira", "Albuquerque"}; +} diff --git a/src/modules/person/data/brazil/BrazilianPeopleNames.h b/src/modules/person/data/brazil/BrazilianPeopleNames.h new file mode 100644 index 00000000..19e315e3 --- /dev/null +++ b/src/modules/person/data/brazil/BrazilianPeopleNames.h @@ -0,0 +1,20 @@ +#pragma once + +#include "../NameFormats.h" +#include "../PeopleNames.h" +#include "BrazilianFirstNames.h" +#include "BrazilianLastNames.h" +#include "BrazilianPrefixes.h" +#include "BrazilianSuffixes.h" + +namespace faker +{ +const NameFormats brazilianPersonNameFormats{ + {{"{prefix} {firstName} {lastName}", 1}, {"{firstName} {lastName}", 9}, {"{firstName} {lastName} {suffix}", 1}}}; + +const PeopleNames brazilianPeopleNames{ + {brazilianMalesFirstNames, {}, brazilianLastNames, brazilianMalesPrefixes, brazilianSuffixes}, + {brazilianFemalesFirstNames, {}, brazilianLastNames, brazilianFemalesPrefixes, brazilianSuffixes}, + brazilianPersonNameFormats}; + +} diff --git a/src/modules/person/data/brazil/BrazilianPrefixes.h b/src/modules/person/data/brazil/BrazilianPrefixes.h new file mode 100644 index 00000000..c9af49ae --- /dev/null +++ b/src/modules/person/data/brazil/BrazilianPrefixes.h @@ -0,0 +1,11 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector brazilianMalesPrefixes{"Sr.", "Dr."}; + +const std::vector brazilianFemalesPrefixes{"Sra.", "Srta.", "Dra."}; +} diff --git a/src/modules/person/data/brazil/BrazilianSuffixes.h b/src/modules/person/data/brazil/BrazilianSuffixes.h new file mode 100644 index 00000000..a1fc8f63 --- /dev/null +++ b/src/modules/person/data/brazil/BrazilianSuffixes.h @@ -0,0 +1,9 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector brazilianSuffixes{"Jr.", "Neto", "Filho"}; +}