KVIrc  4.9.2
DeveloperAPIs
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 
37 class QString;
38 
44 typedef struct _LogFileData
45 {
46  QString szName;
47  QString szType;
48  QString szFile;
49 } LogFileData;
50 
61 class LogFile
62 {
63 public:
68  enum Type
69  {
70  Channel = 0,
71  Console = 1,
72  Query = 2,
73  DccChat = 3,
74  Other = 4
75  };
76 
82  {
85  //XML /**< export log in a XML file */
86  //DB /**< export log in a database file */
87  };
88 
94  LogFile(const QString & szName);
95 
96 private:
98  QString m_szType;
99  QString m_szFilename;
101  QString m_szName;
102  QString m_szNetwork;
103  QDate m_date;
104 
105 public:
110  Type type() const { return m_eType; };
111 
116  const QString & typeString() const { return m_szType; };
117 
122  const QString & fileName() const { return m_szFilename; };
123 
128  const QString & name() const { return m_szName; };
129 
134  const QString & network() const { return m_szNetwork; };
135 
140  const QDate & date() const { return m_date; };
141 
147  void getText(QString & szText);
148 };
149 
150 #endif // _LOGFILE_H_
QString m_szFilename
Definition: LogFile.h:99
const QDate & date() const
Returns the date of the log.
Definition: LogFile.h:140
Type
Holds the type of the log file.
Definition: LogFile.h:68
QString m_szType
Definition: LogFile.h:98
bool m_bCompressed
Definition: LogFile.h:100
LogFile(const QString &szName)
Constructs the log file object.
Definition: LogFile.cpp:38
Definition: LogFile.h:73
QString szFile
Definition: LogFile.h:48
QString szName
Definition: LogFile.h:46
struct _LogFileData LogFileData
Definition: LogFile.h:37
The LogFile class which handle any log file.
Definition: LogFile.h:61
Type m_eType
Definition: LogFile.h:97
const QString & typeString() const
Returns the type of the log.
Definition: LogFile.h:116
A struct that contains the data of a log.
Definition: LogFile.h:44
Definition: LogFile.h:84
Definition: LogFile.h:71
QDate m_date
Definition: LogFile.h:103
const QString & name() const
Returns the name of the log.
Definition: LogFile.h:128
Type type() const
Returns the type of the log.
Definition: LogFile.h:110
Definition: LogFile.h:70
void getText(QString &szText)
Returns the text of the log file.
Definition: LogFile.cpp:146
QString szType
Definition: LogFile.h:47
QString m_szName
Definition: LogFile.h:101
ExportType
Holds the type of the exported log file.
Definition: LogFile.h:81
Definition: LogFile.h:74
Definition: LogFile.h:83
Definition: LogFile.h:72
const QString & fileName() const
Returns the filename of the log.
Definition: LogFile.h:122
const QString & network() const
Returns the network of the log.
Definition: LogFile.h:134
QString m_szNetwork
Definition: LogFile.h:102