Newer
Older
#ifndef ERROR_HH
# define ERROR_HH
# include <ios>
# include <iostream>
# include <sstream>
typedef std::string string;
typedef std::stringstream sstream;
typedef std::ostream ostream;
class Error
{
public:
Error(int i, string s = "");
Error(const Error &e);
void print() const;
string message() const;
int code() const;
void code(int);
Error &operator=(const Error &rhs);
friend ostream &operator<<(ostream &o, const Error &e);
friend Error &operator<<(Error &e, const string &s);
friend Error &operator>>(Error &e, const string &s);
friend Error &operator<<(Error &e, int val);
protected:
sstream msg_;
int val_;
};
#endif