play around with Exception handling in eflpp. I think I\'ll use it in more parts of eflpp in future...
SVN revision: 37580
This commit is contained in:
parent
c3228f58cf
commit
385507cbd1
|
@ -9,6 +9,15 @@ using std::endl;
|
|||
|
||||
namespace efl {
|
||||
|
||||
const char* PartNotExistingException::what () const throw ()
|
||||
{
|
||||
static std::string s;
|
||||
s = "EvasEdje loaded with not existing part '";
|
||||
s += txt;
|
||||
s += "'.";
|
||||
return static_cast <const char*> (s.c_str ());
|
||||
}
|
||||
|
||||
//===============================================================================================
|
||||
// EvasEdje
|
||||
//===============================================================================================
|
||||
|
@ -102,7 +111,7 @@ EdjePart* EvasEdje::part( const char* partname )
|
|||
_parts[partname] = ep;
|
||||
return ep;
|
||||
}
|
||||
DoutFatal( dc::fatal, *this << " EvasEdje::part() '%s' not existing" );
|
||||
throw PartNotExistingException (partname);
|
||||
}
|
||||
|
||||
void EvasEdje::connect( const char* emission, const char* source, const EdjeSignalSlot& slot )
|
||||
|
|
|
@ -32,6 +32,16 @@ typedef std::map<const char*, EdjePart*> EdjePartMap;
|
|||
typedef sigc::signal<void, const char*, const char*> EdjeSignalSignal;
|
||||
typedef sigc::slot2<void, const char*, const char*> EdjeSignalSlot;
|
||||
|
||||
class PartNotExistingException : public std::exception
|
||||
{
|
||||
public:
|
||||
PartNotExistingException (const char *partname) : txt (partname) {}
|
||||
const char* what () const throw ();
|
||||
|
||||
private:
|
||||
const char *txt;
|
||||
};
|
||||
|
||||
//===============================================================================================
|
||||
// Edje
|
||||
//===============================================================================================
|
||||
|
|
Loading…
Reference in New Issue