~ubuntu-branches/ubuntu/trusty/kvirc/trusty

« back to all changes in this revision

Viewing changes to src/kvilib/file/KviFile.h

  • Committer: Bazaar Package Importer
  • Author(s): Kai Wasserbäch, Kai Wasserbäch, Raúl Sánchez Siles
  • Date: 2011-02-12 10:40:21 UTC
  • mfrom: (14.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110212104021-5mh4f75jlku20mnt
The combined "Twisted Experiment" and "Nocturnal Raid" release.

[ Kai Wasserbäch ]
* Synced to upstream's SVN revision 5467.
* debian/rules:
  - Added .PHONY line.
  - Resurrect -DMANUAL_REVISION, got lost somewhere and we build SVN
    revisions again.
  - Replace "-DWITH_NO_EMBEDDED_CODE=YES" with "-DWANT_CRYPTOPP=YES".
  - Change the remaining -DWITH/-DWITHOUT to the new -DWANT syntax.
* debian/control:
  - Removed DMUA, I'm a DD now.
  - Changed my e-mail address.
  - Removed unneeded relationships (no upgrades over two releases are
    supported).
  - Fix Suggests for kvirc-dbg.
  - kvirc-data: Make the "Suggests: kvirc" a Recommends, doesn't make much
    sense to install the -data package without the program.
* debian/source/local-options: Added with "unapply-patches".
* debian/kvirc.lintian-overrides: Updated to work for 4.1.1.
* debian/patches/21_make_shared-mime-info_B-D_superfluous.patch: Updated.
* debian/kvirc-data.install: Added .notifyrc.

[ Raúl Sánchez Siles ]
* Stating the right version where kvirc-data break and replace should happen.
* Fixing link to license file.
* Added French and Portuguese man pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 opinion) 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
 
 
28
/**
 
29
* \file KviFile.h
 
30
* \author Szymon Stefanek
 
31
* \brief This file handles file operations performed by KVIrc
 
32
*/
 
33
 
 
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
 
 
48
/**
 
49
* \class KviFile
 
50
* \brief KVIrc File class
 
51
*/
 
52
class KVILIB_API KviFile : public QFile, public KviHeapObject
 
53
{
 
54
public:
 
55
        /**
 
56
        * \brief Constructs file object
 
57
        * \return KviFile
 
58
        */
 
59
        KviFile();
 
60
        
 
61
        /**
 
62
        * \brief Constructs file object
 
63
        * \param szName The name of the file
 
64
        * \return KviFile
 
65
        */
 
66
        KviFile(const QString & szName);
 
67
        
 
68
        /**
 
69
        * \brief Destroys file object
 
70
        */
 
71
        ~KviFile();
 
72
public:
 
73
        /**
 
74
        * \brief Saves a file
 
75
        * \param file The file to save
 
76
        * \warning This function saves LITTLE ENDIAN DATA!
 
77
        * \return bool
 
78
        */
 
79
        bool save(kvi_u64_t file);
 
80
 
 
81
        /**
 
82
        * \brief Saves a file
 
83
        * \param file The file to save
 
84
        * \warning This function saves LITTLE ENDIAN DATA!
 
85
        * \return bool
 
86
        */
 
87
        bool save(kvi_i64_t file){ return save((kvi_u64_t)file); };
 
88
 
 
89
        /**
 
90
        * \brief Saves a file
 
91
        * \param file The file to save
 
92
        * \warning This function saves LITTLE ENDIAN DATA!
 
93
        * \return bool
 
94
        */
 
95
        bool save(kvi_u32_t file);
 
96
 
 
97
        /**
 
98
        * \brief Saves a file
 
99
        * \param file The file to save
 
100
        * \warning This function saves LITTLE ENDIAN DATA!
 
101
        * \return bool
 
102
        */
 
103
        bool save(kvi_i32_t file){ return save((kvi_u32_t)file); };
 
104
 
 
105
        /**
 
106
        * \brief Saves a file
 
107
        * \param file The file to save
 
108
        * \warning This function saves LITTLE ENDIAN DATA!
 
109
        * \return bool
 
110
        */
 
111
        bool save(kvi_u16_t file);
 
112
 
 
113
        /**
 
114
        * \brief Saves a file
 
115
        * \param file The file to save
 
116
        * \warning This function saves LITTLE ENDIAN DATA!
 
117
        * \return bool
 
118
        */
 
119
        bool save(kvi_i16_t file){ return save((kvi_u16_t)file); };
 
120
 
 
121
        /**
 
122
        * \brief Saves a file
 
123
        * \param file The file to save
 
124
        * \warning This function saves LITTLE ENDIAN DATA!
 
125
        * \return bool
 
126
        */
 
127
        bool save(kvi_u8_t file);
 
128
 
 
129
        /**
 
130
        * \brief Saves a file
 
131
        * \param file The file to save
 
132
        * \warning This function saves LITTLE ENDIAN DATA!
 
133
        * \return bool
 
134
        */
 
135
        bool save(kvi_i8_t file){ return save((kvi_u8_t)file); };
 
136
 
 
137
        /**
 
138
        * \brief Saves a file
 
139
        * \param szData The file to save
 
140
        * \warning This function saves LITTLE ENDIAN DATA!
 
141
        * \return bool
 
142
        */
 
143
        bool save(const KviCString & szData);
 
144
 
 
145
        /**
 
146
        * \brief Saves a file
 
147
        * \param data The file to save
 
148
        * \warning This function saves LITTLE ENDIAN DATA!
 
149
        * \return bool
 
150
        */
 
151
        bool save(const QByteArray & data);
 
152
 
 
153
        /**
 
154
        * \brief Saves a file
 
155
        * \param szData The file to save
 
156
        * \warning This function saves LITTLE ENDIAN DATA!
 
157
        * \return bool
 
158
        */
 
159
        bool save(const QString & szData);
 
160
 
 
161
        /**
 
162
        * \brief Saves a file to a list
 
163
        * \param pData The list where file to save is
 
164
        * \warning This function saves LITTLE ENDIAN DATA!
 
165
        * \return bool
 
166
        */
 
167
        bool save(KviPointerList<KviCString> * pData);
 
168
        
 
169
        /**
 
170
        * \brief Loads a file
 
171
        * \param file The file to load
 
172
        * \warning This function loads LITTLE ENDIAN DATA!
 
173
        * \return bool
 
174
        */
 
175
        bool load(kvi_u64_t & file);
 
176
 
 
177
        /**
 
178
        * \brief Loads a file
 
179
        * \param file The file to load
 
180
        * \warning This function loads LITTLE ENDIAN DATA!
 
181
        * \return bool
 
182
        */
 
183
        bool load(kvi_i64_t & file){ return load((kvi_u64_t &)file); };
 
184
 
 
185
        /**
 
186
        * \brief Loads a file
 
187
        * \param file The file to load
 
188
        * \warning This function loads LITTLE ENDIAN DATA!
 
189
        * \return bool
 
190
        */
 
191
        bool load(kvi_u32_t & file);
 
192
 
 
193
        /**
 
194
        * \brief Loads a file
 
195
        * \param file The file to load
 
196
        * \warning This function loads LITTLE ENDIAN DATA!
 
197
        * \return bool
 
198
        */
 
199
        bool load(kvi_i32_t & file){ return load((kvi_u32_t &)file); };
 
200
 
 
201
        /**
 
202
        * \brief Loads a file
 
203
        * \param file The file to load
 
204
        * \warning This function loads LITTLE ENDIAN DATA!
 
205
        * \return bool
 
206
        */
 
207
        bool load(kvi_u16_t & file);
 
208
 
 
209
        /**
 
210
        * \brief Loads a file
 
211
        * \param file The file to load
 
212
        * \warning This function loads LITTLE ENDIAN DATA!
 
213
        * \return bool
 
214
        */
 
215
        bool load(kvi_i16_t & file){ return load((kvi_u16_t &)file); };
 
216
 
 
217
        /**
 
218
        * \brief Loads a file
 
219
        * \param file The file to load
 
220
        * \warning This function loads LITTLE ENDIAN DATA!
 
221
        * \return bool
 
222
        */
 
223
        bool load(kvi_u8_t & file);
 
224
 
 
225
        /**
 
226
        * \brief Loads a file
 
227
        * \param file The file to load
 
228
        * \warning This function loads LITTLE ENDIAN DATA!
 
229
        * \return bool
 
230
        */
 
231
        bool load(kvi_i8_t & file){ return load((kvi_u8_t &)file); };
 
232
 
 
233
        /**
 
234
        * \brief Loads a file
 
235
        * \param szData The file to load
 
236
        * \warning This function loads LITTLE ENDIAN DATA!
 
237
        * \return bool
 
238
        */
 
239
        bool load(KviCString & szData);
 
240
 
 
241
        /**
 
242
        * \brief Loads a file
 
243
        * \param data The file to load
 
244
        * \warning This function loads LITTLE ENDIAN DATA!
 
245
        * \return bool
 
246
        */
 
247
        bool load(QByteArray & data);
 
248
 
 
249
        /**
 
250
        * \brief Loads a file
 
251
        * \param szData The file to load
 
252
        * \warning This function loads LITTLE ENDIAN DATA!
 
253
        * \return bool
 
254
        */
 
255
        bool load(QString & szData);
 
256
 
 
257
        /**
 
258
        * \brief Loads a file from a list
 
259
        * \param pData The list of files to load
 
260
        * \warning This function loads LITTLE ENDIAN DATA!
 
261
        * \return bool
 
262
        */
 
263
        bool load(KviPointerList<KviCString> * pData);
 
264
 
 
265
        /**
 
266
        * \brief Skips the first occurrence of the given char for a given dimension
 
267
        * \param t The char to find and skip
 
268
        * \param uMaxDist The dimension of the search field
 
269
        * \return bool
 
270
        */
 
271
        bool skipFirst(char t, unsigned int uMaxDist = 0xffffffff);
 
272
 
 
273
        /**
 
274
        * \brief Skips the first occurrence of the given string for a given dimension
 
275
        * \param szText The string to find and skip
 
276
        * \param uMaxDist The dimension of the search field
 
277
        * \return bool
 
278
        */
 
279
        bool skipFirst(const KviCString & szText, unsigned int uMaxDist = 0xffffffff);
 
280
};
 
281
 
 
282
#endif //_KVI_FILE_H_