Changeset 30746 in vbox for trunk/include/iprt/cpp
- Timestamp:
- Jul 8, 2010 4:42:49 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63518
- Location:
- trunk/include/iprt/cpp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/utils.h
r30681 r30746 64 64 namespace iprt 65 65 { 66 66 67 /** 67 68 * A simple class used to prevent copying and assignment. Inherit from this -
trunk/include/iprt/cpp/xml.h
r28800 r30746 34 34 #include <memory> 35 35 36 #include <iprt/cpp/ ministring.h>36 #include <iprt/cpp/exception.h> 37 37 38 38 /* Forwards */ … … 53 53 ////////////////////////////////////////////////////////////////////////////// 54 54 55 /** 56 * Base exception class. 57 */ 58 class RT_DECL_CLASS Error : public std::exception 59 { 60 public: 61 62 Error(const char *pcszMessage) 63 : m_s(pcszMessage) 64 { 65 } 66 67 Error(const Error &s) 68 : std::exception(s), 69 m_s(s.what()) 70 { 71 } 72 73 virtual ~Error() throw() 74 { 75 } 76 77 void operator=(const Error &s) 78 { 79 m_s = s.what(); 80 } 81 82 void setWhat(const char *pcszMessage) 83 { 84 m_s = pcszMessage; 85 } 86 87 virtual const char* what() const throw() 88 { 89 return m_s.c_str(); 90 } 91 92 private: 93 // hide the default constructor to make sure the extended one above is always used 94 Error(); 95 96 iprt::MiniString m_s; 97 }; 98 99 class RT_DECL_CLASS LogicError : public Error 55 class RT_DECL_CLASS LogicError : public iprt::Error 100 56 { 101 57 public: 102 58 103 59 LogicError(const char *aMsg = NULL) 104 : xml::Error(aMsg)60 : iprt::Error(aMsg) 105 61 {} 106 62 … … 108 64 }; 109 65 110 class RT_DECL_CLASS RuntimeError : public Error66 class RT_DECL_CLASS RuntimeError : public iprt::Error 111 67 { 112 68 public: 113 69 114 70 RuntimeError(const char *aMsg = NULL) 115 : xml::Error(aMsg)71 : iprt::Error(aMsg) 116 72 {} 117 73 }; … … 173 129 int mRC; 174 130 }; 175 176 131 177 132 /**
Note:
See TracChangeset
for help on using the changeset viewer.