- remove clone method declarations (SGI/Irix compiler bugs)

- added default implementation for sg_throwable::getFormattedMessage
  (returns sg_throwable::getMessage by default)
- removed unneeded newline in sg_location::asString
This commit is contained in:
curt 2001-07-24 21:40:46 +00:00
parent 55845bbbb9
commit 445cd4ccda

View File

@ -95,7 +95,7 @@ sg_location::asString () const
sprintf(buf, "line %d", _line); sprintf(buf, "line %d", _line);
out += buf; out += buf;
if (_column != -1) if (_column != -1)
out += ",\n"; out += ", ";
} }
if (_column != -1) { if (_column != -1) {
sprintf(buf, "column %d", _column); sprintf(buf, "column %d", _column);
@ -133,6 +133,12 @@ sg_throwable::getMessage () const
return _message; return _message;
} }
const string
sg_throwable::getFormattedMessage () const
{
return getMessage();
}
void void
sg_throwable::setMessage (const string &message) sg_throwable::setMessage (const string &message)
{ {
@ -152,14 +158,6 @@ sg_throwable::setOrigin (const string &origin)
} }
sg_throwable *
sg_throwable::clone () const
{
return new sg_throwable(getMessage(), getOrigin());
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Implementation of sg_error class. // Implementation of sg_error class.
@ -179,12 +177,6 @@ sg_error::~sg_error ()
{ {
} }
sg_error *
sg_error::clone () const
{
return new sg_error(getMessage(), getOrigin());
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
@ -205,12 +197,6 @@ sg_exception::~sg_exception ()
{ {
} }
sg_exception *
sg_exception::clone () const
{
return new sg_exception(getMessage(), getOrigin());
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
@ -239,6 +225,15 @@ sg_io_exception::~sg_io_exception ()
{ {
} }
const string
sg_io_exception::getFormattedMessage () const
{
string ret = getMessage();
ret += "\n at ";
ret += getLocation().asString();
return ret;
}
const sg_location & const sg_location &
sg_io_exception::getLocation () const sg_io_exception::getLocation () const
{ {
@ -251,13 +246,6 @@ sg_io_exception::setLocation (const sg_location &location)
_location = location; _location = location;
} }
sg_io_exception *
sg_io_exception::clone () const
{
return new sg_io_exception(getMessage(), getLocation(), getOrigin());
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
@ -294,12 +282,6 @@ sg_format_exception::setText (const string &text)
_text = text; _text = text;
} }
sg_format_exception *
sg_format_exception::clone () const
{
return new sg_format_exception(getMessage(), getText(), getOrigin());
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
@ -321,11 +303,5 @@ sg_range_exception::~sg_range_exception ()
{ {
} }
sg_range_exception *
sg_range_exception::clone () const
{
return new sg_range_exception(getMessage(), getOrigin());
}
// end of exception.cxx // end of exception.cxx