@@ -223,14 +223,6 @@ const std::wregex kRegexDatePrefix(
223
223
L"^(-?[0-9]+)-(0[1-9]|11|12)-(0[0-9]|1[0-9]|2[0-9]|30|31)"
224
224
);
225
225
226
- /**
227
- * \brief Check whether the given \p year is a leap year.
228
- *
229
- * Year 1 BCE is a leap year.
230
- *
231
- * \param year to be checked
232
- * \return true if \p year is a leap year
233
- */
234
226
bool IsLeapYear(long long year) {
235
227
// NOTE (mristin):
236
228
// We consider the years B.C. to be one-off.
@@ -2247,12 +2239,6 @@ bool MatchesXsString(
2247
2239
);
2248
2240
}
2249
2241
2250
- /**
2251
- * \brief Check that \p value is a valid `xs:double`.
2252
- *
2253
- * \param value to be checked
2254
- * \return true if \p value is a valid `xs:double`
2255
- */
2256
2242
bool IsXsDouble(const std::wstring& value) {
2257
2243
// NOTE (mristin):
2258
2244
// We need to check explicitly for the regular expression since
@@ -2304,12 +2290,6 @@ bool IsXsDouble(const std::wstring& value) {
2304
2290
return true;
2305
2291
}
2306
2292
2307
- /**
2308
- * \brief Check that \p value is a valid `xs:float`.
2309
- *
2310
- * \param value to be checked
2311
- * \return true if \p value is a valid `xs:float`
2312
- */
2313
2293
bool IsXsFloat(const std::wstring& value) {
2314
2294
// NOTE (mristin):
2315
2295
// We need to check explicitly for the regular expression since
@@ -2361,12 +2341,6 @@ bool IsXsFloat(const std::wstring& value) {
2361
2341
return true;
2362
2342
}
2363
2343
2364
- /**
2365
- * \brief Check that \p value is a valid `xs:gMonthDay`.
2366
- *
2367
- * \param value to be checked
2368
- * \return true if \p value is a valid `xs:gMonthDay`
2369
- */
2370
2344
bool IsXsGMonthDay(const std::wstring& value) {
2371
2345
if (!MatchesXsGMonthDay(value)) {
2372
2346
return false;
@@ -2381,12 +2355,6 @@ bool IsXsGMonthDay(const std::wstring& value) {
2381
2355
return day <= kDaysInMonth.at(month);
2382
2356
}
2383
2357
2384
- /**
2385
- * \brief Check that \p value is a valid `xs:long`.
2386
- *
2387
- * \param value to be checked
2388
- * \return true if \p value is a valid `xs:long`
2389
- */
2390
2358
bool IsXsLong(const std::wstring& value) {
2391
2359
if (!MatchesXsLong(value)) {
2392
2360
return false;
@@ -2432,12 +2400,6 @@ bool IsXsLong(const std::wstring& value) {
2432
2400
return true;
2433
2401
}
2434
2402
2435
- /**
2436
- * \brief Check that \p value is a valid `xs:int`.
2437
- *
2438
- * \param value to be checked
2439
- * \return true if \p value is a valid `xs:int`
2440
- */
2441
2403
bool IsXsInt(const std::wstring& value) {
2442
2404
if (!MatchesXsInt(value)) {
2443
2405
return false;
@@ -2483,12 +2445,6 @@ bool IsXsInt(const std::wstring& value) {
2483
2445
return true;
2484
2446
}
2485
2447
2486
- /**
2487
- * \brief Check that \p value is a valid `xs:short`.
2488
- *
2489
- * \param value to be checked
2490
- * \return true if \p value is a valid `xs:short`
2491
- */
2492
2448
bool IsXsShort(const std::wstring& value) {
2493
2449
if (!MatchesXsShort(value)) {
2494
2450
return false;
@@ -2513,12 +2469,6 @@ bool IsXsShort(const std::wstring& value) {
2513
2469
return -32768 <= converted && converted <= 32767;
2514
2470
}
2515
2471
2516
- /**
2517
- * \brief Check that \p value is a valid `xs:byte`.
2518
- *
2519
- * \param value to be checked
2520
- * \return true if \p value is a valid `xs:byte`
2521
- */
2522
2472
bool IsXsByte(const std::wstring& value) {
2523
2473
if (!MatchesXsByte(value)) {
2524
2474
return false;
@@ -2543,12 +2493,6 @@ bool IsXsByte(const std::wstring& value) {
2543
2493
return -128 <= converted && converted <= 127;
2544
2494
}
2545
2495
2546
- /**
2547
- * \brief Check that \p value is a valid `xs:unsignedLong`.
2548
- *
2549
- * \param value to be checked
2550
- * \return true if \p value is a valid `xs:unsignedLong`
2551
- */
2552
2496
bool IsXsUnsignedLong(const std::wstring& value) {
2553
2497
if (!MatchesXsUnsignedLong(value)) {
2554
2498
return false;
@@ -2559,8 +2503,8 @@ bool IsXsUnsignedLong(const std::wstring& value) {
2559
2503
// We remove the warning C4101 in MSVC with constants.
2560
2504
// See: https://stackoverflow.com/questions/25573996/c4127-conditional-expression-is-constant
2561
2505
const bool sizeof_unsigned_long_is_8 = sizeof(unsigned long) == 8;
2562
- const bool sizeof_unsigned_long_long_is_8 = sizeof(unsigned long long) == 8;
2563
-
2506
+ const bool sizeof_unsigned_long_long_is_8 = sizeof(unsigned long long) == 8;
2507
+
2564
2508
if (sizeof_unsigned_long_is_8) {
2565
2509
static_cast<void>(
2566
2510
std::stoul(value)
@@ -2594,12 +2538,6 @@ bool IsXsUnsignedLong(const std::wstring& value) {
2594
2538
return true;
2595
2539
}
2596
2540
2597
- /**
2598
- * \brief Check that \p value is a valid `xs:unsignedInt`.
2599
- *
2600
- * \param value to be checked
2601
- * \return true if \p value is a valid `xs:unsignedInt`
2602
- */
2603
2541
bool IsXsUnsignedInt(const std::wstring& value) {
2604
2542
if (!MatchesXsUnsignedInt(value)) {
2605
2543
return false;
@@ -2615,8 +2553,8 @@ bool IsXsUnsignedInt(const std::wstring& value) {
2615
2553
// We remove the warning C4101 in MSVC with constants.
2616
2554
// See: https://stackoverflow.com/questions/25573996/c4127-conditional-expression-is-constant
2617
2555
const bool sizeof_unsigned_long_ge_4 = sizeof(unsigned long) >= 4;
2618
- const bool sizeof_unsigned_long_long_ge_4 = sizeof(unsigned long long) >= 4;
2619
-
2556
+ const bool sizeof_unsigned_long_long_ge_4 = sizeof(unsigned long long) >= 4;
2557
+
2620
2558
if (sizeof_unsigned_long_ge_4) {
2621
2559
const unsigned long number = std::stoul(value);
2622
2560
return number <= 4294967295ul;
@@ -2648,12 +2586,6 @@ bool IsXsUnsignedInt(const std::wstring& value) {
2648
2586
}
2649
2587
}
2650
2588
2651
- /**
2652
- * \brief Check that \p value is a valid `xs:unsignedShort`.
2653
- *
2654
- * \param value to be checked
2655
- * \return true if \p value is a valid `xs:unsignedShort`
2656
- */
2657
2589
bool IsXsUnsignedShort(const std::wstring& value) {
2658
2590
if (!MatchesXsUnsignedShort(value)) {
2659
2591
return false;
@@ -2673,8 +2605,8 @@ bool IsXsUnsignedShort(const std::wstring& value) {
2673
2605
);
2674
2606
const bool sizeof_unsigned_long_long_ge_4(
2675
2607
sizeof(unsigned long long) >= 4
2676
- );
2677
-
2608
+ );
2609
+
2678
2610
if (sizeof_unsigned_long_ge_4) {
2679
2611
const unsigned long number = std::stoul(value);
2680
2612
return number <= 65535ul;
@@ -2706,12 +2638,6 @@ bool IsXsUnsignedShort(const std::wstring& value) {
2706
2638
}
2707
2639
}
2708
2640
2709
- /**
2710
- * \brief Check that \p value is a valid `xs:unsignedByte`.
2711
- *
2712
- * \param value to be checked
2713
- * \return true if \p value is a valid `xs:unsignedByte`
2714
- */
2715
2641
bool IsXsUnsignedByte(const std::wstring& value) {
2716
2642
if (!MatchesXsUnsignedByte(value)) {
2717
2643
return false;
0 commit comments