KVIrc  4.9.2
DeveloperAPIs
KviPackageWriter.h
Go to the documentation of this file.
1 #ifndef _KviPackageWriter_h_
2 #define _KviPackageWriter_h_
3 //=============================================================================
4 //
5 // File : KviPackageWriter.h
6 // Creation date : Tue 26 Dec 2006 05:33:33 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC Client distribution
9 // Copyright (C) 2006-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 
33 #include "kvi_settings.h"
34 
35 #include "KviQString.h"
36 #include "KviPackageIOEngine.h"
37 
38 #include <QByteArray>
39 
40 class QFileInfo;
41 class KviFile;
42 
45 
54 {
55 public:
61 
65  virtual ~KviPackageWriter();
66 
67 private:
72 
73 public:
78  {
79  NoCompression = 1,
80  FollowSymLinks = 2
81  };
82 
86  enum PackFlags
87  {
88  NoProgressDialog = 1
89  };
90 
103  bool addFile(const QString & szLocalFileName, const QString & szTargetFileName, kvi_u32_t uAddFileFlags = 0);
104 
112  bool addDirectory(const QString & szLocalDirectoryName, const QString & szTargetDirectoryPrefix, kvi_u32_t uAddFileFlags = 0);
113 
120  void addInfoField(const QString & szName, const QString & szValue);
121 
128  void addInfoField(const QString & szName, QByteArray * pArray);
129 
141  bool pack(const QString & szFileName, kvi_u32_t uPackFlags = 0);
142 
143 private:
152  bool packInternal(const QString & szFileName, kvi_u32_t uPackFlags = 0);
153 
162  bool packFile(KviFile * pFile, KviPackageWriterDataField * pDataField);
163 
174  bool addFileInternal(const QFileInfo * fi, const QString & szLocalFileName, const QString & szTargetFileName, kvi_u32_t uAddFileFlags = 0);
175 
176 }; // class KviPackageWriter
177 
178 #endif //_KviPackageWriter_h_
Definition: KviPackageWriter.cpp:44
bool pack(AddonInfo &info, QString &szError)
Definition: AddonFunctions.cpp:294
KVIrc File class.
Definition: KviFile.h:52
File packaging utilities.
KviKvsArray * pArray
Definition: libkviserverdb.cpp:476
PackFlags
Definition: KviPackageWriter.h:86
This class is used to create KVIrc package files.
Definition: KviPackageWriter.h:53
Definition: KviPackageWriter.cpp:56
AddFileFlags
Definition: KviPackageWriter.h:77
KviPackageWriterPrivate * m_p
Definition: KviPackageWriter.h:71
This file contains compile time settings.
This class is the base class engine to work with KVIrc package files.
Definition: KviPackageIOEngine.h:53
#define KVILIB_API
Definition: kvi_settings.h:125
Helper functions for the QString class.