Quark  0.1
ZipEntry.h++
Go to the documentation of this file.
1 #ifndef __libquark_zipfile_ZipEntry_hxx
2 #define __libquark_zipfile_ZipEntry_hxx
3 
4 #include <QDateTime>
5 #include <QString>
6 
7 namespace quark {
8 namespace zipfile {
9 
10 class ZipFile;
11 
17 class ZipEntry
18 {
19  friend class ZipFile;
20 
21  public:
22 
24  ZipEntry();
25 
27  virtual ~ZipEntry();
28 
30  qint64 index() const
31  { return(_index); }
32 
34  QString path() const
35  { return(_path); }
36 
38  bool isDirectory() const;
39 
41  qint64 size() const
42  { return(_size); }
43 
45  qint64 compressedSize() const
46  { return(_compressedSize); }
47 
49  QDateTime modificationTime() const
50  { return(_modificationTime); }
51 
53  quint32 crc() const
54  { return(_crc); }
55 
57  quint16 compressionMethod() const
58  { return(_compressionMethod); }
59 
61  quint16 encryptionMethod() const
62  { return(_encryptionMethod); }
63 
65  bool isValid() const;
66 
67  private:
68 
69  void clear();
70 
71  void setIndex(qint64 index)
72  { _index = index; }
73 
74  void setPath(const QString &path)
75  { _path = path; }
76 
77  void setSize(const qint64 &size)
78  { _size = size; }
79 
80  void setCompressedSize(const qint64 &compressedSize)
81  { _compressedSize = compressedSize; }
82 
83  void setModificationTime(const QDateTime &modificationTime)
84  { _modificationTime = modificationTime; }
85 
86  void setCrc(qint32 crc)
87  { _crc = crc; }
88 
89  void setCompressionMethod(quint16 compressionMethod)
90  { _compressionMethod = compressionMethod; }
91 
92  void setEncryptionMethod(quint16 encryptionMethod)
93  { _encryptionMethod = _encryptionMethod; }
94 
95  qint64 _index;
96  QString _path;
97  qint64 _size;
98  qint64 _compressedSize;
99  QDateTime _modificationTime;
100  quint32 _crc;
101  quint16 _compressionMethod;
102  quint16 _encryptionMethod;
103 };
104 
105 } // namespace zipfile
106 } // namespace quark
107 
108 #endif // __libquark_zipfile_ZipEntry_hxx
ZipEntry()
Constructor.
bool isDirectory() const
Tests if the entry represents a directory.
qint64 compressedSize() const
Returns the compressed file size.
Definition: ZipEntry.h++:45
QDateTime modificationTime() const
Returns the file&#39;s last modification time.
Definition: ZipEntry.h++:49
Definition: BarChartView.h++:6
quint16 compressionMethod() const
Returns the compression method for the entry.
Definition: ZipEntry.h++:57
A class representing a Zip archive.
Definition: ZipFile.h++:19
qint64 size() const
Returns the uncompressed file size.
Definition: ZipEntry.h++:41
quint16 encryptionMethod() const
Returns the encryption method for the entry.
Definition: ZipEntry.h++:61
QString path() const
Returns the file path of the entry.
Definition: ZipEntry.h++:34
bool isValid() const
Tests if this entry is valid.
A class representing an entry in a Zip archive.
Definition: ZipEntry.h++:17
virtual ~ZipEntry()
Destructor.
qint64 index() const
Returns the index of the entry within the archive.
Definition: ZipEntry.h++:30
quint32 crc() const
Returns the CRC for the data in the entry.
Definition: ZipEntry.h++:53