Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MCSrcMsg.h

00001 #if !defined(__MCSRCMSG_H_)
00002 #define __MCSRCMSG_H_
00003 
00004 #ident "@(#)$Id: MCSrcMsg.h,v 1.3 2004/12/02 07:05:20 mike Exp $"
00005 
00006 /*
00007  * Copyright Miba Consulting Ltd. (c) 2000-2003
00008  * 
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  * 
00014  * This library is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017  * Lesser General Public License for more details.
00018  * 
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00022  *
00023  */
00024 
00025 #include "mcllib/MCMsg.h"
00026 
00027 namespace mcllib
00028 {
00029     // Forward declaration for friend
00030     class MCExcept;
00031     class MCExceptFatal;
00032 
00042     class MCSrcMsg : public MCMsg
00043     {
00044     public:
00046         typedef unsigned long linenum_t;
00048         typedef const char* filename_t;
00061         MCSrcMsg(const char* msg, filename_t fileName = 0,
00062             linenum_t lineNum = 0, msglevel_t msgLevel = MSGLVL_ALL,
00063             msgcode_t msgCode = MSGCODE_NONE);
00074         MCSrcMsg(const MCMsg& msg, filename_t fileName = 0,
00075             linenum_t lineNum = 0);
00077         virtual ~MCSrcMsg();
00078 
00083         bool hasSrc() const;
00088         const MCString& getFileName() const;
00093         const linenum_t getLineNum() const;
00094         // From MCMsg
00099         virtual MCString getText() const;
00100 
00101     protected:
00103         MCString m_fileName;
00105         linenum_t m_line;
00106 
00107         friend class MCExcept;
00108         friend class MCExceptFatal;
00109 
00114         void setString(const MCString& mcs);
00115 
00120         void setFile(const char* fileName);
00121 
00126         void setLine(linenum_t lineNum);
00127 
00134         MCSrcMsg(const MCSrcMsg& msg, msglevel_t msgLevel);
00135     };
00136 };
00137 
00138 #endif

Generated on Wed Jan 12 19:05:48 2005 for MCLLIB by  doxygen 1.3.9.1