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
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "mcllib/MCMsg.h"
00026
00027 namespace mcllib
00028 {
00029
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
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