lib

Kross::Api::Exception Class Reference

#include <exception.h>

Inheritance diagram for Kross::Api::Exception:
Kross::Api::Object

Public Types

typedef TDESharedPtr< Exception > Ptr
Public Types inherited from Kross::Api::Object
typedef TDESharedPtr< Object > Ptr

Public Member Functions

 Exception (const TQString &error, long lineno=-1)
virtual ~Exception ()
virtual const TQString getClassName () const
virtual const TQString toString ()
const TQString getError () const
const TQString getTrace () const
void setTrace (const TQString &tracemessage)
long getLineNo () const
Public Member Functions inherited from Kross::Api::Object
 Object ()
virtual ~Object ()
virtual Object::Ptr call (const TQString &name, TDESharedPtr< List > arguments)
virtual TQStringList getCalls ()

Additional Inherited Members

Static Public Member Functions inherited from Kross::Api::Object
template<class T>
static T * fromObject (Object::Ptr object)
template<typename TYPE>
static Object::Ptr toObject (TYPE t)

Detailed Description

Common exception class used for representing exceptions in Kross.

Internal we use Exception instances to throw and handle exceptions. Those exceptions are inherited from Object and therefore they are first class citizens in Kross.

Definition at line 38 of file exception.h.

Member Typedef Documentation

◆ Ptr

typedef TDESharedPtr<Exception> Kross::Api::Exception::Ptr

Shared pointer to implement reference-counting.

Definition at line 45 of file exception.h.

Constructor & Destructor Documentation

◆ Exception()

Exception::Exception ( const TQString & error,
long lineno = -1 )

Constructor.

Parameters
errorThe error message.
linenoThe liner number in the scripting code where this exception got thrown.

Definition at line 27 of file exception.cpp.

◆ ~Exception()

Exception::~Exception ( )
virtual

Destructor.

Definition at line 35 of file exception.cpp.

Member Function Documentation

◆ getClassName()

const TQString Exception::getClassName ( ) const
virtual
See also
Kross::Api::Object::getClassName()

Implements Kross::Api::Object.

Definition at line 39 of file exception.cpp.

◆ getError()

const TQString Exception::getError ( ) const
Returns
the error message.

Definition at line 51 of file exception.cpp.

◆ getLineNo()

long Exception::getLineNo ( ) const
Returns
the line number in the scripting code where the exception got thrown or -1 if there was no line number defined.

Definition at line 66 of file exception.cpp.

◆ getTrace()

const TQString Exception::getTrace ( ) const
Returns
a more detailed tracemessage or TQString() if there is no trace avaiable.

Definition at line 56 of file exception.cpp.

◆ setTrace()

void Exception::setTrace ( const TQString & tracemessage)

Set a more detailed tracemessage.

Definition at line 61 of file exception.cpp.

◆ toString()

const TQString Exception::toString ( )
virtual
See also
Kross::Api::Object::toString()

Reimplemented from Kross::Api::Object.

Definition at line 44 of file exception.cpp.


The documentation for this class was generated from the following files: