• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Kross

  • sources
  • kde-4.12
  • kdelibs
  • kross
  • core
errorinterface.h
Go to the documentation of this file.
1 /***************************************************************************
2  * errorinterface.h
3  * This file is part of the KDE project
4  * copyright (C)2004-2006 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_ERRORINTERFACE_H
21 #define KROSS_ERRORINTERFACE_H
22 
23 #include "krossconfig.h"
24 
25 #include <QtCore/QString>
26 
27 namespace Kross {
28 
32  class KROSSCORE_EXPORT ErrorInterface
33  {
34  public:
35 
43  ErrorInterface() {}
44 
48  bool hadError() const { return ! m_error.isNull(); }
49 
53  const QString errorMessage() const { return m_error; }
54 
58  const QString errorTrace() const { return m_trace; }
59 
64  long errorLineNo() const { return m_lineno; }
65 
69  void setError(const QString& errormessage, const QString& tracemessage = QString(), long lineno = -1) {
70  m_error = errormessage;
71  m_trace = tracemessage;
72  m_lineno = lineno;
73  krosswarning( QString::fromLatin1("Error error=%1 lineno=%2 trace=\n%3").arg(m_error).arg(m_lineno).arg(m_trace) );
74  }
75 
79  void setError(ErrorInterface* error) {
80  m_error = error->errorMessage();
81  m_trace = error->errorTrace();
82  m_lineno = error->errorLineNo();
83  }
84 
88  void clearError() {
89  m_error.clear();
90  m_trace.clear();
91  m_lineno = -1;
92  }
93 
94  private:
96  QString m_error;
98  QString m_trace;
100  long m_lineno;
101  };
102 
103 }
104 
105 #endif
106 
Kross::ErrorInterface::hadError
bool hadError() const
Definition: errorinterface.h:48
Kross::ErrorInterface
Interface for error-handling.
Definition: errorinterface.h:32
Kross::ErrorInterface::ErrorInterface
ErrorInterface()
Constructor.
Definition: errorinterface.h:43
QString
Kross::ErrorInterface::errorMessage
const QString errorMessage() const
Definition: errorinterface.h:53
Kross::ErrorInterface::errorTrace
const QString errorTrace() const
Definition: errorinterface.h:58
Kross::ErrorInterface::clearError
void clearError()
Clear the error.
Definition: errorinterface.h:88
Kross::krosswarning
void krosswarning(const QString &s)
Warning function.
Definition: krossconfig.cpp:34
Kross::ErrorInterface::errorLineNo
long errorLineNo() const
Definition: errorinterface.h:64
Kross::ErrorInterface::setError
void setError(const QString &errormessage, const QString &tracemessage=QString(), long lineno=-1)
Set the error message.
Definition: errorinterface.h:69
krossconfig.h
Kross::ErrorInterface::setError
void setError(ErrorInterface *error)
Set the error message.
Definition: errorinterface.h:79
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kross

Skip menu "Kross"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal