KVIrc 5.2.0
Developer APIs
KviKvsReport.h
Go to the documentation of this file.
1#ifndef _KVI_KVS_REPORT_H_
2#define _KVI_KVS_REPORT_H_
3//=============================================================================
4//
5// File : KviKvsReport.h
6// Creation date : Thu 25 Sep 2003 05.12 CEST by Szymon Stefanek
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2003-2010 Szymon Stefanek (pragma at kvirc dot net)
10//
11// This program is FREE software. You can redistribute it and/or
12// modify it under the terms of the GNU General Public License
13// as published by the Free Software Foundation; either version 2
14// of the License, or (at your option) any later version.
15//
16// This program is distributed in the HOPE that it will be USEFUL,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19// See the GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program. If not, write to the Free Software Foundation,
23// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24//
25//=============================================================================
26
27#include "kvi_settings.h"
28#include "KviQString.h"
29#include "KviPointerList.h"
30
31class KviWindow;
32
34{
35public:
36 enum Type
37 {
41 ParserWarning
42 };
43
44public:
45 KviKvsReport(Type t, QString szContext, QString szMessage, QString szLocation, KviWindow * pWindow);
47
48protected:
50
51 // mandatory
52 QString m_szContext; // context name (script name, usually)
53 QString m_szMessage; // report message, always present
54 QString m_szLocation; // line and col description (may be some thing like "at end of input")
55
56 KviWindow * m_pWindow; // the window that the script was attacched to
57
58 // optional
59 KviPointerList<QString> * m_pCodeListing; // code listing, if present, it is owned
60 KviPointerList<QString> * m_pCallStack; // call stack, if present, it is owned
61public:
62 Type type() const { return m_eType; };
63
64 KviWindow * window() { return m_pWindow; };
65 const QString & context() { return m_szContext; };
66 const QString & message() { return m_szMessage; };
67 const QString & location() { return m_szLocation; };
68 KviPointerList<QString> * codeListing() { return m_pCodeListing; };
69 KviPointerList<QString> * callStack() { return m_pCallStack; };
70
71 void setContext(const QString & szContext) { m_szContext = szContext; };
72 void setMessage(const QString & szMessage) { m_szMessage = szMessage; };
73 void setLocation(const QString & szLocation) { m_szLocation = szLocation; };
74 void setCodeListing(KviPointerList<QString> * pListing) { m_pCodeListing = pListing; };
75 void setCallStack(KviPointerList<QString> * pStack) { m_pCallStack = pStack; };
76
77 static void findLineAndCol(const QChar * pBegin, const QChar * pPoint, int & iLine, int & iCol);
78 static void findLineColAndListing(const QChar * pBegin, const QChar * pPoint, int & iLine, int & iCol, KviPointerList<QString> * pListing);
79
80 static void report(KviKvsReport * r, KviWindow * pOutput);
81};
82
83#endif
const QChar * pBegin
Definition KviKvsParser.cpp:3227
C++ Template based double linked pointer list class.
Helper functions for the QString class.
Definition KviKvsReport.h:34
KviPointerList< QString > * callStack()
Definition KviKvsReport.h:69
QString m_szMessage
Definition KviKvsReport.h:53
Type type() const
Definition KviKvsReport.h:62
KviWindow * window()
Definition KviKvsReport.h:64
const QString & location()
Definition KviKvsReport.h:67
KviPointerList< QString > * codeListing()
Definition KviKvsReport.h:68
KviPointerList< QString > * m_pCallStack
Definition KviKvsReport.h:60
QString m_szLocation
Definition KviKvsReport.h:54
void setContext(const QString &szContext)
Definition KviKvsReport.h:71
void setCallStack(KviPointerList< QString > *pStack)
Definition KviKvsReport.h:75
const QString & context()
Definition KviKvsReport.h:65
const QString & message()
Definition KviKvsReport.h:66
Type m_eType
Definition KviKvsReport.h:49
Type
Definition KviKvsReport.h:37
@ RunTimeWarning
Definition KviKvsReport.h:39
@ RunTimeError
Definition KviKvsReport.h:38
@ ParserError
Definition KviKvsReport.h:40
KviPointerList< QString > * m_pCodeListing
Definition KviKvsReport.h:59
QString m_szContext
Definition KviKvsReport.h:52
void setMessage(const QString &szMessage)
Definition KviKvsReport.h:72
void setLocation(const QString &szLocation)
Definition KviKvsReport.h:73
KviWindow * m_pWindow
Definition KviKvsReport.h:56
void setCodeListing(KviPointerList< QString > *pListing)
Definition KviKvsReport.h:74
A template double linked list of pointers.
Definition KviPointerList.h:371
Base class for all windows in KVIrc.
Definition KviWindow.h:75
#define t
Definition detector.cpp:85
#define r
Definition detector.cpp:83
This file contains compile time settings.
#define KVIRC_API
Definition kvi_settings.h:127