diff options
author | Michi Henning <michi@zeroc.com> | 2006-08-29 03:05:35 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2006-08-29 03:05:35 +0000 |
commit | 867d62b25a8be3774677296dcd438da2ec6ea26c (patch) | |
tree | a337af523816a16f48851d084ce59d202e57eb68 /cpp/include/IceUtil/Options.h | |
parent | Bugs 1339, 1325, 1335. (diff) | |
download | ice-867d62b25a8be3774677296dcd438da2ec6ea26c.tar.bz2 ice-867d62b25a8be3774677296dcd438da2ec6ea26c.tar.xz ice-867d62b25a8be3774677296dcd438da2ec6ea26c.zip |
Bug 1339.
Bug 1335 and 1325 for Ice-E.
Diffstat (limited to 'cpp/include/IceUtil/Options.h')
-rwxr-xr-x | cpp/include/IceUtil/Options.h | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/cpp/include/IceUtil/Options.h b/cpp/include/IceUtil/Options.h index 9f03c48366b..780289ecb8f 100755 --- a/cpp/include/IceUtil/Options.h +++ b/cpp/include/IceUtil/Options.h @@ -14,6 +14,7 @@ #include <IceUtil/RecMutex.h> #include <IceUtil/Shared.h> #include <IceUtil/Handle.h> +#include <IceUtil/Exception.h> #include <string> #include <vector> #include <map> @@ -21,34 +22,45 @@ namespace IceUtil { -class ICE_UTIL_API Options +class ICE_UTIL_API APIException : public IceUtil::Exception { public: - struct Error - { - Error(const ::std::string& r) : reason(r) {} - ::std::string reason; + APIException(const char*, int, const ::std::string&); + virtual ::std::string ice_name() const; + virtual ::IceUtil::Exception* ice_clone() const; + virtual void ice_throw() const; - protected: + ::std::string reason; - Error() {} // This struct is an abstract base. - }; +private: - struct APIError : public Error - { - APIError(const ::std::string& r) : Error(r) {} - }; + static const char* _name; +}; - struct BadOpt : public Error - { - BadOpt(const ::std::string& r) : Error(r) {} - }; +ICE_UTIL_API ::std::ostream& operator<<(::std::ostream&, const APIException&); - struct BadQuote : public Error - { - BadQuote(const ::std::string& r) : Error(r) {} - }; +class ICE_UTIL_API BadOptException : public IceUtil::Exception +{ +public: + + BadOptException(const char*, int, const ::std::string&); + virtual ::std::string ice_name() const; + virtual ::IceUtil::Exception* ice_clone() const; + virtual void ice_throw() const; + + ::std::string reason; + +private: + + static const char* _name; +}; + +ICE_UTIL_API ::std::ostream& operator<<(::std::ostream&, const BadOptException&); + +class ICE_UTIL_API Options +{ +public: enum LengthType { ShortOpt, LongOpt }; enum RepeatType { Repeat, NoRepeat }; |