Skip to content

Commit 452b493

Browse files
committed
Removed unused comments
1 parent c73465a commit 452b493

File tree

2 files changed

+0
-70
lines changed

2 files changed

+0
-70
lines changed

src/wsjcpp_validators.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ bool WsjcppValidators::isValidDate(const std::string &sValue,
8787
return true;
8888
}
8989

90-
// ----------------------------------------------------------------------
91-
9290
bool WsjcppValidators::isValidTimeH24(const std::string &sValue,
9391
std::string &sError) {
9492
int nSize = sValue.size();
@@ -142,8 +140,6 @@ bool WsjcppValidators::isValidTimeH24(const std::string &sValue,
142140
return true;
143141
}
144142

145-
// ----------------------------------------------------------------------
146-
147143
bool WsjcppValidators::isValidDomainName(const std::string &sValue,
148144
std::string &sError) {
149145
std::vector<std::string> vSubDomains;
@@ -232,16 +228,12 @@ bool WsjcppValidators::isValidDomainName(const std::string &sValue,
232228
return true;
233229
}
234230

235-
// ----------------------------------------------------------------------
236-
237231
bool WsjcppValidators::isValidPort(const std::string &sValue,
238232
std::string &sError) {
239233
int nPort = std::atoi(sValue.c_str());
240234
return WsjcppValidators::isValidPort(nPort, sError);
241235
}
242236

243-
// ----------------------------------------------------------------------
244-
245237
bool WsjcppValidators::isValidPort(int nValue, std::string &sError) {
246238
if (nValue < 1 || nValue > 65535) {
247239
sError = "Port '" + std::to_string(nValue) +
@@ -251,8 +243,6 @@ bool WsjcppValidators::isValidPort(int nValue, std::string &sError) {
251243
return true;
252244
}
253245

254-
// ----------------------------------------------------------------------
255-
256246
bool WsjcppValidators::isValidURLProtocol(const std::string &sValue,
257247
std::string &sError) {
258248
if (sValue != "http" && sValue != "https" && sValue != "ws" &&
@@ -263,8 +253,6 @@ bool WsjcppValidators::isValidURLProtocol(const std::string &sValue,
263253
return true;
264254
}
265255

266-
// ----------------------------------------------------------------------
267-
268256
bool WsjcppValidators::isValidBase64(const std::string &sValue,
269257
std::string &sError) {
270258
int nSize = sValue.size();
@@ -301,8 +289,6 @@ bool WsjcppValidators::isValidBase64(const std::string &sValue,
301289
return true;
302290
}
303291

304-
// ----------------------------------------------------------------------
305-
306292
bool WsjcppValidators::isValidIPv4(const std::string &sValue,
307293
std::string &sError) {
308294
int n = 0;
@@ -339,8 +325,6 @@ bool WsjcppValidators::isValidIPv4(const std::string &sValue,
339325
return true;
340326
}
341327

342-
// ----------------------------------------------------------------------
343-
344328
bool WsjcppValidators::isValidIPv6(const std::string &sValue,
345329
std::string &sError) {
346330
// TODO redesign without arpa
@@ -361,14 +345,10 @@ WsjcppValidatorStringBase::WsjcppValidatorStringBase(
361345
m_sTypeName = sTypeName;
362346
}
363347

364-
// ----------------------------------------------------------------------
365-
366348
WsjcppValidatorType WsjcppValidatorStringBase::getBaseType() {
367349
return WsjcppValidatorType::WSJCPP_VALIDATOR_STRING;
368350
}
369351

370-
// ----------------------------------------------------------------------
371-
372352
std::string WsjcppValidatorStringBase::getTypeName() { return m_sTypeName; }
373353

374354
// ----------------------------------------------------------------------
@@ -382,8 +362,6 @@ WsjcppValidatorStringRegexpBase::WsjcppValidatorStringRegexpBase(
382362
m_rxValidator = std::regex(sValidator);
383363
}
384364

385-
// ----------------------------------------------------------------------
386-
387365
bool WsjcppValidatorStringRegexpBase::isValid(const std::string &sValue,
388366
std::string &sError) {
389367
if (!std::regex_match(sValue, m_rxValidator)) {
@@ -403,8 +381,6 @@ WsjcppValidatorStringListBase::WsjcppValidatorStringListBase(
403381
m_vListValues = vListValues;
404382
}
405383

406-
// ----------------------------------------------------------------------
407-
408384
bool WsjcppValidatorStringListBase::isValid(const std::string &sValue,
409385
std::string &sError) {
410386
if (std::find(m_vListValues.begin(), m_vListValues.end(), sValue) !=
@@ -453,8 +429,6 @@ WsjcppValidatorStringLength::WsjcppValidatorStringLength(int nMinLength,
453429
m_nMaxLength = nMaxLength;
454430
}
455431

456-
// ----------------------------------------------------------------------
457-
458432
bool WsjcppValidatorStringLength::isValid(const std::string &sValue,
459433
std::string &sError) {
460434
if (sValue.length() < m_nMinLength) {
@@ -502,8 +476,6 @@ WsjcppValidatorTimeH24::WsjcppValidatorTimeH24()
502476
TAG = "WsjcppValidatorTime";
503477
}
504478

505-
// ----------------------------------------------------------------------
506-
507479
bool WsjcppValidatorTimeH24::isValid(const std::string &sValue,
508480
std::string &sError) {
509481
return WsjcppValidators::isValidTimeH24(sValue, sError);
@@ -517,8 +489,6 @@ WsjcppValidatorDateTime::WsjcppValidatorDateTime()
517489
TAG = "WsjcppValidatorDateTime";
518490
}
519491

520-
// ----------------------------------------------------------------------
521-
522492
bool WsjcppValidatorDateTime::isValid(const std::string &sValue,
523493
std::string &sError) {
524494
int nSize = sValue.size();
@@ -553,8 +523,6 @@ WsjcppValidatorURL::WsjcppValidatorURL() : WsjcppValidatorStringBase("url") {
553523
std::regex("^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$");
554524
}
555525

556-
// ----------------------------------------------------------------------
557-
558526
bool WsjcppValidatorURL::isValid(const std::string &sValue,
559527
std::string &sError) {
560528
if (sValue.size() == 0) {

src/wsjcpp_validators.h

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ enum WsjcppValidatorType {
3535
WSJCPP_VALIDATOR_JSON
3636
};
3737

38-
// ----------------------------------------------------------------------
39-
4038
class WsjcppValidators {
4139
public:
4240
static bool isValidDate(const std::string &sValue, std::string &sError);
@@ -64,8 +62,6 @@ getTypeName(); virtual bool isValid(const std::string &sValue, std::string
6462
6563
*/
6664

67-
// ----------------------------------------------------------------------
68-
6965
class WsjcppValidatorStringBase {
7066
public:
7167
WsjcppValidatorStringBase(const std::string &typeName);
@@ -80,8 +76,6 @@ class WsjcppValidatorStringBase {
8076
std::string m_sTypeName;
8177
};
8278

83-
// ----------------------------------------------------------------------
84-
8579
class WsjcppValidatorStringRegexpBase : public WsjcppValidatorStringBase {
8680
public:
8781
WsjcppValidatorStringRegexpBase(const std::string &typeName,
@@ -93,8 +87,6 @@ class WsjcppValidatorStringRegexpBase : public WsjcppValidatorStringBase {
9387
std::regex m_rxValidator;
9488
};
9589

96-
// ----------------------------------------------------------------------
97-
9890
class WsjcppValidatorStringListBase : public WsjcppValidatorStringBase {
9991
public:
10092
WsjcppValidatorStringListBase(const std::string &typeName,
@@ -105,22 +97,16 @@ class WsjcppValidatorStringListBase : public WsjcppValidatorStringBase {
10597
std::vector<std::string> m_vListValues;
10698
};
10799

108-
// ----------------------------------------------------------------------
109-
110100
class WsjcppValidatorEmail : public WsjcppValidatorStringRegexpBase {
111101
public:
112102
WsjcppValidatorEmail();
113103
};
114104

115-
// ----------------------------------------------------------------------
116-
117105
class WsjcppValidatorUUID : public WsjcppValidatorStringRegexpBase {
118106
public:
119107
WsjcppValidatorUUID();
120108
};
121109

122-
// ----------------------------------------------------------------------
123-
124110
class WsjcppValidatorStringLength : public WsjcppValidatorStringBase {
125111
public:
126112
WsjcppValidatorStringLength(int nMinLength, int nMaxLength);
@@ -132,15 +118,11 @@ class WsjcppValidatorStringLength : public WsjcppValidatorStringBase {
132118
int m_nMaxLength;
133119
};
134120

135-
// ----------------------------------------------------------------------
136-
137121
class WsjcppValidatorJWT : public WsjcppValidatorStringRegexpBase {
138122
public:
139123
WsjcppValidatorJWT();
140124
};
141125

142-
// ----------------------------------------------------------------------
143-
144126
class WsjcppValidatorDate : public WsjcppValidatorStringBase {
145127
public:
146128
WsjcppValidatorDate();
@@ -150,8 +132,6 @@ class WsjcppValidatorDate : public WsjcppValidatorStringBase {
150132
std::string TAG;
151133
};
152134

153-
// ----------------------------------------------------------------------
154-
155135
class WsjcppValidatorTimeH24 : public WsjcppValidatorStringBase {
156136
public:
157137
WsjcppValidatorTimeH24();
@@ -161,8 +141,6 @@ class WsjcppValidatorTimeH24 : public WsjcppValidatorStringBase {
161141
std::string TAG;
162142
};
163143

164-
// ----------------------------------------------------------------------
165-
166144
class WsjcppValidatorDateTime : public WsjcppValidatorStringBase {
167145
public:
168146
WsjcppValidatorDateTime();
@@ -172,8 +150,6 @@ class WsjcppValidatorDateTime : public WsjcppValidatorStringBase {
172150
std::string TAG;
173151
};
174152

175-
// ----------------------------------------------------------------------
176-
177153
class WsjcppValidatorURL : public WsjcppValidatorStringBase {
178154
public:
179155
WsjcppValidatorURL();
@@ -184,8 +160,6 @@ class WsjcppValidatorURL : public WsjcppValidatorStringBase {
184160
std::regex m_rxLikeIPv4Format;
185161
};
186162

187-
// ----------------------------------------------------------------------
188-
189163
class WsjcppValidatorBase64 : public WsjcppValidatorStringBase {
190164
public:
191165
WsjcppValidatorBase64();
@@ -195,8 +169,6 @@ class WsjcppValidatorBase64 : public WsjcppValidatorStringBase {
195169
std::string TAG;
196170
};
197171

198-
// ----------------------------------------------------------------------
199-
200172
class WsjcppValidatorNumber : public WsjcppValidatorStringBase {
201173
public:
202174
WsjcppValidatorNumber();
@@ -206,8 +178,6 @@ class WsjcppValidatorNumber : public WsjcppValidatorStringBase {
206178
std::string TAG;
207179
};
208180

209-
// ----------------------------------------------------------------------
210-
211181
class WsjcppValidatorHex : public WsjcppValidatorStringBase {
212182
public:
213183
WsjcppValidatorHex();
@@ -217,8 +187,6 @@ class WsjcppValidatorHex : public WsjcppValidatorStringBase {
217187
std::string TAG;
218188
};
219189

220-
// ----------------------------------------------------------------------
221-
222190
class WsjcppValidatorIntegerBase {
223191
public:
224192
WsjcppValidatorIntegerBase(const std::string &typeName);
@@ -233,8 +201,6 @@ class WsjcppValidatorIntegerBase {
233201
std::string m_sTypeName;
234202
};
235203

236-
// ----------------------------------------------------------------------
237-
238204
class WsjcppValidatorIntegerMinValue : public WsjcppValidatorIntegerBase {
239205
public:
240206
WsjcppValidatorIntegerMinValue(int nMinValue);
@@ -245,8 +211,6 @@ class WsjcppValidatorIntegerMinValue : public WsjcppValidatorIntegerBase {
245211
int m_nMinValue;
246212
};
247213

248-
// ----------------------------------------------------------------------
249-
250214
class WsjcppValidatorIntegerMaxValue : public WsjcppValidatorIntegerBase {
251215
public:
252216
WsjcppValidatorIntegerMaxValue(int nMaxValue);
@@ -257,8 +221,6 @@ class WsjcppValidatorIntegerMaxValue : public WsjcppValidatorIntegerBase {
257221
int m_nMaxValue;
258222
};
259223

260-
// ----------------------------------------------------------------------
261-
262224
class WsjcppValidatorJsonBase {
263225
public:
264226
WsjcppValidatorJsonBase(const std::string &typeName);

0 commit comments

Comments
 (0)