This repository has been archived on 2026-03-28. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
eodev/eo/src/UException.h
1999-10-29 11:23:10 +00:00

41 lines
974 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//-----------------------------------------------------------------------------
// UException.h
//-----------------------------------------------------------------------------
#ifndef _UEXCEPTION_H
#define _UEXCEPTION_H
#include <string>
#if defined (__BCPLUSPLUS__)
#include <stdexcept>
#else
#include <exception>
#endif
using namespace std;
//-----------------------------------------------------------------------------
// Class UException
//-----------------------------------------------------------------------------
//@{
/**
* This class manages exceptions. It´s barely an extension of the standard exception,
* but it can be initialized with an STL string. Called UException (utils-exception)+
* to avoid conflicts with other classes.
*/
class UException: public exception {
public:
///
UException( const string& _msg ): msg( _msg ) { };
///
virtual const char* what() const { return msg.c_str(); };
private:
string msg;
};
//@}
#endif