KVIrc 5.2.4
Developer APIs
LogFile.h
Go to the documentation of this file.
1#ifndef _LOGFILE_H_
2#define _LOGFILE_H_
3//=============================================================================
4//
5// File : LogFile.h
6// Creation date : Thu Apr 14 2011 19:16:59 by Elvio Basello
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2011 Elvio Basello (hellvis69 at gmail dot com)
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
35#include <QDate>
36
37class QString;
38
44{
45 QString szName;
46 QString szType;
47 QString szFile;
48};
49
61{
62public:
67 enum Type
68 {
69 Channel = 0,
70 Console = 1,
71 Query = 2,
72 DccChat = 3,
73 Other = 4
74 };
75
81 {
83 HTML
84 //XML /**< export log in a XML file */
85 //DB /**< export log in a database file */
86 };
87
93 LogFile(const QString & szName);
94
95private:
97 QString m_szType;
98 QString m_szFilename;
100 QString m_szName;
101 QString m_szNetwork;
102 QDate m_date;
103
104public:
109 Type type() const { return m_eType; };
110
115 const QString & typeString() const { return m_szType; };
116
121 const QString & fileName() const { return m_szFilename; };
122
127 const QString & name() const { return m_szName; };
128
133 const QString & network() const { return m_szNetwork; };
134
139 const QDate & date() const { return m_date; };
140
146 void getText(QString & szText) const;
147
155 void createLog(ExportType exportType, QString szLog, QString * pszFile = nullptr) const;
156};
157
158#endif // _LOGFILE_H_
The LogFile class which handle any log file.
Definition LogFile.h:61
Type
Holds the type of the log file.
Definition LogFile.h:68
@ Other
Definition LogFile.h:73
@ Console
Definition LogFile.h:70
@ Channel
Definition LogFile.h:69
@ DccChat
Definition LogFile.h:72
@ Query
Definition LogFile.h:71
Type type() const
Returns the type of the log.
Definition LogFile.h:109
const QDate & date() const
Returns the date of the log.
Definition LogFile.h:139
bool m_bCompressed
Definition LogFile.h:99
Type m_eType
Definition LogFile.h:96
QString m_szType
Definition LogFile.h:97
QString m_szName
Definition LogFile.h:100
const QString & typeString() const
Returns the type of the log.
Definition LogFile.h:115
void getText(QString &szText) const
Returns the text of the log file.
Definition LogFile.cpp:161
const QString & fileName() const
Returns the filename of the log.
Definition LogFile.h:121
const QString & name() const
Returns the name of the log.
Definition LogFile.h:127
QString m_szNetwork
Definition LogFile.h:101
void createLog(ExportType exportType, QString szLog, QString *pszFile=nullptr) const
Exports the log and creates the file in the selected format.
Definition LogFile.cpp:207
const QString & network() const
Returns the network of the log.
Definition LogFile.h:133
QDate m_date
Definition LogFile.h:102
QString m_szFilename
Definition LogFile.h:98
ExportType
Holds the type of the exported log file.
Definition LogFile.h:81
@ PlainText
Definition LogFile.h:82
@ HTML
Definition LogFile.h:83
Definition LogFile.h:44
QString szType
Definition LogFile.h:46
QString szFile
Definition LogFile.h:47
QString szName
Definition LogFile.h:45