message.hh

Go to the documentation of this file.
00001 /*
00002    The lestes compiler suite
00003    Copyright (C) 2002, 2003, 2004, 2005 Miroslav Tichy
00004    Copyright (C) 2002, 2003, 2004, 2005 Petr Zika
00005    Copyright (C) 2002, 2003, 2004, 2005 Vojtech Hala
00006    Copyright (C) 2002, 2003, 2004, 2005 Jiri Kosina
00007    Copyright (C) 2002, 2003, 2004, 2005 Pavel Sanda
00008    Copyright (C) 2002, 2003, 2004, 2005 Jan Zouhar
00009    Copyright (C) 2002, 2003, 2004, 2005 Rudolf Thomas
00010 
00011    This program is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; version 2 of the License.
00014 
00015    This program is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019 
00020    See the full text of the GNU General Public License version 2, and
00021    the limitations in the file doc/LICENSE.
00022 
00023    By accepting the license the licensee waives any and all claims
00024    against the copyright holder(s) related in whole or in part to the
00025    work, its use, and/or the inability to use it.
00026  
00027  */
00028 #ifndef lestes__msg___message_hh___included
00029 #define lestes__msg___message_hh___included
00030 
00031 /*! \file
00032   \brief Message wrapper.
00033 
00034   Declaration of message class representing text message.
00035   \author pt
00036 */
00037 #include <lestes/common.hh>
00038 
00039 package(lestes);
00040 package(msg);
00041 
00042 /*!
00043   \brief Message wrapper.
00044 
00045   Represents text message with message kind identification and flags.
00046   The message is usually returned from message stencil.
00047 */
00048 class message: public ::lestes::std::object {
00049 public:
00050         //! Type of message flags.
00051         typedef enum message_flags {
00052                 //! General message.
00053                 FLG_NONE = 0x0,
00054                 //! Fatal error message.
00055                 FLG_FATAL = 0x1,
00056                 //! Error message.
00057                 FLG_ERROR = 0x2,
00058                 //! Warning message.
00059                 FLG_WARNING = 0x4,
00060                 //! Hint message.
00061                 FLG_HINT = 0x8
00062         } flags_type;
00063         //! Returns stencil kind identification.
00064         ulint kind_get(void) const;
00065         //! Returns the message text.
00066         lstring text_get(void) const;
00067         //! Returns message flags.
00068         flags_type flags_get(void) const;
00069         //! Tests equality.
00070         bool equals(const ptr<message> &other) const;
00071         //! Returns new message.
00072         static ptr<message> create(ulint a_id, const lstring &a_text, flags_type a_flags);
00073 private:
00074         //! Creates a message.
00075         message(ulint a_id, const lstring &a_text, flags_type a_flags);
00076 protected:
00077         //! Identification of message kind.
00078         ulint kind;
00079         //! Message text.
00080         lstring text;
00081         //! Message flags.
00082         flags_type flags;
00083         //! Hides copy constructor.
00084         message(const message &);
00085         //! Hides assignment operator.
00086         message &operator=(const message &);
00087 };
00088 
00089 end_package(msg);
00090 end_package(lestes);
00091 #endif
00092 /* vim: set ft=lestes : */

Generated on Mon Feb 12 18:22:41 2007 for lestes by doxygen 1.5.1-20070107