Qt 4.8
Public Functions | Public Variables | List of all members
QZipPrivate Class Reference
Inheritance diagram for QZipPrivate:
QZipReaderPrivate QZipWriterPrivate

Public Functions

void fillFileInfo (int index, QZipReader::FileInfo &fileInfo) const
 
 QZipPrivate (QIODevice *device, bool ownDev)
 
 ~QZipPrivate ()
 

Public Variables

QByteArray comment
 
QIODevicedevice
 
bool dirtyFileTree
 
QList< FileHeaderfileHeaders
 
bool ownDevice
 
uint start_of_directory
 

Detailed Description

Definition at line 392 of file qzip.cpp.

Constructors and Destructors

◆ QZipPrivate()

QZipPrivate::QZipPrivate ( QIODevice device,
bool  ownDev 
)
inline

Definition at line 395 of file qzip.cpp.

396  : device(device), ownDevice(ownDev), dirtyFileTree(true), start_of_directory(0)
397  {
398  }
bool ownDevice
Definition: qzip.cpp:409
QIODevice * device
Definition: qzip.cpp:408
bool dirtyFileTree
Definition: qzip.cpp:410
uint start_of_directory
Definition: qzip.cpp:413

◆ ~QZipPrivate()

QZipPrivate::~QZipPrivate ( )
inline

Definition at line 400 of file qzip.cpp.

401  {
402  if (ownDevice)
403  delete device;
404  }
bool ownDevice
Definition: qzip.cpp:409
QIODevice * device
Definition: qzip.cpp:408

Functions

◆ fillFileInfo()

void QZipPrivate::fillFileInfo ( int  index,
QZipReader::FileInfo fileInfo 
) const

Definition at line 416 of file qzip.cpp.

Referenced by QZipReader::entryInfoAt(), and QZipReader::fileInfoList().

417 {
418  FileHeader header = fileHeaders.at(index);
419  fileInfo.filePath = QString::fromLocal8Bit(header.file_name);
420  const quint32 mode = (qFromLittleEndian<quint32>(&header.h.external_file_attributes[0]) >> 16) & 0xFFFF;
421  fileInfo.isDir = S_ISDIR(mode);
422  fileInfo.isFile = S_ISREG(mode);
423  fileInfo.isSymLink = S_ISLNK(mode);
424  fileInfo.permissions = modeToPermissions(mode);
425  fileInfo.crc32 = readUInt(header.h.crc_32);
426  fileInfo.size = readUInt(header.h.uncompressed_size);
427  fileInfo.lastModified = readMSDosDate(header.h.last_mod_file);
428 }
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
Definition: qstring.cpp:4245
uchar crc_32[4]
Definition: qzip.cpp:327
uchar external_file_attributes[4]
Definition: qzip.cpp:335
uchar last_mod_file[4]
Definition: qzip.cpp:326
uint isFile
A boolean type, if it is one this entry is a file.
Definition: qzipreader_p.h:88
QDateTime lastModified
Definition: qzipreader_p.h:93
QString filePath
The full filepath inside the archive.
Definition: qzipreader_p.h:86
static uint readUInt(const uchar *data)
Definition: qzip.cpp:95
QFile::Permissions permissions
Definition: qzipreader_p.h:90
CentralFileHeader h
Definition: qzip.cpp:354
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
quint32 qFromLittleEndian< quint32 >(const uchar *src)
Definition: qendian.h:148
qint64 size
The total size of the unpacked content.
Definition: qzipreader_p.h:92
uchar uncompressed_size[4]
Definition: qzip.cpp:329
#define S_ISREG(x)
Definition: qzip.cpp:66
uint isSymLink
A boolean type, if it is one this entry is symbolic link.
Definition: qzipreader_p.h:89
static QFile::Permissions modeToPermissions(quint32 mode)
Definition: qzip.cpp:253
QList< FileHeader > fileHeaders
Definition: qzip.cpp:411
uint crc32
The calculated checksum as a crc32 type.
Definition: qzipreader_p.h:91
QByteArray file_name
Definition: qzip.cpp:355
#define S_ISDIR(x)
Definition: qzip.cpp:63
unsigned int quint32
Definition: qglobal.h:938
static QDateTime readMSDosDate(const uchar *src)
Definition: qzip.cpp:283
quint16 index
uint isDir
A boolean type indicating if the entry is a directory.
Definition: qzipreader_p.h:87
#define S_ISLNK(x)
Definition: qzip.cpp:69

Properties

◆ comment

QByteArray QZipPrivate::comment

Definition at line 412 of file qzip.cpp.

Referenced by QZipWriter::close().

◆ device

QIODevice* QZipPrivate::device

◆ dirtyFileTree

bool QZipPrivate::dirtyFileTree

Definition at line 410 of file qzip.cpp.

◆ fileHeaders

QList<FileHeader> QZipPrivate::fileHeaders

◆ ownDevice

bool QZipPrivate::ownDevice

Definition at line 409 of file qzip.cpp.

◆ start_of_directory

uint QZipPrivate::start_of_directory

Definition at line 413 of file qzip.cpp.

Referenced by QZipWriter::close().


The documentation for this class was generated from the following file: