@@ -446,10 +446,10 @@ class UtilitiesMain
446
446
//
447
447
// Option handling
448
448
//
449
- bool OutputOption (LPCWSTR szArg, LPCWSTR szOption, OutputSpec::Kind supportedTypes, OutputSpec& anOutput);
449
+ static bool OutputOption (LPCWSTR szArg, LPCWSTR szOption, OutputSpec::Kind supportedTypes, OutputSpec& anOutput);
450
450
451
451
template <typename OptionType>
452
- bool
452
+ static bool
453
453
OutputOption (LPCWSTR szArg, LPCWSTR szOption, OutputSpec::Kind supportedTypes, std::optional<OptionType>& parameter)
454
454
{
455
455
OptionType result;
@@ -461,13 +461,13 @@ class UtilitiesMain
461
461
return false ;
462
462
}
463
463
464
- bool OutputOption (LPCWSTR szArg, LPCWSTR szOption, OutputSpec& anOutput)
464
+ static bool OutputOption (LPCWSTR szArg, LPCWSTR szOption, OutputSpec& anOutput)
465
465
{
466
466
return OutputOption (szArg, szOption, anOutput.supportedTypes , anOutput);
467
467
};
468
468
469
469
template <typename OptionType>
470
- bool OutputOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType> parameter)
470
+ static bool OutputOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType> parameter)
471
471
{
472
472
OptionType result;
473
473
if (OutputOption (szArg, szOption, result))
@@ -478,9 +478,10 @@ class UtilitiesMain
478
478
return false ;
479
479
}
480
480
481
- bool OutputFileOption (LPCWSTR szArg, LPCWSTR szOption, std::wstring& strOutputFile);
481
+ static bool OutputFileOption (LPCWSTR szArg, LPCWSTR szOption, std::wstring& strOutputFile);
482
+
482
483
template <typename OptionType>
483
- bool OutputFileOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType> parameter)
484
+ static bool OutputFileOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType> parameter)
484
485
{
485
486
OptionType result;
486
487
if (OutputFileOption (szArg, szOption, result))
@@ -491,9 +492,10 @@ class UtilitiesMain
491
492
return false ;
492
493
}
493
494
494
- bool OutputDirOption (LPCWSTR szArg, LPCWSTR szOption, std::wstring& strOutputFile);
495
+ static bool OutputDirOption (LPCWSTR szArg, LPCWSTR szOption, std::wstring& strOutputFile);
496
+
495
497
template <typename OptionType>
496
- bool OutputDirOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType>& parameter)
498
+ static bool OutputDirOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType>& parameter)
497
499
{
498
500
OptionType result;
499
501
if (OutputDirOption (szArg, szOption, result))
@@ -507,7 +509,7 @@ class UtilitiesMain
507
509
bool InputFileOption (LPCWSTR szArg, LPCWSTR szOption, std::wstring& strInputFile);
508
510
509
511
template <typename OptionType>
510
- bool InputFileOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType>& parameter)
512
+ static bool InputFileOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType>& parameter)
511
513
{
512
514
OptionType result;
513
515
if (InputFileOption (szArg, szOption, result))
@@ -518,10 +520,10 @@ class UtilitiesMain
518
520
return false ;
519
521
}
520
522
521
- bool InputDirOption (LPCWSTR szArg, LPCWSTR szOption, std::wstring& strInputFile);
523
+ static bool InputDirOption (LPCWSTR szArg, LPCWSTR szOption, std::wstring& strInputFile);
522
524
523
525
template <typename OptionType>
524
- bool InputDirOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType>& parameter)
526
+ static bool InputDirOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType>& parameter)
525
527
{
526
528
OptionType result;
527
529
if (InputDirOption (szArg, szOption, result))
@@ -532,16 +534,16 @@ class UtilitiesMain
532
534
return false ;
533
535
}
534
536
535
- bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, std::wstring& strParameter);
536
- bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, ULONGLONG& ullParameter);
537
- bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, DWORD& dwParameter);
538
- bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, std::chrono::minutes& dwParameter);
539
- bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, std::chrono::seconds& dwParameter);
540
- bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, std::chrono::milliseconds& dwParameter);
541
- bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, boost::logic::tribool& bParameter);
537
+ static bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, std::wstring& strParameter);
538
+ static bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, ULONGLONG& ullParameter);
539
+ static bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, DWORD& dwParameter);
540
+ static bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, std::chrono::minutes& dwParameter);
541
+ static bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, std::chrono::seconds& dwParameter);
542
+ static bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, std::chrono::milliseconds& dwParameter);
543
+ static bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, boost::logic::tribool& bParameter);
542
544
543
545
template <typename OptionType>
544
- bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType>& parameter)
546
+ static bool ParameterOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType>& parameter)
545
547
{
546
548
OptionType result;
547
549
if (ParameterOption (szArg, szOption, result))
@@ -552,24 +554,25 @@ class UtilitiesMain
552
554
return false ;
553
555
}
554
556
555
- bool OptionalParameterOption (
557
+ static bool OptionalParameterOption (
556
558
LPCWSTR szArg,
557
559
LPCWSTR szOption,
558
560
std::optional<std::wstring>& strParameter,
559
561
const std::optional<std::wstring> defaultValue = std::nullopt);
560
- bool OptionalParameterOption (
562
+
563
+ static bool OptionalParameterOption (
561
564
LPCWSTR szArg,
562
565
LPCWSTR szOption,
563
566
std::optional<ULONGLONG>& ullParameter,
564
567
const std::optional<ULONGLONG> defaultValue = std::nullopt);
565
- bool OptionalParameterOption (
568
+ static bool OptionalParameterOption (
566
569
LPCWSTR szArg,
567
570
LPCWSTR szOption,
568
571
std::optional<DWORD>& dwParameter,
569
572
const std::optional<DWORD> defaultValue = std::nullopt);
570
573
571
574
template <class ListContainerT >
572
- void
575
+ static void
573
576
CSVListToContainer (const std::wstring& strKeywords, ListContainerT& parameterList, const LPCWSTR szSeparator = L" ," )
574
577
{
575
578
ListContainerT keys;
@@ -594,7 +597,7 @@ class UtilitiesMain
594
597
};
595
598
596
599
template <class ListContainerT >
597
- bool ParameterListOption (
600
+ static bool ParameterListOption (
598
601
LPCWSTR szArg,
599
602
LPCWSTR szOption,
600
603
ListContainerT& parameterList,
@@ -618,18 +621,18 @@ class UtilitiesMain
618
621
return false ;
619
622
}
620
623
621
- bool FileSizeOption (LPCWSTR szArg, LPCWSTR szOption, DWORDLONG& dwlFileSize);
624
+ static bool FileSizeOption (LPCWSTR szArg, LPCWSTR szOption, DWORDLONG& dwlFileSize);
622
625
623
- bool AltitudeOption (LPCWSTR szArg, LPCWSTR szOption, LocationSet::Altitude& altitude);
626
+ static bool AltitudeOption (LPCWSTR szArg, LPCWSTR szOption, LocationSet::Altitude& altitude);
624
627
625
- bool BooleanOption (LPCWSTR szArg, LPCWSTR szOption, bool & bOption);
626
- bool BooleanOption (LPCWSTR szArg, LPCWSTR szOption, boost::logic::tribool& bOption);
627
- bool BooleanExactOption (LPCWSTR szArg, LPCWSTR szOption, boost::logic::tribool& bPresent);
628
+ static bool BooleanOption (LPCWSTR szArg, LPCWSTR szOption, bool & bOption);
629
+ static bool BooleanOption (LPCWSTR szArg, LPCWSTR szOption, boost::logic::tribool& bOption);
630
+ static bool BooleanExactOption (LPCWSTR szArg, LPCWSTR szOption, boost::logic::tribool& bPresent);
628
631
629
- bool ToggleBooleanOption (LPCWSTR szArg, LPCWSTR szOption, bool & bOption);
632
+ static bool ToggleBooleanOption (LPCWSTR szArg, LPCWSTR szOption, bool & bOption);
630
633
631
634
template <typename _EnumT>
632
- bool EnumOption (LPCWSTR szArg, LPCWSTR szOption, _EnumT& eOption, _EnumT eValue)
635
+ static bool EnumOption (LPCWSTR szArg, LPCWSTR szOption, _EnumT& eOption, _EnumT eValue)
633
636
{
634
637
if (_wcsnicmp (szArg, szOption, wcslen (szOption)))
635
638
return false ;
@@ -638,15 +641,15 @@ class UtilitiesMain
638
641
}
639
642
640
643
template <typename _FlagT, typename = std::enable_if_t <EnumFlagsOperator<_FlagT>::value>>
641
- bool FlagOption (LPCWSTR szArg, LPCWSTR szOption, _FlagT& eOption, _FlagT eValue)
644
+ static bool FlagOption (LPCWSTR szArg, LPCWSTR szOption, _FlagT& eOption, _FlagT eValue)
642
645
{
643
646
if (_wcsnicmp (szArg, szOption, wcslen (szOption)))
644
647
return false ;
645
648
eOption |= eValue;
646
649
return true ;
647
650
}
648
651
template <typename _FlagT, typename = std::enable_if_t <EnumFlagsOperator<_FlagT>::value>>
649
- bool FlagOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<_FlagT>& fOption , _FlagT eValue)
652
+ static bool FlagOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<_FlagT>& fOption , _FlagT eValue)
650
653
{
651
654
if (_wcsnicmp (szArg, szOption, wcslen (szOption)))
652
655
return false ;
@@ -656,19 +659,21 @@ class UtilitiesMain
656
659
return true ;
657
660
}
658
661
659
- bool ShadowsOption (
662
+ static bool ShadowsOption (
660
663
LPCWSTR szArg,
661
664
LPCWSTR szOption,
662
665
boost::logic::tribool& bAddShadows,
663
666
std::optional<LocationSet::ShadowFilters>& filters);
664
667
665
- bool LocationExcludeOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<LocationSet::PathExcludes>& excludes);
668
+ static bool
669
+ LocationExcludeOption (LPCWSTR szArg, LPCWSTR szOption, std::optional<LocationSet::PathExcludes>& excludes);
670
+
671
+ static bool CryptoHashAlgorithmOption (LPCWSTR szArg, LPCWSTR szOption, CryptoHashStream::Algorithm& algo);
672
+ static bool FuzzyHashAlgorithmOption (LPCWSTR szArg, LPCWSTR szOption, FuzzyHashStream::Algorithm& algo);
666
673
667
- bool CryptoHashAlgorithmOption (LPCWSTR szArg, LPCWSTR szOption, CryptoHashStream::Algorithm& algo );
668
- bool FuzzyHashAlgorithmOption (LPCWSTR szArg, LPCWSTR szOption, FuzzyHashStream::Algorithm& algo );
674
+ static bool ProcessPriorityOption (LPCWSTR szArg, LPCWSTR szOption = L" Low " );
675
+ static bool EncodingOption (LPCWSTR szArg, OutputSpec::Encoding& anEncoding );
669
676
670
- bool ProcessPriorityOption (LPCWSTR szArg, LPCWSTR szOption = L" Low" );
671
- bool EncodingOption (LPCWSTR szArg, OutputSpec::Encoding& anEncoding);
672
677
bool UsageOption (LPCWSTR szArg);
673
678
674
679
bool WaitForDebugger (int argc, const WCHAR* argv[]);
0 commit comments