// ********************************************************************** // // Copyright (c) 2001 // ZeroC, Inc. // Huntsville, AL, USA // // All Rights Reserved // // ********************************************************************** #include using namespace std; IceUtil::Exception::Exception() : _file(0), _line(0) { } IceUtil::Exception::Exception(const char* file, int line) : _file(file), _line(line) { } IceUtil::Exception::~Exception() { } string IceUtil::Exception::ice_name() const { return "IceUtil::Exception"; } void IceUtil::Exception::ice_print(ostream& out) const { if(_file && _line > 0) { out << _file << ':' << _line << ": "; } out << ice_name(); } IceUtil::Exception* IceUtil::Exception::ice_clone() const { return new Exception(*this); } void IceUtil::Exception::ice_throw() const { throw *this; } const char* IceUtil::Exception::ice_file() const { return _file; } int IceUtil::Exception::ice_line() const { return _line; } ostream& IceUtil::operator<<(ostream& out, const IceUtil::Exception& ex) { ex.ice_print(out); return out; } IceUtil::NullHandleException::NullHandleException(const char* file, int line) : Exception(file, line) { } string IceUtil::NullHandleException::ice_name() const { return "IceUtil::NullHandleException"; } IceUtil::Exception* IceUtil::NullHandleException::ice_clone() const { return new NullHandleException(*this); } void IceUtil::NullHandleException::ice_throw() const { throw *this; }