11/* *
22 * @file hashccErrException.h
3+ * @brief Base exception class for HASHCC
34 * @author Christian (graetz23@gmail.com)
45 *
56 * HASHCC is distributed under the MIT License (MIT); this file is part of.
2324 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2425 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2526 * THE SOFTWARE.
27+ *
28+ * @class HASHCC::ERR::Exception
29+ * @brief Base exception class for all HASHCC exceptions.
30+ * @ingroup ERR
31+ *
32+ * This is the base class for all exceptions in the HASHCC library.
33+ * It provides basic exception handling functionality including
34+ * message storage, reporting, and error output.
2635 */
2736
2837#ifndef __hashccErrException_h__
@@ -44,40 +53,73 @@ namespace ERR {
4453
4554/* *****************************************************************************/
4655
56+ /* *
57+ * @defgroup CharTypes Character Types
58+ * @brief Character type definitions for ERR namespace
59+ */
60+
61+ /* * @brief Character type @ingroup CharTypes */
4762typedef HASHCC::Char Char; // stc namespace typedef
63+ /* * @brief Constant character type @ingroup CharTypes */
4864typedef HASHCC::cChar cChar; // stc namespace typedef
65+ /* * @brief String type @ingroup CharTypes */
4966typedef HASHCC::String String; // stc namespace typedef
5067
5168/* *****************************************************************************/
5269
70+ /* *
71+ * @class HASHCC::ERR::Exception
72+ * @brief Base exception class for all HASHCC exceptions.
73+ * @ingroup ERR
74+ *
75+ * This is the base class for all exceptions in the HASHCC library.
76+ * It provides basic exception handling functionality including
77+ * message storage, reporting, and error output.
78+ */
5379class // / base class for errors
5480Exception {
5581 public:
5682
57- Exception ( void ); // / constructor
58- Exception ( std::exception stdException ); // / constructor
59- Exception ( cChar* message ); // / constructor overloaded
60- Exception ( String message ); // / constructor overloaded
61- Exception ( String message, Int16 lineNo ); // / use __LINE__ @ lineNo
62- Exception ( String message, Char* fileName ); // / use __FILE__ @ fileName
63- Exception ( String message, Char* fileName, Int16 lineNo ); // / use __FILE__ @ fileName and __LINE__ @ lineNo
64- virtual ~Exception ( void ); // / destructor
65-
66- String declare ( void ) const ; // / returns message as std::string
67- void report ( void ) const ; // / message to console
68- void stop ( void ) const ; // / message to console and wait for enter
69- void nuke ( void ) const ; // / do a nuke and melt down afterwards
70-
71- friend std::ostream& operator << ( std::ostream& outputStream, Exception& exception ); // / cout
72- friend std::ostream& operator << ( std::ostream& outputStream, Exception* exception ); // / cout
83+ /* * @brief Default constructor */
84+ Exception ( void );
85+ /* * @brief Construct from std::exception */
86+ Exception ( std::exception stdException );
87+ /* * @brief Construct with C-string message */
88+ Exception ( cChar* message );
89+ /* * @brief Construct with String message */
90+ Exception ( String message );
91+ /* * @brief Construct with message and line number */
92+ Exception ( String message, Int16 lineNo );
93+ /* * @brief Construct with message and filename */
94+ Exception ( String message, Char* fileName );
95+ /* * @brief Construct with message, filename and line number */
96+ Exception ( String message, Char* fileName, Int16 lineNo );
97+ /* * @brief Destructor */
98+ virtual ~Exception ( void );
99+
100+ /* * @brief Returns the exception message as std::string */
101+ String declare ( void ) const ;
102+ /* * @brief Reports the exception message to console */
103+ void report ( void ) const ;
104+ /* * @brief Reports to console and waits for user input */
105+ void stop ( void ) const ;
106+ /* * @brief Reports and terminates the program */
107+ void nuke ( void ) const ;
108+
109+ /* * @brief Stream output operator */
110+ friend std::ostream& operator << ( std::ostream& outputStream, Exception& exception );
111+ /* * @brief Stream output operator for pointer */
112+ friend std::ostream& operator << ( std::ostream& outputStream, Exception* exception );
73113
74114 protected:
75115
76- String _message; // / the generated exception message
116+ /* * @brief The exception message */
117+ String _message;
77118
78119 private:
79120
80- virtual void mark ( void ); // / mark exception
121+ /* * @brief Marks the exception (internal use) */
122+ virtual void mark ( void );
81123
82124}; // class Exception
83125
0 commit comments