summaryrefslogtreecommitdiff
path: root/include/iprt/cpp/exception.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/iprt/cpp/exception.h')
-rw-r--r--include/iprt/cpp/exception.h55
1 files changed, 27 insertions, 28 deletions
diff --git a/include/iprt/cpp/exception.h b/include/iprt/cpp/exception.h
index 7d9baf664..4fcbfb727 100644
--- a/include/iprt/cpp/exception.h
+++ b/include/iprt/cpp/exception.h
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -27,69 +27,68 @@
#define ___iprt_cpp_exception_h
#include <iprt/cpp/ministring.h>
+#include <exception>
-/** @defgroup grp_rt_cppxcpt C++ Exceptions
- * @ingroup grp_rt
+/** @defgroup grp_rt_cpp_exceptions C++ Exceptions
+ * @ingroup grp_rt_cpp
* @{
*/
-namespace iprt
-{
-
/**
* Base exception class for IPRT, derived from std::exception.
* The XML exceptions are based on this.
*/
-class RT_DECL_CLASS Error
+class RT_DECL_CLASS RTCError
: public std::exception
{
public:
- Error(const char *pcszMessage)
- : m_s(pcszMessage)
+ RTCError(const char *pszMessage)
+ : m_strMsg(pszMessage)
{
}
- Error(const iprt::MiniString &s)
- : m_s(s)
+ RTCError(const RTCString &a_rstrMessage)
+ : m_strMsg(a_rstrMessage)
{
}
- Error(const Error &s)
- : std::exception(s),
- m_s(s.what())
+ RTCError(const RTCError &a_rSrc)
+ : std::exception(a_rSrc),
+ m_strMsg(a_rSrc.what())
{
}
- virtual ~Error() throw()
+ virtual ~RTCError() throw()
{
}
- void operator=(const Error &s)
+ void operator=(const RTCError &a_rSrc)
{
- m_s = s.what();
+ m_strMsg = a_rSrc.what();
}
- void setWhat(const char *pcszMessage)
+ void setWhat(const char *a_pszMessage)
{
- m_s = pcszMessage;
+ m_strMsg = a_pszMessage;
}
- virtual const char* what() const throw()
+ virtual const char *what() const throw()
{
- return m_s.c_str();
+ return m_strMsg.c_str();
}
private:
- /* Hide the default constructor to make sure the extended one above is
- always used. */
- Error();
-
- iprt::MiniString m_s;
+ /**
+ * Hidden default constructor making sure that the extended one above is
+ * always used.
+ */
+ RTCError();
+
+ /** The exception message. */
+ RTCString m_strMsg;
};
-} /* namespace iprt */
-
/** @} */
#endif