00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(_xyzzy_message_hxx_)
00023 # define _xyzzy_message_hxx_
00024
00025 #include <iostream>
00026 #include <string>
00027 #include <map>
00028
00029 namespace xyzzy
00030 {
00031 using namespace std;
00032
00034 class TMessage
00035 {
00036 public:
00037 enum ESeverity {eInfo = 0, eWarn, eError, eFatal};
00038
00039 static void msg(ESeverity svr, unsigned code, ...);
00040
00041 static void addMsgs(unsigned code, string msg);
00042
00044 static void addMsgs(string msgs[], unsigned code = 1);
00045
00046 static void setStream(ESeverity strm, ostream *os);
00047
00048 private:
00049 typedef map<unsigned, string> TMsgMap;
00050
00051 static TMsgMap m_msgMap;
00052
00054 static ostream* m_strms[];
00055 };
00056 };
00057
00058 #endif //_xyzzy_message_hxx_