// Clint - Source code checker for C++
// Copyright (C) 2001 David Pashley
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef __MESSAGE_H__
#define __MESSAGE_H__
#include <vector>
#include <string>
namespace clint {
enum Level {ERROR, WARNING };
class Message {
private:
std::string m_file;
int m_line;
std::string m_message;
Level m_level;
public:
Message(std::string file, int line, std::string message, Level level = WARNING);
friend std::ostream & operator << (std::ostream & out, const Message msg);
friend bool operator< (const Message a, const Message b);
};
typedef std::vector<Message> Messages;
std::ostream & operator << (std::ostream & out, const Messages msgs);
extern Messages msgs;
}
#endif // __MESSAGE_H__
syntax highlighted by Code2HTML, v. 0.9.1