diff --git a/include/faker-cxx/types/Country.h b/include/faker-cxx/types/Country.h index 262cea5ac..29ca25a76 100644 --- a/include/faker-cxx/types/Country.h +++ b/include/faker-cxx/types/Country.h @@ -35,28 +35,34 @@ enum class Country Greece, Slovenia, Austria, + Switzerland, }; 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, Country::Norway, Country::Japan, Country::Portugal, Country::Hungary, Country::Croatia, - Country::Greece, Country::Slovenia, Country::Austria, + 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, Country::Norway, Country::Japan, Country::Portugal, Country::Hungary, Country::Croatia, + Country::Greece, Country::Slovenia, Country::Austria, Country::Switzerland, }; inline std::string toString(Country country) { std::map countryToStringMapping{ - {Country::Usa, "Usa"}, {Country::England, "England"}, {Country::Poland, "Poland"}, - {Country::Italy, "Italy"}, {Country::France, "France"}, {Country::Germany, "Germany"}, - {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::Brazil, "Brazil"}, {Country::Norway, "Norway"}, {Country::Japan, "Japan"}, - {Country::Portugal, "Portugal"}, {Country::Hungary, "Hungary"}, {Country::Croatia, "Croatia"}, - {Country::Greece, "Greece"}, {Country::Slovenia, "Slovenia"}, {Country::Austria, "Austria"}, + {Country::Usa, "Usa"}, {Country::England, "England"}, + {Country::Poland, "Poland"}, {Country::Italy, "Italy"}, + {Country::France, "France"}, {Country::Germany, "Germany"}, + {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::Brazil, "Brazil"}, {Country::Norway, "Norway"}, + {Country::Japan, "Japan"}, {Country::Portugal, "Portugal"}, + {Country::Hungary, "Hungary"}, {Country::Croatia, "Croatia"}, + {Country::Greece, "Greece"}, {Country::Slovenia, "Slovenia"}, + {Country::Austria, "Austria"}, {Country::Switzerland, "Switzerland"}, }; return countryToStringMapping.at(country); diff --git a/src/modules/person/Person.cpp b/src/modules/person/Person.cpp index 3d5b58554..f953f8e7f 100644 --- a/src/modules/person/Person.cpp +++ b/src/modules/person/Person.cpp @@ -34,6 +34,7 @@ #include "data/slovenia/SlovenianPeopleNames.h" #include "data/spain/SpanishPeopleNames.h" #include "data/sweden/SwedishPeopleNames.h" +#include "data/switzerland/SwissPeopleNames.h" #include "data/turkey/TurkishPeopleNames.h" #include "data/ukraine/UkrainianPeopleNames.h" #include "data/usa/UsaPeopleNames.h" @@ -61,7 +62,7 @@ const std::map countryToPeopleNamesMapping{ {Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames}, {Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames}, {Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames}, - {Country::Austria, austrianPeopleNames}, + {Country::Austria, austrianPeopleNames}, {Country::Switzerland, swissPeopleNames}, }; std::string middleNameForCountry(Country country, std::optional sex); diff --git a/src/modules/person/PersonTest.cpp b/src/modules/person/PersonTest.cpp index b4312e63f..4e6cc7962 100644 --- a/src/modules/person/PersonTest.cpp +++ b/src/modules/person/PersonTest.cpp @@ -33,6 +33,7 @@ #include "data/slovenia/SlovenianPeopleNames.h" #include "data/spain/SpanishPeopleNames.h" #include "data/sweden/SwedishPeopleNames.h" +#include "data/switzerland/SwissPeopleNames.h" #include "data/turkey/TurkishPeopleNames.h" #include "data/ukraine/UkrainianPeopleNames.h" #include "data/ZodiacSigns.h" @@ -61,7 +62,7 @@ const std::map countryToPeopleNamesMapping{ {Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames}, {Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames}, {Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames}, - {Country::Austria, austrianPeopleNames}, + {Country::Austria, austrianPeopleNames}, {Country::Switzerland, swissPeopleNames}, }; const std::map generatedTestName{ @@ -78,7 +79,7 @@ const std::map generatedTestName{ {Country::Japan, "shouldGenerateJapaneseName"}, {Country::Portugal, "shouldGeneratePortugueseName"}, {Country::Hungary, "shouldGenerateHungarianName"}, {Country::Croatia, "shouldGenerateCroatianName"}, {Country::Greece, "shouldGenerateGreekName"}, {Country::Slovenia, "shouldGenerateSlovenianName"}, - {Country::Austria, "shouldGenerateAustrianName"}, + {Country::Austria, "shouldGenerateAustrianName"}, {Country::Switzerland, "shouldGenerateSwissName"}, }; } diff --git a/src/modules/person/data/switzerland/SwissFirstNames.h b/src/modules/person/data/switzerland/SwissFirstNames.h new file mode 100644 index 000000000..6d7232833 --- /dev/null +++ b/src/modules/person/data/switzerland/SwissFirstNames.h @@ -0,0 +1,57 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector swissMalesFirstNames = { + "Alfons", "Alfred", "Alois", "André", "Andreas", "Angelo", "Antoine", + "Anton", "Antonio", "Armin", "Arnold", "Arthur", "Beat", "Bernard", + "Bernhard", "Bruno", "Carlo", "Charles", "Christian", "Christoph", "Christophe", + "Claude", "Claudio", "Daniel", "Daniele", "David", "Denis", "Didier", + "Dieter", "Dominik", "Dominique", "Edgar", "Eduard", "Edwin", "Emil", + "Enrico", "Eric", "Erich", "Ernst", "Erwin", "Eugen", "Felix", + "Ferdinand", "Francesco", "Francis", "Franco", "François", "Frank", "Franz", + "Frédéric", "Fredy", "Fridolin", "Friedrich", "Fritz", "Gabriel", "Georg", + "Georges", "Gérald", "Gérard", "Gerhard", "Gianni", "Gilbert", "Giorgio", + "Giovanni", "Giuseppe", "Gottfried", "Guido", "Guy", "Hans", "Hans-Peter", + "Hans-Rudolf", "Hans-Ulrich", "Hansjörg", "Hanspeter", "Hansruedi", "Hansueli", "Harry", + "Heinrich", "Heinz", "Helmut", "Henri", "Herbert", "Hermann", "Hubert", + "Hugo", "Jacques", "Jakob", "Jan", "Jean-Claude", "Jean-Daniel", "Jean-François", + "Jean-Jacques", "Jean-Louis", "Jean-Luc", "Jean-Marc", "Jean-Marie", "Jean-Paul", "Jean-Pierre", + "Johann", "Johannes", "John", "Jörg", "Josef", "Joseph", "Jürg", + "Karl", "Klaus", "Konrad", "Kurt", "Laurent", "Leo", "Louis", + "Luca", "Luigi", "Lukas", "Manfred", "Manuel", "Marc", "Marcel", + "Marco", "Mario", "Markus", "Martin", "Massimo", "Matthias", "Maurice", + "Max", "Michael", "Michel", "Nicolas", "Niklaus", "Norbert", "Olivier", + "Oskar", "Otto", "Paolo", "Pascal", "Patrick", "Paul", "Peter", + "Philipp", "Philippe", "Pierre", "Pierre-Alain", "Pierre-André", "Pius", "Rainer", + "Raymond", "Reinhard", "Remo", "Renato", "Rene", "René", "Reto", + "Richard", "Rudolf", "Ruedi", "Samuel", "Sandro", "Serge", "Silvio", + "Simon", "Stefan", "Stephan", "Stéphane", "Theo", "Theodor", "Thomas", + "Ueli", "Ulrich", "Urs", "Victor", "Viktor", "Walter", "Werner", + "Willi", "Willy", "Wolfgang", "Yves", +}; + +const std::vector swissFemalesFirstNames = { + "Alice", "Andrea", "Angela", "Anita", "Anna", "Anne", "Anne-Marie", "Annemarie", + "Astrid", "Barbara", "Beatrice", "Beatrix", "Bernadette", "Bettina", "Brigitta", "Brigitte", + "Carmen", "Caroline", "Catherine", "Chantal", "Charlotte", "Christa", "Christiane", "Christina", + "Christine", "Claire", "Claudia", "Claudine", "Corinne", "Cornelia", "Daniela", "Danielle", + "Denise", "Dominique", "Dora", "Doris", "Edith", "Eliane", "Elisabeth", "Elsa", + "Elsbeth", "Erica", "Erika", "Esther", "Eva", "Eveline", "Evelyne", "Fabienne", + "Florence", "Françoise", "Franziska", "Gabriela", "Gabrielle", "Gertrud", "Gisela", "Hanna", + "Heidi", "Helen", "Helena", "Helene", "Hildegard", "Ingrid", "Irene", "Iris", + "Isabelle", "Jacqueline", "Janine", "Jean", "Johanna", "Jolanda", "Josette", "Josiane", + "Judith", "Julia", "Karin", "Katharina", "Laura", "Laurence", "Liliane", "Liselotte", + "Lydia", "Madeleine", "Maja", "Manuela", "Margrit", "Margrith", "Maria", "Marianne", + "Marion", "Marlène", "Marlies", "Marlis", "Martha", "Martina", "Martine", "Maya", + "Michele", "Micheline", "Monica", "Monika", "Monique", "Myriam", "Nadia", "Nadja", + "Nathalie", "Nelly", "Nicole", "Paola", "Patricia", "Petra", "Pia", "Priska", + "Regina", "Regula", "Renata", "Renate", "Ruth", "Sabine", "Sandra", "Silvia", + "Simone", "Sonia", "Sonja", "Stéphanie", "Susanna", "Susanne", "Suzanne", "Sylvia", + "Sylvie", "Therese", "Toni", "Ursula", "Verena", "Véronique", "Vreni", "Yolande", + "Yvette", "Yvonne", +}; +} diff --git a/src/modules/person/data/switzerland/SwissLastNames.h b/src/modules/person/data/switzerland/SwissLastNames.h new file mode 100644 index 000000000..ac74131a1 --- /dev/null +++ b/src/modules/person/data/switzerland/SwissLastNames.h @@ -0,0 +1,40 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector swissLastNames = { + "Ackermann", "Aebi", "Albrecht", "Ammann", "Amrein", "Arnold", "Bachmann", + "Bader", "Bär", "Bättig", "Bauer", "Baumann", "Baumgartner", "Baur", + "Beck", "Benz", "Berger", "Bernasconi", "Betschart", "Bianchi", "Bieri", + "Blaser", "Blum", "Bolliger", "Bosshard", "Braun", "Brun", "Brunner", + "Bucher", "Bühler", "Bühlmann", "Burri", "Christen", "Egger", "Egli", + "Eichenberger", "Erni", "Ernst", "Eugster", "Fankhauser", "Favre", "Fehr", + "Felber", "Felder", "Ferrari", "Fischer", "Flückiger", "Forster", "Frei", + "Frey", "Frick", "Friedli", "Fuchs", "Furrer", "Gasser", "Geiger", + "Gerber", "Gfeller", "Giger", "Gloor", "Graf", "Grob", "Gross", + "Gut", "Haas", "Häfliger", "Hafner", "Hartmann", "Hasler", "Hauser", + "Hermann", "Herzog", "Hess", "Hirt", "Hodel", "Hofer", "Hoffmann", + "Hofmann", "Hofstetter", "Hotz", "Huber", "Hug", "Hunziker", "Hürlimann", + "Imhof", "Isler", "Iten", "Jäggi", "Jenni", "Jost", "Kägi", + "Kaiser", "Kälin", "Käser", "Kaufmann", "Keller", "Kern", "Kessler", + "Knecht", "Koch", "Kohler", "Kuhn", "Küng", "Kunz", "Lang", + "Lanz", "Lehmann", "Leu", "Leunberger", "Lüscher", "Lustenberger", "Lüthi", + "Lutz", "Mäder", "Maier", "Marti", "Martin", "Maurer", "Mayer", + "Meier", "Meili", "Meister", "Merz", "Mettler", "Meyer", "Michel", + "Moser", "Müller", "Näf", "Ott", "Peter", "Pfister", "Portmann", + "Probst", "Rey", "Ritter", "Roos", "Roth", "Rüegg", "Schäfer", + "Schaller", "Schär", "Schärer", "Schaub", "Scheidegger", "Schenk", "Scherrer", + "Schlatter", "Schmid", "Schmidt", "Schneider", "Schnyder", "Schoch", "Schuler", + "Schumacher", "Schürch", "Schwab", "Schwarz", "Schweizer", "Seiler", "Senn", + "Sidler", "Siegrist", "Sigrist", "Spörri", "Stadelmann", "Stalder", "Staub", + "Stauffer", "Steffen", "Steiger", "Steiner", "Steinmann", "Stettler", "Stocker", + "Stöckli", "Stucki", "Studer", "Stutz", "Suter", "Sutter", "Tanner", + "Thommen", "Tobler", "Vogel", "Vogt", "Wagner", "Walder", "Walter", + "Weber", "Wegmann", "Wehrli", "Weibel", "Wenger", "Wettstein", "Widmer", + "Winkler", "Wirth", "Wirz", "Wolf", "Wüthrich", "Wyss", "Zbinden", + "Zehnder", "Ziegler", "Zimmermann", "Zingg", "Zollinger", "Zürcher", +}; +} diff --git a/src/modules/person/data/switzerland/SwissPeopleNames.h b/src/modules/person/data/switzerland/SwissPeopleNames.h new file mode 100644 index 000000000..90c992ba4 --- /dev/null +++ b/src/modules/person/data/switzerland/SwissPeopleNames.h @@ -0,0 +1,17 @@ +#pragma once + +#include "../NameFormats.h" +#include "../PeopleNames.h" +#include "SwissFirstNames.h" +#include "SwissLastNames.h" +#include "SwissPrefixes.h" + +namespace faker +{ +const NameFormats swissPersonNameFormats{{{"{prefix} {firstName} {lastName}", 1}, {"{firstName} {lastName}", 9}}}; + +const PeopleNames swissPeopleNames{{swissMalesFirstNames, {}, swissLastNames, swissMalesPrefixes, {}}, + {swissFemalesFirstNames, {}, swissLastNames, swissFemalesPrefixes, {}}, + swissPersonNameFormats}; + +} diff --git a/src/modules/person/data/switzerland/SwissPrefixes.h b/src/modules/person/data/switzerland/SwissPrefixes.h new file mode 100644 index 000000000..e5f79c2d7 --- /dev/null +++ b/src/modules/person/data/switzerland/SwissPrefixes.h @@ -0,0 +1,11 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector swissMalesPrefixes{"Herr", "Dr.", "Prof. Dr."}; + +const std::vector swissFemalesPrefixes{"Frau", "Dr.", "Prof. Dr."}; +}