From 52b0c5200a91b53d5c0405be40212fb5ef609d23 Mon Sep 17 00:00:00 2001 From: cieslarmichal Date: Mon, 16 Oct 2023 11:30:30 +0000 Subject: [PATCH] deploy: 0acf988f26a25d9619271601163f2d8ea3d5d0d8 --- Helper_8h_source.html | 114 ++++++++++++++++-------------- Person_8h_source.html | 15 ++-- classfaker_1_1Helper-members.html | 13 ++-- classfaker_1_1Helper.html | 6 +- classfaker_1_1Person-members.html | 7 +- classfaker_1_1Person.html | 39 +++++++++- functions_func_l.html | 1 + functions_l.html | 1 + search/all_a.js | 15 ++-- search/functions_a.js | 11 +-- 10 files changed, 138 insertions(+), 84 deletions(-) diff --git a/Helper_8h_source.html b/Helper_8h_source.html index 9f41e2706..ad81998bc 100644 --- a/Helper_8h_source.html +++ b/Helper_8h_source.html @@ -125,66 +125,74 @@
35 }
36
-
50 template <class T>
-
-
51 static std::vector<T> shuffle(std::vector<T> data)
-
52 {
-
53 std::shuffle(std::begin(data), std::end(data), pseudoRandomGenerator);
-
54
-
55 return data;
-
56 }
+
37 template <class T>
+
38 static T arrayElement(const std::vector<T>& data)
+
39 {
+
40 const auto index = Number::integer<size_t>(data.size() - 1);
+
41
+
42 return data[index];
+
43 }
+
44
+
58 template <class T>
+
+
59 static std::vector<T> shuffle(std::vector<T> data)
+
60 {
+
61 std::shuffle(std::begin(data), std::end(data), pseudoRandomGenerator);
+
62
+
63 return data;
+
64 }
-
57
-
75 static std::string replaceSymbolWithNumber(std::string str, const char& symbol = '#');
-
76
-
93 static std::string replaceCreditCardSymbols(const std::string& inputString = "6453-####-####-####-###L",
-
94 char symbol = '#');
-
95
-
116 static std::string regexpStyleStringParse(const std::string& input);
-
117
-
138 template <typename T>
-
-
139 static typename T::key_type objectKey(const T& object)
-
140 {
-
141 if (object.empty())
-
142 {
-
143 throw std::runtime_error("Object is empty.");
-
144 }
-
145
-
146 std::vector<typename T::key_type> keys;
-
147 for (const auto& entry : object)
-
148 {
-
149 keys.push_back(entry.first);
-
150 }
-
151
-
152 return arrayElement<typename T::key_type>(keys);
-
153 }
+
65
+
83 static std::string replaceSymbolWithNumber(std::string str, const char& symbol = '#');
+
84
+
101 static std::string replaceCreditCardSymbols(const std::string& inputString = "6453-####-####-####-###L",
+
102 char symbol = '#');
+
103
+
124 static std::string regexpStyleStringParse(const std::string& input);
+
125
+
146 template <typename T>
+
+
147 static typename T::key_type objectKey(const T& object)
+
148 {
+
149 if (object.empty())
+
150 {
+
151 throw std::runtime_error("Object is empty.");
+
152 }
+
153
+
154 std::vector<typename T::key_type> keys;
+
155 for (const auto& entry : object)
+
156 {
+
157 keys.push_back(entry.first);
+
158 }
+
159
+
160 return arrayElement<typename T::key_type>(keys);
+
161 }
-
154
-
171 template <typename TResult>
-
-
172 static TResult maybe(std::function<TResult()> callback, double probability = 0.5)
-
173 {
-
174 if (Datatype::boolean(probability))
-
175 {
-
176 return callback();
-
177 }
-
178 return TResult();
-
179 }
+
162
+
179 template <typename TResult>
+
+
180 static TResult maybe(std::function<TResult()> callback, double probability = 0.5)
+
181 {
+
182 if (Datatype::boolean(probability))
+
183 {
+
184 return callback();
+
185 }
+
186 return TResult();
+
187 }
-
180
-
181private:
-
182 static std::random_device randomDevice;
-
183 static std::mt19937 pseudoRandomGenerator;
-
184};
+
188
+
189private:
+
190 static std::random_device randomDevice;
+
191 static std::mt19937 pseudoRandomGenerator;
+
192};
-
185}
+
193}
static bool boolean()
Returns a random boolean.
Definition Helper.h:13
-
static T::key_type objectKey(const T &object)
Returns a random key from given object.
Definition Helper.h:139
-
static TResult maybe(std::function< TResult()> callback, double probability=0.5)
Returns the result of the callback if the probability check was successful, otherwise empty string.
Definition Helper.h:172
+
static T::key_type objectKey(const T &object)
Returns a random key from given object.
Definition Helper.h:147
+
static TResult maybe(std::function< TResult()> callback, double probability=0.5)
Returns the result of the callback if the probability check was successful, otherwise empty string.
Definition Helper.h:180
static T arrayElement(std::span< const T > data)
Get a random element from an STL container.
Definition Helper.h:30
-
static std::vector< T > shuffle(std::vector< T > data)
Returns shuffled STL container.
Definition Helper.h:51
+
static std::vector< T > shuffle(std::vector< T > data)
Returns shuffled STL container.
Definition Helper.h:59
static std::string replaceSymbolWithNumber(std::string str, const char &symbol='#')
Returns the given string parsed symbol by symbol and replaced the placeholders with digits ("0" - "9"...
static std::string replaceCreditCardSymbols(const std::string &inputString="6453-####-####-####-###L", char symbol='#')
Returns credit card schema with replaced symbols and patterns in a credit card including Luhn checksu...
static std::string regexpStyleStringParse(const std::string &input)
Returns the replaced regex-like expression in the string with matching values.
diff --git a/Person_8h_source.html b/Person_8h_source.html index da44d0286..8e978fae8 100644 --- a/Person_8h_source.html +++ b/Person_8h_source.html @@ -114,11 +114,11 @@
11class Person
12{
13public:
-
28 static std::string firstName(Language language = Language::English, std::optional<Sex> = std::nullopt);
+
28 static std::string firstName(Language language = Language::English, std::optional<Sex> = std::nullopt);
29
-
41 static std::string lastName(Language language = Language::English, std::optional<Sex> = std::nullopt);
+
41 static std::string lastName(Language language = Language::English, std::optional<Sex> = std::nullopt);
42
-
56 static std::string fullName(Language language = Language::English, std::optional<Sex> = std::nullopt);
+
56 static std::string fullName(Language language = Language::English, std::optional<Sex> = std::nullopt);
57
71 static std::string prefix(std::optional<Sex> = std::nullopt);
72
@@ -134,10 +134,12 @@
127
137 static std::string jobType();
138
-
149 static std::string hobby();
-
150};
+
148 static std::string hobby();
+
149
+
159 static std::string language();
+
160};
-
151}
+
161}
Definition Person.h:12
static std::string prefix(std::optional< Sex >=std::nullopt)
Returns a random name prefix.
static std::string sex()
Returns a sex.
@@ -149,6 +151,7 @@
static std::string jobDescriptor()
Returns a random job descriptor.
static std::string jobTitle()
Returns a random job title.
static std::string gender()
Returns a random gender.
+
static std::string language()
Returns a random language.
static std::string fullName(Language language=Language::English, std::optional< Sex >=std::nullopt)
Returns a random full name.
diff --git a/classfaker_1_1Helper-members.html b/classfaker_1_1Helper-members.html index 571af4275..39469f05d 100644 --- a/classfaker_1_1Helper-members.html +++ b/classfaker_1_1Helper-members.html @@ -99,12 +99,13 @@

This is the complete list of members for faker::Helper, including all inherited members.

- - - - - - + + + + + + +
arrayElement(std::span< const T > data)faker::Helperinlinestatic
maybe(std::function< TResult()> callback, double probability=0.5)faker::Helperinlinestatic
objectKey(const T &object)faker::Helperinlinestatic
regexpStyleStringParse(const std::string &input)faker::Helperstatic
replaceCreditCardSymbols(const std::string &inputString="6453-####-####-####-###L", char symbol='#')faker::Helperstatic
replaceSymbolWithNumber(std::string str, const char &symbol='#')faker::Helperstatic
shuffle(std::vector< T > data)faker::Helperinlinestatic
arrayElement(const std::vector< T > &data) (defined in faker::Helper)faker::Helperinlinestatic
maybe(std::function< TResult()> callback, double probability=0.5)faker::Helperinlinestatic
objectKey(const T &object)faker::Helperinlinestatic
regexpStyleStringParse(const std::string &input)faker::Helperstatic
replaceCreditCardSymbols(const std::string &inputString="6453-####-####-####-###L", char symbol='#')faker::Helperstatic
replaceSymbolWithNumber(std::string str, const char &symbol='#')faker::Helperstatic
shuffle(std::vector< T > data)faker::Helperinlinestatic
diff --git a/classfaker_1_1Helper.html b/classfaker_1_1Helper.html index 1fc112a01..9ecab08ff 100644 --- a/classfaker_1_1Helper.html +++ b/classfaker_1_1Helper.html @@ -105,6 +105,10 @@ static T arrayElement (std::span< const T > data)  Get a random element from an STL container.
  + +template<class T > +static T arrayElement (const std::vector< T > &data) +  template<class T > static std::vector< T > shuffle (std::vector< T > data)  Returns shuffled STL container.
@@ -281,7 +285,7 @@

{3, "three"}
};
Helper::objectKey(testMap) // "2"
-
static T::key_type objectKey(const T &object)
Returns a random key from given object.
Definition Helper.h:139
+
static T::key_type objectKey(const T &object)
Returns a random key from given object.
Definition Helper.h:147
diff --git a/classfaker_1_1Person-members.html b/classfaker_1_1Person-members.html index 5ab50237d..2542d9245 100644 --- a/classfaker_1_1Person-members.html +++ b/classfaker_1_1Person-members.html @@ -106,9 +106,10 @@ jobDescriptor()faker::Personstatic jobTitle()faker::Personstatic jobType()faker::Personstatic - lastName(Language language=Language::English, std::optional< Sex >=std::nullopt)faker::Personstatic - prefix(std::optional< Sex >=std::nullopt)faker::Personstatic - sex()faker::Personstatic + language()faker::Personstatic + lastName(Language language=Language::English, std::optional< Sex >=std::nullopt)faker::Personstatic + prefix(std::optional< Sex >=std::nullopt)faker::Personstatic + sex()faker::Personstatic diff --git a/classfaker_1_1Person.html b/classfaker_1_1Person.html index 674d52b83..6e810b5d8 100644 --- a/classfaker_1_1Person.html +++ b/classfaker_1_1Person.html @@ -101,13 +101,13 @@ - + - + - + @@ -134,6 +134,9 @@ + + +

Static Public Member Functions

static std::string firstName (Language language=Language::English, std::optional< Sex >=std::nullopt)
static std::string firstName (Language language=Language::English, std::optional< Sex >=std::nullopt)
 Returns a random first name.
 
static std::string lastName (Language language=Language::English, std::optional< Sex >=std::nullopt)
static std::string lastName (Language language=Language::English, std::optional< Sex >=std::nullopt)
 Returns a random last name.
 
static std::string fullName (Language language=Language::English, std::optional< Sex >=std::nullopt)
static std::string fullName (Language language=Language::English, std::optional< Sex >=std::nullopt)
 Returns a random full name.
 
static std::string prefix (std::optional< Sex >=std::nullopt)
static std::string hobby ()
 Returns a random hobby.
 
static std::string language ()
 Returns a random language.
 

Member Function Documentation

@@ -416,6 +419,36 @@

+

◆ language()

+ +
+
+ + + + + +
+ + + + + + + +
static std::string faker::Person::language ()
+
+static
+
+ +

Returns a random language.

+
Returns
Language.
+
Person::language() // "Polish"
+
static std::string language()
Returns a random language.
+
+
+

◆ lastName()

diff --git a/functions_func_l.html b/functions_func_l.html index ac6c97f41..f34a96db9 100644 --- a/functions_func_l.html +++ b/functions_func_l.html @@ -95,6 +95,7 @@
Here is a list of all documented functions with links to the class documentation for each member:

- l -

    +
  • language() : faker::Person
  • lastName() : faker::Person
  • latitude() : faker::Location
  • lion() : faker::Animal
  • diff --git a/functions_l.html b/functions_l.html index 151879e5c..46a62fa24 100644 --- a/functions_l.html +++ b/functions_l.html @@ -95,6 +95,7 @@
    Here is a list of all documented class members with links to the class documentation for each member:

    - l -

      +
    • language() : faker::Person
    • lastName() : faker::Person
    • latitude() : faker::Location
    • lion() : faker::Animal
    • diff --git a/search/all_a.js b/search/all_a.js index 88d31bfdc..368fdb828 100644 --- a/search/all_a.js +++ b/search/all_a.js @@ -1,10 +1,11 @@ var searchData= [ - ['lastname_0',['lastName',['../classfaker_1_1Person.html#a364e30d0ee90e2f3359dc7258b798521',1,'faker::Person']]], - ['latitude_1',['latitude',['../classfaker_1_1Location.html#afd485d36177f0a73c908a48f084c9af4',1,'faker::Location']]], - ['lion_2',['lion',['../classfaker_1_1Animal.html#aa7ac1915e26c8e3bf02f1c3ab7601c9c',1,'faker::Animal']]], - ['litecoinaddress_3',['litecoinAddress',['../classfaker_1_1Finance.html#a4080af385e6dfb6f82009eac1cb4d956',1,'faker::Finance']]], - ['location_4',['Location',['../classfaker_1_1Location.html',1,'faker']]], - ['longitude_5',['longitude',['../classfaker_1_1Location.html#afccdf97e9258dbaf29cf4c41aaec8f4e',1,'faker::Location']]], - ['lorem_6',['Lorem',['../classfaker_1_1Lorem.html',1,'faker']]] + ['language_0',['language',['../classfaker_1_1Person.html#af414b9dd8565995f4afc0e2850dde42c',1,'faker::Person']]], + ['lastname_1',['lastName',['../classfaker_1_1Person.html#a364e30d0ee90e2f3359dc7258b798521',1,'faker::Person']]], + ['latitude_2',['latitude',['../classfaker_1_1Location.html#afd485d36177f0a73c908a48f084c9af4',1,'faker::Location']]], + ['lion_3',['lion',['../classfaker_1_1Animal.html#aa7ac1915e26c8e3bf02f1c3ab7601c9c',1,'faker::Animal']]], + ['litecoinaddress_4',['litecoinAddress',['../classfaker_1_1Finance.html#a4080af385e6dfb6f82009eac1cb4d956',1,'faker::Finance']]], + ['location_5',['Location',['../classfaker_1_1Location.html',1,'faker']]], + ['longitude_6',['longitude',['../classfaker_1_1Location.html#afccdf97e9258dbaf29cf4c41aaec8f4e',1,'faker::Location']]], + ['lorem_7',['Lorem',['../classfaker_1_1Lorem.html',1,'faker']]] ]; diff --git a/search/functions_a.js b/search/functions_a.js index 48c214607..bd12db7fc 100644 --- a/search/functions_a.js +++ b/search/functions_a.js @@ -1,8 +1,9 @@ var searchData= [ - ['lastname_0',['lastName',['../classfaker_1_1Person.html#a364e30d0ee90e2f3359dc7258b798521',1,'faker::Person']]], - ['latitude_1',['latitude',['../classfaker_1_1Location.html#afd485d36177f0a73c908a48f084c9af4',1,'faker::Location']]], - ['lion_2',['lion',['../classfaker_1_1Animal.html#aa7ac1915e26c8e3bf02f1c3ab7601c9c',1,'faker::Animal']]], - ['litecoinaddress_3',['litecoinAddress',['../classfaker_1_1Finance.html#a4080af385e6dfb6f82009eac1cb4d956',1,'faker::Finance']]], - ['longitude_4',['longitude',['../classfaker_1_1Location.html#afccdf97e9258dbaf29cf4c41aaec8f4e',1,'faker::Location']]] + ['language_0',['language',['../classfaker_1_1Person.html#af414b9dd8565995f4afc0e2850dde42c',1,'faker::Person']]], + ['lastname_1',['lastName',['../classfaker_1_1Person.html#a364e30d0ee90e2f3359dc7258b798521',1,'faker::Person']]], + ['latitude_2',['latitude',['../classfaker_1_1Location.html#afd485d36177f0a73c908a48f084c9af4',1,'faker::Location']]], + ['lion_3',['lion',['../classfaker_1_1Animal.html#aa7ac1915e26c8e3bf02f1c3ab7601c9c',1,'faker::Animal']]], + ['litecoinaddress_4',['litecoinAddress',['../classfaker_1_1Finance.html#a4080af385e6dfb6f82009eac1cb4d956',1,'faker::Finance']]], + ['longitude_5',['longitude',['../classfaker_1_1Location.html#afccdf97e9258dbaf29cf4c41aaec8f4e',1,'faker::Location']]] ];