message.hxx

Go to the documentation of this file.
00001 /*
00002  *   xyzzy
00003  *   Copyright (C) 2007    Karl W. Pfalzer
00004  *
00005  *   This program is free software; you can redistribute it and/or
00006  *   modify it under the terms of the GNU General Public License
00007  *   as published by the Free Software Foundation; either version 2
00008  *   of the License, or (at your option) any later version.
00009  *
00010  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with this program; if not, write to the
00017  *   Free Software Foundation, Inc.
00018  *   51 Franklin Street, Fifth Floor
00019  *   Boston, MA  02110-1301, USA.
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_

Generated on Thu Mar 22 13:51:07 2007 for anvil by  doxygen 1.5.1