summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include/IceUtil')
-rw-r--r--cpp/include/IceUtil/CtrlCHandler.h2
-rw-r--r--cpp/include/IceUtil/Exception.h6
-rwxr-xr-xcpp/include/IceUtil/Options.h52
-rw-r--r--cpp/include/IceUtil/RWRecMutex.h2
-rw-r--r--cpp/include/IceUtil/Random.h2
-rw-r--r--cpp/include/IceUtil/ThreadException.h10
-rw-r--r--cpp/include/IceUtil/Unicode.h2
7 files changed, 44 insertions, 32 deletions
diff --git a/cpp/include/IceUtil/CtrlCHandler.h b/cpp/include/IceUtil/CtrlCHandler.h
index f445632cf68..fe1d91d6246 100644
--- a/cpp/include/IceUtil/CtrlCHandler.h
+++ b/cpp/include/IceUtil/CtrlCHandler.h
@@ -61,7 +61,7 @@ class ICE_UTIL_API CtrlCHandlerException : public Exception
public:
CtrlCHandlerException(const char*, int);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
};
diff --git a/cpp/include/IceUtil/Exception.h b/cpp/include/IceUtil/Exception.h
index 2c6b4385f4f..a83b23ac31e 100644
--- a/cpp/include/IceUtil/Exception.h
+++ b/cpp/include/IceUtil/Exception.h
@@ -22,7 +22,7 @@ public:
Exception();
Exception(const char*, int);
virtual ~Exception();
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual void ice_print(std::ostream&) const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
@@ -43,7 +43,7 @@ class ICE_UTIL_API NullHandleException : public Exception
public:
NullHandleException(const char*, int);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
@@ -58,7 +58,7 @@ public:
IllegalArgumentException(const char*, int);
IllegalArgumentException(const char*, int, const std::string&);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
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 };
diff --git a/cpp/include/IceUtil/RWRecMutex.h b/cpp/include/IceUtil/RWRecMutex.h
index 114cd97bc38..ad196ff2a65 100644
--- a/cpp/include/IceUtil/RWRecMutex.h
+++ b/cpp/include/IceUtil/RWRecMutex.h
@@ -22,7 +22,7 @@ class ICE_UTIL_API DeadlockException : public Exception
public:
DeadlockException(const char*, int);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
diff --git a/cpp/include/IceUtil/Random.h b/cpp/include/IceUtil/Random.h
index 64c010ba2c5..70be8bc7f14 100644
--- a/cpp/include/IceUtil/Random.h
+++ b/cpp/include/IceUtil/Random.h
@@ -21,7 +21,7 @@ class ICE_UTIL_API RandomGeneratorException : public Exception
public:
RandomGeneratorException(const char*, int, int = 0);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual void ice_print(std::ostream&) const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
diff --git a/cpp/include/IceUtil/ThreadException.h b/cpp/include/IceUtil/ThreadException.h
index 66e21054022..efb382acdec 100644
--- a/cpp/include/IceUtil/ThreadException.h
+++ b/cpp/include/IceUtil/ThreadException.h
@@ -20,7 +20,7 @@ class ICE_UTIL_API ThreadSyscallException : public Exception
public:
ThreadSyscallException(const char*, int, int);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual void ice_print(std::ostream&) const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
@@ -37,7 +37,7 @@ class ICE_UTIL_API ThreadLockedException : public Exception
public:
ThreadLockedException(const char*, int);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
@@ -51,7 +51,7 @@ class ICE_UTIL_API ThreadStartedException : public Exception
public:
ThreadStartedException(const char*, int);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
@@ -65,7 +65,7 @@ class ICE_UTIL_API ThreadNotStartedException : public Exception
public:
ThreadNotStartedException(const char*, int);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
@@ -79,7 +79,7 @@ class ICE_UTIL_API BadThreadControlException : public Exception
public:
BadThreadControlException(const char*, int);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;
diff --git a/cpp/include/IceUtil/Unicode.h b/cpp/include/IceUtil/Unicode.h
index dc44b288331..5a68b5b3aa5 100644
--- a/cpp/include/IceUtil/Unicode.h
+++ b/cpp/include/IceUtil/Unicode.h
@@ -139,7 +139,7 @@ class ICE_UTIL_API UTFConversionException : public Exception
public:
UTFConversionException(const char*, int, ConversionResult);
- virtual const std::string ice_name() const;
+ virtual std::string ice_name() const;
virtual void ice_print(std::ostream&) const;
virtual Exception* ice_clone() const;
virtual void ice_throw() const;