include
ecl
command_line
optional_unlabeled_tracker.hpp
Go to the documentation of this file.
1
11
/*****************************************************************************
12
** Ifdefs
13
*****************************************************************************/
14
15
#ifndef TCLAP_OPTIONAL_UNLABELED_TRACKER_H
16
#define TCLAP_OPTIONAL_UNLABELED_TRACKER_H
17
18
#include <string>
19
20
namespace
ecl
{
21
22
class
OptionalUnlabeledTracker
23
{
24
25
public
:
26
27
static
void
check
(
bool
req,
const
std::string& argName );
28
29
static
void
gotOptional
() {
alreadyOptionalRef
() =
true
; }
30
31
static
bool
&
alreadyOptional
() {
return
alreadyOptionalRef
(); }
32
33
private
:
34
35
static
bool
&
alreadyOptionalRef
() {
static
bool
ct =
false
;
return
ct; }
36
};
37
38
39
inline
void
OptionalUnlabeledTracker::check
(
bool
req,
const
std::string& argName )
40
{
41
if
(
OptionalUnlabeledTracker::alreadyOptional
() )
42
throw
(
SpecificationException
(
43
"You can't specify ANY Unlabeled Arg following an optional Unlabeled Arg"
,
44
argName ) );
45
46
if
( !req )
47
OptionalUnlabeledTracker::gotOptional
();
48
}
49
50
};
// namespace ecl
51
52
53
#endif
ecl::OptionalUnlabeledTracker::alreadyOptionalRef
static bool & alreadyOptionalRef()
Definition:
optional_unlabeled_tracker.hpp:39
ecl::OptionalUnlabeledTracker::gotOptional
static void gotOptional()
Definition:
optional_unlabeled_tracker.hpp:33
ecl::SpecificationException
Defines the exception that is thrown whenever a conflict in arguments occurs.
Definition:
arg_exception.hpp:169
ecl::OptionalUnlabeledTracker::check
static void check(bool req, const std::string &argName)
Definition:
optional_unlabeled_tracker.hpp:41
ecl::OptionalUnlabeledTracker::alreadyOptional
static bool & alreadyOptional()
Definition:
optional_unlabeled_tracker.hpp:35
ecl
ecl_command_line
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:13