CommandLineExceptions.hpp
Go to the documentation of this file.
1 // @formatter:off
2 //
3 // Balau core C++ library
4 //
5 // Copyright (C) 2008 Bora Software (contact@borasoftware.com)
6 //
7 // Licensed under the Boost Software License - Version 1.0 - August 17th, 2003.
8 // See the LICENSE file for the full license text.
9 //
10 
16 
17 #ifndef COM_BORA_SOFTWARE__BALAU_EXCEPTION__COMMAND_LINE_EXCEPTIONS
18 #define COM_BORA_SOFTWARE__BALAU_EXCEPTION__COMMAND_LINE_EXCEPTIONS
19 
21 
22 namespace Balau::Exception {
23 
28  public: CommandlineException(const char * file, int line, const std::string & st, const std::string & text)
29  : BalauException(file, line, st, "Commandline", text) {}
30 
31  public: CommandlineException(const char * file, int line, const std::string & st, const std::string & name, const std::string & text)
32  : BalauException(file, line, st, name, text) {}
33 };
34 
39  public: OptionNotFoundException(const char * file, int line, const std::string & st, const std::string & key)
40  : CommandlineException(file, line, st, "OptionNotFound", key) {}
41 };
42 
47  public: MissingOptionValueException(const char * file, int line, const std::string & st, const std::string & )
48  : CommandlineException(file, line, st, "MissingOptionValue", "") {}
49 };
50 
55  public: MissingFinalValueException(const char * file, int line, const std::string & st, const std::string & )
56  : CommandlineException(file, line, st, "MissingFinalValue", "") {}
57 };
58 
63  public: OptionValueException(const char * file, int line, const std::string & st, const std::string & key)
64  : CommandlineException(file, line, st, "OptionValue", key) {}
65 };
66 
67 } // namespace Balau::Exception
68 
69 #endif // COM_BORA_SOFTWARE__BALAU_EXCEPTION__COMMAND_LINE_EXCEPTIONS
Thrown when an invalid command line parameter is specified.
Definition: CommandLineExceptions.hpp:38
All exception classes.
Definition: BalauException.hpp:50
Base class of command line exception classes.
Definition: CommandLineExceptions.hpp:27
Thrown when a requested option value cannot be coerced into the required type.
Definition: CommandLineExceptions.hpp:62
Base Balau exception classes.
Base class of all Balau exceptions.
Definition: BalauException.hpp:55
Thrown when there is no option value available and one is required.
Definition: CommandLineExceptions.hpp:46
Thrown when there is no final value available and one is required.
Definition: CommandLineExceptions.hpp:54