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 
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 {
43  "You can't specify ANY Unlabeled Arg following an optional Unlabeled Arg",
44  argName ) );
45 
46  if ( !req )
48 }
49 
50 }; // namespace ecl
51 
52 
53 #endif
static void check(bool req, const std::string &argName)
Defines the exception that is thrown whenever a conflict in arguments occurs.


ecl_command_line
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:08:08