diff --git a/String_8h_source.html b/String_8h_source.html index 1caafd0aa..d0a52b517 100644 --- a/String_8h_source.html +++ b/String_8h_source.html @@ -154,81 +154,85 @@
66class String
67{
-
68public:
-
80 template <typename T = std::mt19937>
-
-
81 static std::string uuid(RandomGenerator<T> gen = RandomGenerator<std::mt19937>{})
-
82 {
-
83 static std::uniform_int_distribution<> dist(0, 15);
-
84 static std::uniform_int_distribution<> dist2(8, 11);
-
85
-
86 std::stringstream ss;
-
87 ss << std::hex;
-
88
-
89 for (int i = 0; i < 8; i++)
-
90 {
-
91 ss << gen(dist);
-
92 }
-
93
-
94 ss << "-";
-
95 for (int i = 0; i < 4; i++)
-
96 {
-
97 ss << gen(dist);
-
98 }
-
99
-
100 ss << "-4";
-
101 for (int i = 0; i < 3; i++)
-
102 {
-
103 ss << gen(dist);
-
104 }
-
105
-
106 ss << "-";
-
107
-
108 ss << gen(dist2);
+
68private:
+
69 static std::string generateStringWithGuarantee(GuaranteeMap& guarantee, std::set<char>& targetCharacters,
+
70 unsigned int length);
+
71
+
72public:
+
84 template <typename T = std::mt19937>
+
+
85 static std::string uuid(RandomGenerator<T> gen = RandomGenerator<std::mt19937>{})
+
86 {
+
87 static std::uniform_int_distribution<> dist(0, 15);
+
88 static std::uniform_int_distribution<> dist2(8, 11);
+
89
+
90 std::stringstream ss;
+
91 ss << std::hex;
+
92
+
93 for (int i = 0; i < 8; i++)
+
94 {
+
95 ss << gen(dist);
+
96 }
+
97
+
98 ss << "-";
+
99 for (int i = 0; i < 4; i++)
+
100 {
+
101 ss << gen(dist);
+
102 }
+
103
+
104 ss << "-4";
+
105 for (int i = 0; i < 3; i++)
+
106 {
+
107 ss << gen(dist);
+
108 }
109
-
110 for (int i = 0; i < 3; i++)
-
111 {
-
112 ss << gen(dist);
-
113 }
-
114
-
115 ss << "-";
-
116
-
117 for (int i = 0; i < 12; i++)
-
118 {
-
119 ss << gen(dist);
-
120 };
-
121
-
122 return ss.str();
-
123 }
+
110 ss << "-";
+
111
+
112 ss << gen(dist2);
+
113
+
114 for (int i = 0; i < 3; i++)
+
115 {
+
116 ss << gen(dist);
+
117 }
+
118
+
119 ss << "-";
+
120
+
121 for (int i = 0; i < 12; i++)
+
122 {
+
123 ss << gen(dist);
+
124 };
+
125
+
126 return ss.str();
+
127 }
-
124
-
137 static std::string sample(unsigned length = 10);
-
138
-
152 static std::string fromCharacters(const std::string& characters, unsigned length = 1);
-
153
-
168 static std::string alpha(unsigned length = 1, StringCasing casing = StringCasing::Mixed);
-
169
-
186 static std::string alphanumeric(unsigned length = 1, StringCasing casing = StringCasing::Mixed,
-
187 const std::string& excludeCharacters = "");
-
188
-
203 static std::string numeric(unsigned length = 1, bool allowLeadingZeros = true);
-
204
-
221 static std::string hexadecimal(unsigned length = 1, HexCasing casing = HexCasing::Lower,
-
222 HexPrefix prefix = HexPrefix::ZeroX);
-
223
-
235 static std::string binary(GuaranteeMap&& guarantee = {}, unsigned length = 1);
-
236
-
248 static std::string octal(unsigned length = 1);
-
249};
+
128
+
141 static std::string sample(unsigned length = 10);
+
142
+
156 static std::string fromCharacters(const std::string& characters, unsigned length = 1);
+
157
+
172 static std::string alpha(unsigned length = 1, StringCasing casing = StringCasing::Mixed);
+
173
+
190 static std::string alphanumeric(unsigned length = 1, StringCasing casing = StringCasing::Mixed,
+
191 const std::string& excludeCharacters = "");
+
192
+
207 static std::string numeric(unsigned length = 1, bool allowLeadingZeros = true);
+
208
+
225 static std::string hexadecimal(unsigned length = 1, HexCasing casing = HexCasing::Lower,
+
226 HexPrefix prefix = HexPrefix::ZeroX);
+
227
+
240 static std::string binary(GuaranteeMap&& guarantee = {}, unsigned length = 1);
+
241
+
254 static std::string octal(GuaranteeMap&& guarantee = {}, unsigned length = 1);
+
255};
-
250}
+
256}
Definition String.h:67
-
static std::string uuid(RandomGenerator< T > gen=RandomGenerator< std::mt19937 >{})
Generates an Universally Unique Identifier with version 4.
Definition String.h:81
+
static std::string uuid(RandomGenerator< T > gen=RandomGenerator< std::mt19937 >{})
Generates an Universally Unique Identifier with version 4.
Definition String.h:85
+
static std::string octal(GuaranteeMap &&guarantee={}, unsigned length=1)
Generates an octal string.
static std::string alphanumeric(unsigned length=1, StringCasing casing=StringCasing::Mixed, const std::string &excludeCharacters="")
Generates a string consisting of alpha characters and digits.
static std::string alpha(unsigned length=1, StringCasing casing=StringCasing::Mixed)
Generates a string consisting of letters in the English alphabet.
static std::string fromCharacters(const std::string &characters, unsigned length=1)
Generates a string consisting of given characters.
static std::string binary(GuaranteeMap &&guarantee={}, unsigned length=1)
Generates a binary string.
-
static std::string octal(unsigned length=1)
Generates an octal string.
static std::string sample(unsigned length=10)
Returns a string containing UTF-16 chars between 33 and 125 (! to }).
static std::string numeric(unsigned length=1, bool allowLeadingZeros=true)
Generates a given length string of digits.
static std::string hexadecimal(unsigned length=1, HexCasing casing=HexCasing::Lower, HexPrefix prefix=HexPrefix::ZeroX)
Generates a hexadecimal string.
diff --git a/classfaker_1_1String-members.html b/classfaker_1_1String-members.html index f78164b7d..6f2effeee 100644 --- a/classfaker_1_1String-members.html +++ b/classfaker_1_1String-members.html @@ -104,7 +104,7 @@ fromCharacters(const std::string &characters, unsigned length=1)faker::Stringstatic hexadecimal(unsigned length=1, HexCasing casing=HexCasing::Lower, HexPrefix prefix=HexPrefix::ZeroX)faker::Stringstatic numeric(unsigned length=1, bool allowLeadingZeros=true)faker::Stringstatic - octal(unsigned length=1)faker::Stringstatic + octal(GuaranteeMap &&guarantee={}, unsigned length=1)faker::Stringstatic sample(unsigned length=10)faker::Stringstatic uuid(RandomGenerator< T > gen=RandomGenerator< std::mt19937 >{})faker::Stringinlinestatic
diff --git a/classfaker_1_1String.html b/classfaker_1_1String.html index 6de44dbad..eb5acff96 100644 --- a/classfaker_1_1String.html +++ b/classfaker_1_1String.html @@ -126,9 +126,9 @@ static std::string binary (GuaranteeMap &&guarantee={}, unsigned length=1)  Generates a binary string.
  -static std::string octal (unsigned length=1) - Generates an octal string.
-  +static std::string octal (GuaranteeMap &&guarantee={}, unsigned length=1) + Generates an octal string.

Member Function Documentation

@@ -276,12 +276,13 @@

Parameters
+
guaranteeA map specifying char count constraints if any
lengthThe number of digits to generate. Defaults to 1.
Returns
Binary string.
-
String::binary(8) // "0b01110101"
+
String::binary({}, 8) // "0b01110101"
static std::string binary(GuaranteeMap &&guarantee={}, unsigned length=1)
Generates a binary string.
@@ -443,8 +444,8 @@

-

◆ octal()

+ +

◆ octal()

@@ -553,7 +565,7 @@

String::uuid() // "27666229-cedb-4a45-8018-98b1e1d921e2"
-
static std::string uuid(RandomGenerator< T > gen=RandomGenerator< std::mt19937 >{})
Generates an Universally Unique Identifier with version 4.
Definition String.h:81
+
static std::string uuid(RandomGenerator< T > gen=RandomGenerator< std::mt19937 >{})
Generates an Universally Unique Identifier with version 4.
Definition String.h:85

diff --git a/functions_func_o.html b/functions_func_o.html index 2b875640a..ea868537d 100644 --- a/functions_func_o.html +++ b/functions_func_o.html @@ -96,7 +96,7 @@

- o -

diff --git a/functions_o.html b/functions_o.html index dac73db4a..c0992306b 100644 --- a/functions_o.html +++ b/functions_o.html @@ -96,7 +96,7 @@

- o -

diff --git a/search/all_d.js b/search/all_d.js index f88b9d38e..abc0e4d5a 100644 --- a/search/all_d.js +++ b/search/all_d.js @@ -1,6 +1,6 @@ var searchData= [ ['objectkey_0',['objectKey',['../classfaker_1_1Helper.html#a2767629938711ae619fadcf489698d11',1,'faker::Helper']]], - ['octal_1',['octal',['../classfaker_1_1String.html#abc3d4242b2fc5ac285784723801a7c27',1,'faker::String']]], + ['octal_1',['octal',['../classfaker_1_1String.html#a43a660aee23b1438122d4b712639a588',1,'faker::String']]], ['oil_2',['oil',['../classfaker_1_1Food.html#aae85beeafb16300da748ebff2cd948cd',1,'faker::Food']]] ]; diff --git a/search/functions_d.js b/search/functions_d.js index f88b9d38e..abc0e4d5a 100644 --- a/search/functions_d.js +++ b/search/functions_d.js @@ -1,6 +1,6 @@ var searchData= [ ['objectkey_0',['objectKey',['../classfaker_1_1Helper.html#a2767629938711ae619fadcf489698d11',1,'faker::Helper']]], - ['octal_1',['octal',['../classfaker_1_1String.html#abc3d4242b2fc5ac285784723801a7c27',1,'faker::String']]], + ['octal_1',['octal',['../classfaker_1_1String.html#a43a660aee23b1438122d4b712639a588',1,'faker::String']]], ['oil_2',['oil',['../classfaker_1_1Food.html#aae85beeafb16300da748ebff2cd948cd',1,'faker::Food']]] ];