lib

script.cpp
1/***************************************************************************
2 * script.cpp
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#include "script.h"
21#include "object.h"
22#include "list.h"
23#include "interpreter.h"
24#include "exception.h"
25#include "../main/scriptcontainer.h"
26
27using namespace Kross::Api;
28
29Script::Script(Interpreter* const interpreter, ScriptContainer* const scriptcontainer)
30 : m_interpreter(interpreter)
31 , m_scriptcontainer(scriptcontainer)
32 , m_exception(0)
33{
34}
35
39
41{
42 return m_exception != 0;
43}
44
46{
47 return m_exception;
48}
49
51{
52 m_exception = e;
53}
54
56{
57 m_exception = 0;
58}
59
TDESharedPtr< Exception > Ptr
Shared pointer to implement reference-counting.
Definition exception.h:45
Base class for interpreters.
The ScriptContainer class is something like a single standalone scriptfile.
bool hadException()
Definition script.cpp:40
Interpreter *const m_interpreter
The Interpreter used to create this Script instance.
Definition script.h:128
Script(Interpreter *const interpreter, ScriptContainer *const scriptcontainer)
Constructor.
Definition script.cpp:29
void setException(Exception::Ptr e)
Set a new exception this script throwed.
Definition script.cpp:50
virtual ~Script()
Destructor.
Definition script.cpp:36
void clearException()
Clear previous exceptions.
Definition script.cpp:55
Exception::Ptr getException()
Definition script.cpp:45
ScriptContainer *const m_scriptcontainer
The ScriptContainer associated with this Script.
Definition script.h:130
The common Kross API used as common codebase.
Definition callable.h:31