KVIrc  4.9.2
DeveloperAPIs
KviFile.h
Go to the documentation of this file.
1 #ifndef _KVI_FILE_H_
2 #define _KVI_FILE_H_
3 
4 //=============================================================================
5 //
6 // File : KviFile.h
7 // Creation date : Mon Dec 17 2001 00:05:04 by Szymon Stefanek
8 //
9 // This file is part of the KVIrc IRC client distribution
10 // Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
11 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
34 #include "kvi_settings.h"
35 #include "KviHeapObject.h"
36 #include "KviCString.h"
37 #include "KviPointerList.h"
38 #include "kvi_inttypes.h"
39 
40 #include <QFile>
41 
42 #include <time.h>
43 
44 class QByteArray;
45 
46 #define kvi_file_offset_t qlonglong
47 
52 class KVILIB_API KviFile : public QFile, public KviHeapObject
53 {
54 public:
59  KviFile();
60 
66  KviFile(const QString & szName);
67 
71  ~KviFile();
72 
73 public:
80  bool save(kvi_u64_t file);
81 
88  bool save(kvi_i64_t file) { return save((kvi_u64_t)file); };
89 
96  bool save(kvi_u32_t file);
97 
104  bool save(kvi_i32_t file) { return save((kvi_u32_t)file); };
105 
112  bool save(kvi_u16_t file);
113 
120  bool save(kvi_i16_t file) { return save((kvi_u16_t)file); };
121 
128  bool save(kvi_u8_t file);
129 
136  bool save(kvi_i8_t file) { return save((kvi_u8_t)file); };
137 
144  bool save(const KviCString & szData);
145 
152  bool save(const QByteArray & data);
153 
160  bool save(const QString & szData);
161 
168  bool save(KviPointerList<KviCString> * pData);
169 
176  bool load(kvi_u64_t & file);
177 
184  bool load(kvi_i64_t & file) { return load((kvi_u64_t &)file); };
185 
192  bool load(kvi_u32_t & file);
193 
200  bool load(kvi_i32_t & file) { return load((kvi_u32_t &)file); };
201 
208  bool load(kvi_u16_t & file);
209 
216  bool load(kvi_i16_t & file) { return load((kvi_u16_t &)file); };
217 
224  bool load(kvi_u8_t & file);
225 
232  bool load(kvi_i8_t & file) { return load((kvi_u8_t &)file); };
233 
240  bool load(KviCString & szData);
241 
248  bool load(QByteArray & data);
249 
256  bool load(QString & szData);
257 
264  bool load(KviPointerList<KviCString> * pData);
265 
272  bool skipFirst(char t, unsigned int uMaxDist = 0xffffffff);
273 
280  bool skipFirst(const KviCString & szText, unsigned int uMaxDist = 0xffffffff);
281 };
282 
283 #endif //_KVI_FILE_H_
Definition: KviHeapObject.h:124
Definition: KviCString.h:105
bool load(kvi_i16_t &file)
Loads a file.
Definition: KviFile.h:216
bool load(kvi_i8_t &file)
Loads a file.
Definition: KviFile.h:232
KVIrc File class.
Definition: KviFile.h:52
char kvi_i8_t
Definition: kvi_inttypes.h:99
unsigned long long int kvi_u64_t
Definition: kvi_inttypes.h:66
unsigned char kvi_u8_t
Definition: kvi_inttypes.h:100
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
bool load(kvi_i32_t &file)
Loads a file.
Definition: KviFile.h:200
bool save(kvi_i16_t file)
Saves a file.
Definition: KviFile.h:120
bool load(kvi_i64_t &file)
Loads a file.
Definition: KviFile.h:184
bool save(kvi_i64_t file)
Saves a file.
Definition: KviFile.h:88
QHashIterator< int, QFile * > t(getDict)
C++ Template based double linked pointer list class.
Heap Object.
long long int kvi_i64_t
SYSTEM_SIZE_OF_SHORT_INT.
Definition: kvi_inttypes.h:65
bool save(kvi_i32_t file)
Saves a file.
Definition: KviFile.h:104
bool save(kvi_i8_t file)
Saves a file.
Definition: KviFile.h:136
This file contains compile time settings.
#define KVILIB_API
Definition: kvi_settings.h:125