diff --git a/CMakeLists.txt b/CMakeLists.txt index 5efa9c59a..2cf71ddcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,13 +9,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) option(BUILD_FAKER_TESTS DEFAULT ON) -if (MSVC) +if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++20 /permissive- /bigobj") -else () +else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wconversion -Wformat -Werror" ) -endif () +endif() set(LIBRARY_NAME faker-cxx) @@ -113,13 +113,13 @@ target_include_directories( INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include" PRIVATE "${CMAKE_CURRENT_LIST_DIR}/include") -if (APPLE) +if(APPLE) add_subdirectory(externals/fmt) set(FMT_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/externals/fmt/include") target_link_libraries(${LIBRARY_NAME} PRIVATE fmt) -endif () +endif() -if (BUILD_FAKER_TESTS) +if(BUILD_FAKER_TESTS) add_subdirectory(externals/googletest) set(GTEST_INCLUDE_DIR @@ -138,19 +138,19 @@ if (BUILD_FAKER_TESTS) add_executable(${LIBRARY_NAME}-UT ${FAKER_UT_SOURCES}) target_link_libraries(${LIBRARY_NAME}-UT PRIVATE gtest_main gmock_main - faker-cxx) + faker-cxx) - if (APPLE) + if(APPLE) target_include_directories( ${LIBRARY_NAME}-UT PRIVATE ${FMT_INCLUDE_DIR} ${GTEST_INCLUDE_DIR} - ${GMOCK_INCLUDE_DIR} ${CMAKE_CURRENT_LIST_DIR}) - else () + ${GMOCK_INCLUDE_DIR} ${CMAKE_CURRENT_LIST_DIR}) + else() target_include_directories( ${LIBRARY_NAME}-UT PRIVATE ${GTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR} - ${CMAKE_CURRENT_LIST_DIR}) - endif () + ${CMAKE_CURRENT_LIST_DIR}) + endif() add_test( NAME ${LIBRARY_NAME}-UT @@ -158,4 +158,4 @@ if (BUILD_FAKER_TESTS) WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) target_code_coverage(${LIBRARY_NAME}-UT ALL) -endif () +endif() diff --git a/include/faker-cxx/Location.h b/include/faker-cxx/Location.h index cbf7cbcb5..d72ce7853 100644 --- a/include/faker-cxx/Location.h +++ b/include/faker-cxx/Location.h @@ -33,7 +33,7 @@ class Location static std::string countryCode(); /** - * @brief Returns a random state for a given country.. + * @brief Returns a random state for a given country. * * @param country The country to generate state from. Defaults to `Country::Usa`. * @@ -45,6 +45,19 @@ class Location */ static std::string state(AddressCountry country = AddressCountry::Usa); + /** + * @brief Returns a random county for a given country. + * + * @param country The country to generate county from. Defaults to `Country::Usa`. + * + * @returns County. + * + * @code + * Location::county() // "Adams County" + * @endcode + */ + static std::string county(AddressCountry country = AddressCountry::Usa); + /** * @brief Returns a random city for given country. * diff --git a/include/faker-cxx/types/AddressCountry.h b/include/faker-cxx/types/AddressCountry.h index cf849b78d..1af1174c4 100644 --- a/include/faker-cxx/types/AddressCountry.h +++ b/include/faker-cxx/types/AddressCountry.h @@ -20,13 +20,14 @@ namespace faker Australia, India, Denmark, + Spain, }; const std::vector addressCountries{ AddressCountry::Usa, AddressCountry::Poland, AddressCountry::France, AddressCountry::Russia, AddressCountry::Ukraine, AddressCountry::Italy, AddressCountry::Germany, AddressCountry::Czech, AddressCountry::India, - AddressCountry::Denmark, + AddressCountry::Denmark, AddressCountry::Australia, AddressCountry::Spain, }; inline std::string toString(AddressCountry country) @@ -36,6 +37,7 @@ namespace faker {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"}, }; return countryToStringMapping.at(country); diff --git a/src/modules/location/Location.cpp b/src/modules/location/Location.cpp index b5181e11b..98ca16288 100644 --- a/src/modules/location/Location.cpp +++ b/src/modules/location/Location.cpp @@ -12,11 +12,11 @@ #include "data/poland/PolandAddresses.h" #include "data/italy/ItalyAddresses.h" #include "data/russia/RussiaAddresses.h" -#include "data/States.h" #include "data/TimeZones.h" #include "data/ukraine/UkraineAddresses.h" #include "data/germany/GermanyAddresses.h" #include "data/usa/UsaAddresses.h" +#include "data/spain/SpainAddresses.h" #include "faker-cxx/Helper.h" #include "faker-cxx/Person.h" #include "faker-cxx/String.h" @@ -33,7 +33,7 @@ namespace faker {AddressCountry::Ukraine, ukraineAddresses}, {AddressCountry::Italy, italyAddresses}, {AddressCountry::Germany, germanyAddresses}, {AddressCountry::Czech, czechAddresses}, {AddressCountry::Australia, australiaAddresses}, {AddressCountry::India, indiaAddresses}, - {AddressCountry::Denmark, denmarkAddresses} + {AddressCountry::Denmark, denmarkAddresses}, {AddressCountry::Spain, spainAddresses}, }; const std::map countryAddressToCountryMapping{ @@ -42,7 +42,7 @@ namespace faker {AddressCountry::Ukraine, Country::Ukraine}, {AddressCountry::Italy, Country::Italy}, {AddressCountry::Germany, Country::Germany}, {AddressCountry::Czech, Country::Czech}, {AddressCountry::Australia, Country::Australia}, {AddressCountry::India, Country::India}, - {AddressCountry::Denmark, Country::Denmark}, + {AddressCountry::Denmark, Country::Denmark}, {AddressCountry::Spain, Country::Spain}, }; } @@ -56,6 +56,16 @@ namespace faker return Helper::arrayElement(countryCodes); } + std::string Location::county(AddressCountry country) + { + const auto& countryAddresses = countryToCountryAddressesMapping.at(country); + if(countryAddresses.counties.empty()) + { + return ""; + } + return Helper::arrayElement(countryAddresses.counties); + } + std::string Location::state(AddressCountry country) { const auto& countryAddresses = countryToCountryAddressesMapping.at(country); @@ -122,6 +132,11 @@ namespace faker { const auto& countryAddresses = countryToCountryAddressesMapping.at(country); + if (countryAddresses.secondaryAddressFormats.empty()) + { + return ""; + } + const auto secondaryAddressFormat = Helper::arrayElement(countryAddresses.secondaryAddressFormats); return Helper::replaceSymbolWithNumber(secondaryAddressFormat); diff --git a/src/modules/location/LocationTest.cpp b/src/modules/location/LocationTest.cpp index b0f42a7f4..2d1b0b3f2 100644 --- a/src/modules/location/LocationTest.cpp +++ b/src/modules/location/LocationTest.cpp @@ -7,6 +7,8 @@ #include "../../common/StringHelper.h" #include "../person/data/england/EnglishFirstNames.h" #include "../person/data/england/EnglishLastNames.h" +#include "../person/data/spain/SpanishFirstNames.h" +#include "../person/data/spain/SpanishLastNames.h" #include "../person/data/russia/RussianFirstNames.h" #include "../person/data/russia/RussianLastNames.h" #include "../person/data/ukraine/UkrainianFirstNames.h" @@ -29,6 +31,7 @@ #include "data/usa/UsaAddresses.h" #include "data/india/IndiaAddresses.h" #include "data/denmark/DenmarkAddresses.h" +#include "data/spain/SpainAddresses.h" using namespace ::testing; using namespace faker; @@ -41,7 +44,7 @@ namespace {AddressCountry::Ukraine, ukraineAddresses}, {AddressCountry::Italy, italyAddresses}, {AddressCountry::Germany, germanyAddresses}, {AddressCountry::Czech, czechAddresses}, {AddressCountry::Australia, australiaAddresses}, {AddressCountry::India, indiaAddresses}, - {AddressCountry::Denmark, denmarkAddresses}, + {AddressCountry::Denmark, denmarkAddresses}, {AddressCountry::Spain, spainAddresses}, }; const std::map generatedTestName{ @@ -56,6 +59,7 @@ namespace {AddressCountry::Australia, "shouldGenerateAustraliaAddress"}, {AddressCountry::India, "shouldGenerateIndiaAddress"}, {AddressCountry::Denmark, "shouldGenerateDenmarkAddress"}, + {AddressCountry::Spain, "shouldGenerateSpainAddress"}, }; } @@ -87,6 +91,19 @@ class LocationTest : public TestWithParam } }; +TEST_P(LocationTest, shouldGenerateCounty) +{ + const auto country = GetParam(); + + const auto& countryAddresses = countryToCountryAddressesMapping.at(country); + + const auto generatedCounty = Location::county(country); + + ASSERT_TRUE(std::ranges::any_of(countryAddresses.counties, + [&generatedCounty](const std::string& county) { return county == generatedCounty; }) || + (countryAddresses.counties.empty() && generatedCounty.empty())); +} + TEST_P(LocationTest, shouldGenerateState) { const auto country = GetParam(); @@ -137,8 +154,10 @@ TEST_P(LocationTest, shouldGenerateBuildingNumber) ASSERT_TRUE(std::ranges::any_of(countryAddresses.buildingNumberFormats, [&generatedBuildingNumber](const std::string& buildingNumberFormat) { return buildingNumberFormat.size() == generatedBuildingNumber.size(); })); + ASSERT_TRUE(checkIfAllCharactersAreNumeric(generatedBuildingNumber) || - checkIfAllCharactersAreNumeric(generatedBuildingNumberExceptLastCharacter)); + checkIfAllCharactersAreNumeric(generatedBuildingNumberExceptLastCharacter) || + generatedBuildingNumber == spainAddresses.buildingNumberFormats[0]); } TEST_P(LocationTest, shouldGenerateSecondaryAddress) @@ -149,7 +168,8 @@ TEST_P(LocationTest, shouldGenerateSecondaryAddress) const auto generatedSecondaryAddress = Location::secondaryAddress(country); - ASSERT_TRUE(std::ranges::any_of( + ASSERT_TRUE((countryAddresses.secondaryAddressFormats.empty() && generatedSecondaryAddress.empty()) || + std::ranges::any_of( countryAddresses.secondaryAddressFormats, [&generatedSecondaryAddress, &country](const std::string& secondaryAddressFormat) { @@ -157,6 +177,8 @@ TEST_P(LocationTest, shouldGenerateSecondaryAddress) const auto& secondaryAddressPrefix = secondaryAddressElements[0]; + const auto& secondaryAddressNumber = secondaryAddressElements[1]; + const auto generatedSecondaryAddressElements = StringHelper::split(generatedSecondaryAddress, " "); const auto& generatedSecondaryAddressPrefix = generatedSecondaryAddressElements[0]; @@ -165,18 +187,18 @@ TEST_P(LocationTest, shouldGenerateSecondaryAddress) if (country == faker::AddressCountry::Denmark) { - if (!checkIfAllCharactersAreNumeric(generatedSecondaryAddressPrefix)) - { - return generatedSecondaryAddressNumber == generatedSecondaryAddressNumber && - generatedSecondaryAddress.size() == secondaryAddressFormat.size(); - } + const auto generatedSecondaryAddressNumberPart = generatedSecondaryAddressPrefix.substr( + 0, generatedSecondaryAddressPrefix.size() - 1); + return generatedSecondaryAddressNumber == secondaryAddressNumber && + generatedSecondaryAddress.size() == secondaryAddressFormat.size() && + checkIfAllCharactersAreNumeric(generatedSecondaryAddressNumberPart); } else if (country == faker::AddressCountry::Germany) { if (checkIfAllCharactersAreNumeric(generatedSecondaryAddressPrefix)) { - return generatedSecondaryAddressNumber == generatedSecondaryAddressNumber && - generatedSecondaryAddress.size() == secondaryAddressFormat.size(); + return generatedSecondaryAddressNumber == secondaryAddressNumber && + generatedSecondaryAddress.size() == secondaryAddressFormat.size(); } } @@ -640,3 +662,45 @@ TEST_F(LocationTest, shouldGenerateDenmarkStreetAddress) ASSERT_TRUE(std::ranges::any_of(denmarkStreetNames, [&generatedStreetAddress](const std::string& streetName) { return generatedStreetAddress.find(streetName) != std::string::npos; })); } + +TEST_F(LocationTest, shouldGenerateSpainStreet) +{ + const auto generatedStreet = Location::street(AddressCountry::Spain); + + const auto generatedStreetElements = StringHelper::split(generatedStreet, " "); + + const auto& generatedStreetPrefix = generatedStreetElements[0]; + const auto& generatedStreetSuffix = + StringHelper::join({generatedStreetElements.begin() + 1, generatedStreetElements.end()}); + + ASSERT_TRUE(std::ranges::any_of(spainStreetSuffixes, [&generatedStreetPrefix](const std::string& streetSuffix) + { return streetSuffix == generatedStreetPrefix; })); + + std::vector firstNames{spanishMalesFirstNames}; + firstNames.insert(firstNames.end(), spanishFemalesFirstNames.begin(), spanishFemalesFirstNames.end()); + + std::vector lastNames{spanishLastNames}; + + ASSERT_TRUE(std::ranges::any_of(firstNames, [&generatedStreetSuffix](const std::string& firstName) + { return generatedStreetSuffix.find(firstName) != std::string::npos; }) || + std::ranges::any_of(lastNames, [&generatedStreetSuffix](const std::string& lastName) + { return generatedStreetSuffix.find(lastName) != std::string::npos; })); +} + +TEST_F(LocationTest, shouldGenerateSpainStreetAddress) +{ + const auto generatedStreetAddress = Location::streetAddress(AddressCountry::Spain); + + ASSERT_TRUE(std::ranges::any_of(spainStreetSuffixes, [&generatedStreetAddress](const std::string& suffix) + { return generatedStreetAddress.find(suffix) != std::string::npos; })); + + std::vector firstNames{spanishMalesFirstNames}; + firstNames.insert(firstNames.end(), spanishFemalesFirstNames.begin(), spanishFemalesFirstNames.end()); + + std::vector lastNames{spanishLastNames}; + + ASSERT_TRUE(std::ranges::any_of(firstNames, [&generatedStreetAddress](const std::string& firstName) + { return generatedStreetAddress.find(firstName) != std::string::npos; }) || + std::ranges::any_of(lastNames, [&generatedStreetAddress](const std::string& lastName) + { return generatedStreetAddress.find(lastName) != std::string::npos; })); +} diff --git a/src/modules/location/data/CountryAddresses.h b/src/modules/location/data/CountryAddresses.h index 586d22dc4..87dfd880b 100644 --- a/src/modules/location/data/CountryAddresses.h +++ b/src/modules/location/data/CountryAddresses.h @@ -17,5 +17,6 @@ struct CountryAddresses std::vector streetSuffixes; std::vector buildingNumberFormats; std::vector states; + std::vector counties; }; } diff --git a/src/modules/location/data/States.h b/src/modules/location/data/States.h deleted file mode 100644 index 33dac5133..000000000 --- a/src/modules/location/data/States.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include -#include - -namespace faker -{ -const std::vector states = { - "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", - "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", - "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", - "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", - "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", - "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", - "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", - "Wyoming"}; -} diff --git a/src/modules/location/data/australia/AustraliaAddresses.h b/src/modules/location/data/australia/AustraliaAddresses.h index ca2900656..7209e51f1 100644 --- a/src/modules/location/data/australia/AustraliaAddresses.h +++ b/src/modules/location/data/australia/AustraliaAddresses.h @@ -16,15 +16,15 @@ const std::vector australiaBuildingNumberFormats{"####", "###", "## const std::vector australiaStreetFormats{"{firstName} {streetSuffix}", "{lastName} {streetSuffix}"}; - const CountryAddresses australiaAddresses{australiaCities, - australiaZipCodeFormat, - australiaAddressFormats, - {}, - australiaStreetFormats, - {}, - {}, - australiaStreetSuffixes, - australiaBuildingNumberFormats, - australiaStates }; + australiaZipCodeFormat, + australiaAddressFormats, + {}, + australiaStreetFormats, + {}, + {}, + australiaStreetSuffixes, + australiaBuildingNumberFormats, + australiaStates, + {}}; } diff --git a/src/modules/location/data/czech/CzechAddresses.h b/src/modules/location/data/czech/CzechAddresses.h index c6622922a..8c6c8c741 100644 --- a/src/modules/location/data/czech/CzechAddresses.h +++ b/src/modules/location/data/czech/CzechAddresses.h @@ -20,13 +20,14 @@ const std::vector czechBuildingNumberFormats{"#", "##", "###"}; const std::vector czechStreetFormats{"{streetName}"}; const CountryAddresses czechAddresses{czechCities, - czechZipCodeFormat, - czechAddressFormats, - czechSecondaryAddressFormats, - czechStreetFormats, - {}, - czechStreetNames, - {}, - czechBuildingNumberFormats, - czechStates }; + czechZipCodeFormat, + czechAddressFormats, + czechSecondaryAddressFormats, + czechStreetFormats, + {}, + czechStreetNames, + {}, + czechBuildingNumberFormats, + czechStates, + {}}; } diff --git a/src/modules/location/data/denmark/DenmarkAddresses.h b/src/modules/location/data/denmark/DenmarkAddresses.h index a8d85a064..80d908a0d 100644 --- a/src/modules/location/data/denmark/DenmarkAddresses.h +++ b/src/modules/location/data/denmark/DenmarkAddresses.h @@ -17,13 +17,14 @@ namespace faker { const std::vector denmarkStreetFormats{"{streetName}"}; const CountryAddresses denmarkAddresses{denmarkCities, - denmarkZipCodeFormat, - denmarkAddressFormats, - denmarkSecondaryAddressFormats, - denmarkStreetFormats, - {}, - denmarkStreetNames, - {}, - denmarkBuildingNumberFormats, - denmarkStates}; + denmarkZipCodeFormat, + denmarkAddressFormats, + denmarkSecondaryAddressFormats, + denmarkStreetFormats, + {}, + denmarkStreetNames, + {}, + denmarkBuildingNumberFormats, + denmarkStates, + {}}; } \ No newline at end of file diff --git a/src/modules/location/data/france/FranceAddresses.h b/src/modules/location/data/france/FranceAddresses.h index dbce9ceb4..5e8dd5588 100644 --- a/src/modules/location/data/france/FranceAddresses.h +++ b/src/modules/location/data/france/FranceAddresses.h @@ -27,5 +27,6 @@ const CountryAddresses franceAddresses{franceCities, {}, franceStreetSuffixes, franceBuildingNumberFormats, - franceStates }; + franceStates, + {}}; } diff --git a/src/modules/location/data/germany/GermanyAddresses.h b/src/modules/location/data/germany/GermanyAddresses.h index 6edf2efc7..e2267c29f 100644 --- a/src/modules/location/data/germany/GermanyAddresses.h +++ b/src/modules/location/data/germany/GermanyAddresses.h @@ -19,13 +19,14 @@ const std::vector germanyBuildingNumberFormats{"###", "##", "#", "# const std::vector germanyStreetFormats{"{streetName}"}; const CountryAddresses germanyAddresses{germanyCities, - germanyZipCodeFormat, - germanyAddressFormats, - germanySecondaryAddressFormats, - germanyStreetFormats, - {}, - germanyStreetNames, - {}, - germanyBuildingNumberFormats, - germanyStates }; + germanyZipCodeFormat, + germanyAddressFormats, + germanySecondaryAddressFormats, + germanyStreetFormats, + {}, + germanyStreetNames, + {}, + germanyBuildingNumberFormats, + germanyStates, + {}}; } \ No newline at end of file diff --git a/src/modules/location/data/india/IndiaAddresses.h b/src/modules/location/data/india/IndiaAddresses.h index a05e23dd7..6ee283c6f 100644 --- a/src/modules/location/data/india/IndiaAddresses.h +++ b/src/modules/location/data/india/IndiaAddresses.h @@ -25,5 +25,6 @@ namespace faker { {}, indiaStreetSuffixes, indiaBuildingNumberFormats, - indiaStates}; + indiaStates, + {}}; } \ No newline at end of file diff --git a/src/modules/location/data/italy/ItalyAddresses.h b/src/modules/location/data/italy/ItalyAddresses.h index 90887f2bb..695643a10 100644 --- a/src/modules/location/data/italy/ItalyAddresses.h +++ b/src/modules/location/data/italy/ItalyAddresses.h @@ -19,13 +19,14 @@ const std::vector italyBuildingNumberFormats{"###", "##", "#"}; const std::vector italyStreetFormats{"{streetPrefix} {firstName}", "{streetPrefix} {lastName}"}; const CountryAddresses italyAddresses{italyCities, - italyZipCodeFormat, - italyAddressFormats, - italySecondaryAddressFormats, - italyStreetFormats, - italyStreetPrefixes, - {}, - {}, - italyBuildingNumberFormats, - italyStates }; + italyZipCodeFormat, + italyAddressFormats, + italySecondaryAddressFormats, + italyStreetFormats, + italyStreetPrefixes, + {}, + {}, + italyBuildingNumberFormats, + italyStates, + {}}; } \ No newline at end of file diff --git a/src/modules/location/data/poland/PolandAddresses.h b/src/modules/location/data/poland/PolandAddresses.h index 8388f68e4..94833c6f6 100644 --- a/src/modules/location/data/poland/PolandAddresses.h +++ b/src/modules/location/data/poland/PolandAddresses.h @@ -29,5 +29,6 @@ const CountryAddresses polandAddresses{polandCities, polandStreetNames, {}, polandBuildingNumberFormats, - polandStates }; + polandStates, + {}}; } diff --git a/src/modules/location/data/russia/RussiaAddresses.h b/src/modules/location/data/russia/RussiaAddresses.h index affda6176..43ef93916 100644 --- a/src/modules/location/data/russia/RussiaAddresses.h +++ b/src/modules/location/data/russia/RussiaAddresses.h @@ -29,5 +29,6 @@ const CountryAddresses russiaAddresses{russiaCities, russiaStreetNames, {}, russiaBuildingNumberFormats, - russiaStates }; + russiaStates, + {}}; } diff --git a/src/modules/location/data/spain/SpainAddresses.h b/src/modules/location/data/spain/SpainAddresses.h new file mode 100644 index 000000000..daf6c11be --- /dev/null +++ b/src/modules/location/data/spain/SpainAddresses.h @@ -0,0 +1,33 @@ +#pragma once + +#include "../CountryAddresses.h" +#include "SpainCities.h" +#include "SpainStreetSuffixes.h" +#include "SpainStates.h" +#include "SpainCounties.h" + +namespace faker +{ +const std::string spainZipCodeFormat{"#####"}; + +const std::vector spainAddressFormats{"{street} {buildingNumber}", + "{street} {buildingNumber} {secondaryAddress}"}; + +const std::vector spainSecondaryAddressFormats{"Esc. ###", "Puerta ###"}; + +const std::vector spainBuildingNumberFormats{"s/n.", "#", "##"}; + +const std::vector spainStreetFormats{"{streetSuffix} {firstName}", "{streetSuffix} {firstName} {lastName}"}; + +const CountryAddresses spainAddresses{spainCities, + spainZipCodeFormat, + spainAddressFormats, + spainSecondaryAddressFormats, + spainStreetFormats, + {}, + {}, + spainStreetSuffixes, + spainBuildingNumberFormats, + spainStates, + spainCounties}; +} \ No newline at end of file diff --git a/src/modules/location/data/spain/SpainCities.h b/src/modules/location/data/spain/SpainCities.h new file mode 100644 index 000000000..dd65764d4 --- /dev/null +++ b/src/modules/location/data/spain/SpainCities.h @@ -0,0 +1,140 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector spainCities { + "Parla", + "Telde", + "Baracaldo", + "San Fernando", + "Torrevieja", + "Lugo", + "Santiago de Compostela", + "Gerona", + "Cáceres", + "Lorca", + "Coslada", + "Talavera de la Reina", + "El Puerto de Santa María", + "Cornellá de Llobregat", + "Avilés", + "Palencia", + "Gecho", + "Orihuela", + "Pontevedra", + "Pozuelo de Alarcón", + "Toledo", + "El Ejido", + "Guadalajara", + "Gandía", + "Ceuta", + "Ferrol", + "Chiclana de la Frontera", + "Manresa", + "Roquetas de Mar", + "Ciudad Real", + "Rubí", + "Benidorm", + "San Sebastían de los Reyes", + "Ponferrada", + "Zamora", + "Alcalá de Guadaira", + "Fuengirola", + "Mijas", + "Sanlúcar de Barrameda", + "La Línea de la Concepción", + "Majadahonda", + "Sagunto", + "El Prat de LLobregat", + "Viladecans", + "Linares", + "Alcoy", + "Irún", + "Estepona", + "Torremolinos", + "Rivas-Vaciamadrid", + "Molina de Segura", + "Paterna", + "Granollers", + "Santa Lucía de Tirajana", + "Motril", + "Cerdañola del Vallés", + "Arrecife", + "Segovia", + "Torrelavega", + "Elda", + "Mérida", + "Ávila", + "Valdemoro", + "Cuenta", + "Collado Villalba", + "Benalmádena", + "Mollet del Vallés", + "Puertollano", + "Madrid", + "Barcelona", + "Valencia", + "Sevilla", + "Zaragoza", + "Málaga", + "Murcia", + "Palma de Mallorca", + "Las Palmas de Gran Canaria", + "Bilbao", + "Córdoba", + "Alicante", + "Valladolid", + "Vigo", + "Gijón", + "Hospitalet de LLobregat", + "La Coruña", + "Granada", + "Vitoria", + "Elche", + "Santa Cruz de Tenerife", + "Oviedo", + "Badalona", + "Cartagena", + "Móstoles", + "Jerez de la Frontera", + "Tarrasa", + "Sabadell", + "Alcalá de Henares", + "Pamplona", + "Fuenlabrada", + "Almería", + "San Sebastián", + "Leganés", + "Santander", + "Burgos", + "Castellón de la Plana", + "Alcorcón", + "Albacete", + "Getafe", + "Salamanca", + "Huelva", + "Logroño", + "Badajoz", + "San Cristróbal de la Laguna", + "León", + "Tarragona", + "Cádiz", + "Lérida", + "Marbella", + "Mataró", + "Dos Hermanas", + "Santa Coloma de Gramanet", + "Jaén", + "Algeciras", + "Torrejón de Ardoz", + "Orense", + "Alcobendas", + "Reus", + "Calahorra", + "Inca", + "Aýna", +}; +} \ No newline at end of file diff --git a/src/modules/location/data/spain/SpainCounties.h b/src/modules/location/data/spain/SpainCounties.h new file mode 100644 index 000000000..7dd7ddd5d --- /dev/null +++ b/src/modules/location/data/spain/SpainCounties.h @@ -0,0 +1,60 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector spainCounties { + "Álava", + "Albacete", + "Alicante", + "Almería", + "Asturias", + "Ávila", + "Badajoz", + "Barcelona", + "Burgos", + "Cantabria", + "Castellón", + "Ciudad Real", + "Cuenca", + "Cáceres", + "Cádiz", + "Córdoba", + "Gerona", + "Granada", + "Guadalajara", + "Guipúzcoa", + "Huelva", + "Huesca", + "Islas Baleares", + "Jaén", + "La Coruña", + "La Rioja", + "Las Palmas", + "León", + "Lugo", + "lérida", + "Madrid", + "Murcia", + "Málaga", + "Navarra", + "Orense", + "Palencia", + "Pontevedra", + "Salamanca", + "Santa Cruz de Tenerife", + "Segovia", + "Sevilla", + "Soria", + "Tarragona", + "Teruel", + "Toledo", + "Valencia", + "Valladolid", + "Vizcaya", + "Zamora", + "Zaragoza", +}; +} \ No newline at end of file diff --git a/src/modules/location/data/spain/SpainStates.h b/src/modules/location/data/spain/SpainStates.h new file mode 100644 index 000000000..a64ecc788 --- /dev/null +++ b/src/modules/location/data/spain/SpainStates.h @@ -0,0 +1,27 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector spainStates = { + "Andalucía", + "Aragón", + "Principado de Asturias", + "Baleares", + "Canarias", + "Cantabria", + "Castilla-La Mancha", + "Castilla y León", + "Cataluña", + "Comunidad Valenciana", + "Extremadura", + "Galicia", + "La Rioja", + "Comunidad de Madrid", + "Navarra", + "País Vasco", + "Región de Murcia", +}; +} diff --git a/src/modules/location/data/spain/SpainStreetSuffixes.h b/src/modules/location/data/spain/SpainStreetSuffixes.h new file mode 100644 index 000000000..c6da1ea67 --- /dev/null +++ b/src/modules/location/data/spain/SpainStreetSuffixes.h @@ -0,0 +1,80 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector spainStreetSuffixes{ + "Aldea", + "Apartamento", + "Arrabal", + "Arroyo", + "Avenida", + "Bajada", + "Barranco", + "Barrio", + "Bloque", + "Calle", + "Calleja", + "Camino", + "Carretera", + "Caserio", + "Colegio", + "Colonia", + "Conjunto", + "Cuesta", + "Chalet", + "Edificio", + "Entrada", + "Escalinata", + "Explanada", + "Extramuros", + "Extrarradio", + "Ferrocarril", + "Glorieta", + "Gran Subida", + "Grupo", + "Huerta", + "Jardines", + "Lado", + "Lugar", + "Manzana", + "Masía", + "Mercado", + "Monte", + "Muelle", + "Municipio", + "Parcela", + "Parque", + "Partida", + "Pasaje", + "Paseo", + "Plaza", + "Poblado", + "Polígono", + "Prolongación", + "Puente", + "Puerta", + "Quinta", + "Ramal", + "Rambla", + "Rampa", + "Riera", + "Rincón", + "Ronda", + "Rua", + "Salida", + "Sector", + "Sección", + "Senda", + "Solar", + "Subida", + "Terrenos", + "Torrente", + "Travesía", + "Urbanización", + "Vía", + "Vía Pública", +}; +} \ No newline at end of file diff --git a/src/modules/location/data/ukraine/UkraineAddresses.h b/src/modules/location/data/ukraine/UkraineAddresses.h index 6a2912b55..5b7acd04f 100644 --- a/src/modules/location/data/ukraine/UkraineAddresses.h +++ b/src/modules/location/data/ukraine/UkraineAddresses.h @@ -29,5 +29,6 @@ const CountryAddresses ukraineAddresses{ukraineCities, ukraineStreetNames, {}, ukraineBuildingNumberFormats, - ukraineStates }; + ukraineStates, + {}}; } diff --git a/src/modules/location/data/usa/UsaAddresses.h b/src/modules/location/data/usa/UsaAddresses.h index 8e3873730..f1aed41c6 100644 --- a/src/modules/location/data/usa/UsaAddresses.h +++ b/src/modules/location/data/usa/UsaAddresses.h @@ -26,5 +26,6 @@ const CountryAddresses usaAddresses{usaCities, {}, usaStreetSuffixes, usaBuildingNumberFormats, - usaStates }; + usaStates, + {}}; } diff --git a/src/modules/location/data/usa/UsaCounties.h b/src/modules/location/data/usa/UsaCounties.h new file mode 100644 index 000000000..fafc17d10 --- /dev/null +++ b/src/modules/location/data/usa/UsaCounties.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include + +namespace faker +{ +const std::vector usaCounties { + "Adams County", + "Calhoun County", + "Carroll County", + "Clark County", + "Clay County", + "Crawford County", + "Douglas County", + "Fayette County", + "Franklin County", + "Grant County", + "Greene County", + "Hamilton County", + "Hancock County", + "Henry County", + "Jackson County", + "Jefferson County", + "Johnson County", + "Lake County", + "Lawrence County", + "Lee County", + "Lincoln County", + "Logan County", + "Madison County", + "Marion County", + "Marshall County", + "Monroe County", + "Montgomery County", + "Morgan County", + "Perry County", + "Pike County", + "Polk County", + "Scott County", + "Union County", + "Warren County", + "Washington County", + "Wayne County", +}; +} \ No newline at end of file