exception.h
1/***************************************************************************
2 * exception.h
3 * This file is part of the KDE project
4 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; see the file COPYING. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 ***************************************************************************/
19
20#ifndef KROSS_API_EXCEPTION_H
21#define KROSS_API_EXCEPTION_H
22
23#include "object.h"
24
25#include <tqstring.h>
26#include <ksharedptr.h>
27
28namespace Kross { namespace Api {
29
38 class Exception : public Object
39 {
40 public:
41
45 typedef TDESharedPtr<Exception> Ptr;
46
54 Exception(const TQString& error, long lineno = -1);
55
59 virtual ~Exception();
60
62 virtual const TQString getClassName() const;
63
65 virtual const TQString toString();
66
70 const TQString getError() const;
71
76 const TQString getTrace() const;
77
81 void setTrace(const TQString& tracemessage);
82
88 long getLineNo() const;
89
90 private:
92 TQString m_error;
94 TQString m_trace;
96 long m_lineno;
97 };
98
99}}
100
101#endif
102
Common exception class used for representing exceptions in Kross.
Definition exception.h:39
virtual const TQString toString()
Definition exception.cpp:45
virtual const TQString getClassName() const
Definition exception.cpp:40
const TQString getTrace() const
Definition exception.cpp:57
TDESharedPtr< Exception > Ptr
Shared pointer to implement reference-counting.
Definition exception.h:45
long getLineNo() const
Definition exception.cpp:67
virtual ~Exception()
Destructor.
Definition exception.cpp:36
const TQString getError() const
Definition exception.cpp:52
void setTrace(const TQString &tracemessage)
Set a more detailed tracemessage.
Definition exception.cpp:62
The common Object class all other object-classes are inheritated from.
Definition object.h:51
The Kross scripting bridge to embed scripting functionality into an application.
Definition callable.h:31