home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftptest.leeds.ac.uk
/
2015.02.ftptest.leeds.ac.uk.tar
/
ftptest.leeds.ac.uk
/
bionet
/
CAE-GROUP
/
SCL-WIN3x
/
SCL.EXE
/
ERRORDES.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-06
|
2KB
|
113 lines
/*
* NIST Utils Class Library
* clutils/errordesc.cc
* February, 1994
* David Sauder
* K. C. Morris
* Development of this software was funded by the United States Government,
* and is not subject to copyright.
*/
/* $Id: errordesc.cc,v 2.0.1.2 1994/04/05 16:44:39 sauderd Exp $ */
#include <errordes.h>
DebugLevel ErrorDescriptor::_debug_level = DEBUG_OFF;
ostream * ErrorDescriptor::_out = 0;
ErrorDescriptor::ErrorDescriptor ( Severity s, DebugLevel d)
: _severity (s),
_userMsg (0),
_detailMsg (0)
{
if (d != DEBUG_OFF)
_debug_level = d;
}
const char *
ErrorDescriptor::UserMsg () const
{
if(_userMsg)
return _userMsg->chars();
else
return "";
}
void
ErrorDescriptor::UserMsg ( const char * msg)
{
if(!_userMsg)
_userMsg = new SCLstring;
*_userMsg = msg;
}
void
ErrorDescriptor::PrependToUserMsg ( const char * msg)
{
if(!_userMsg)
_userMsg = new SCLstring;
_userMsg -> Prepend (msg);
}
void
ErrorDescriptor::AppendToUserMsg ( const char * msg)
{
if(!_userMsg)
_userMsg = new SCLstring;
_userMsg -> Append (msg);
}
const char *
ErrorDescriptor::DetailMsg () const
{
if(_detailMsg)
return _detailMsg->chars();
else
return "";
}
void
ErrorDescriptor::DetailMsg ( const char * msg)
{
if(!_detailMsg)
_detailMsg = new SCLstring;
*_detailMsg = msg;
// cerr << "D " << _detailMsg->chars() << '\n';
}
void
ErrorDescriptor::PrependToDetailMsg (const char * msg)
{
if(!_detailMsg)
_detailMsg = new SCLstring;
_detailMsg -> Prepend (msg);
}
void
ErrorDescriptor::AppendToDetailMsg (const char * msg)
{
if(!_detailMsg)
_detailMsg = new SCLstring;
_detailMsg -> Append (msg);
}
/******************************************************************
** Procedure: ErrorMessage
** Parameters: char * msg -- message to print
** Returns:
** Description: prints out a fatal error messsage and exits the program
** Side Effects: aborts the program
** Status: stub for better function
******************************************************************/
void
ErrorMessage (char * msg)
{
cerr << "WARNING: Unknown dangerous error: " << msg << "\n";
cerr << "***** Suggest that you save file before continuing *****\n" ;
}