ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
QuaZipFilePrivate Class Reference

The implementation class for QuaZip. More...

+ Collaboration diagram for QuaZipFilePrivate:

Private Member Functions

void resetZipError () const
 Resets zipError. More...
 
void setZipError (int zipError) const
 Sets the zip error. More...
 
 QuaZipFilePrivate (QuaZipFile *q)
 The constructor for the corresponding QuaZipFile constructor. More...
 
 QuaZipFilePrivate (QuaZipFile *q, const QString &zipName)
 The constructor for the corresponding QuaZipFile constructor. More...
 
 QuaZipFilePrivate (QuaZipFile *q, const QString &zipName, const QString &fileName, QuaZip::CaseSensitivity cs)
 The constructor for the corresponding QuaZipFile constructor. More...
 
 QuaZipFilePrivate (QuaZipFile *q, QuaZip *zip)
 The constructor for the QuaZipFile constructor accepting a file name. More...
 
 ~QuaZipFilePrivate ()
 The destructor. More...
 

Private Attributes

QuaZipFileq
 The pointer to the associated QuaZipFile instance. More...
 
QuaZipzip
 The QuaZip object to work with. More...
 
QString fileName
 The file name. More...
 
QuaZip::CaseSensitivity caseSensitivity
 Case sensitivity mode. More...
 
bool raw
 Whether this file is opened in the raw mode. More...
 
qint64 writePos
 Write position to keep track of. More...
 
quint64 uncompressedSize
 Uncompressed size to write along with a raw file. More...
 
quint32 crc
 CRC to write along with a raw file. More...
 
bool internal
 Whether zip points to an internal QuaZip instance. More...
 
int zipError
 The last error. More...
 

Friends

class QuaZipFile
 

Detailed Description

This class contains all the private stuff for the QuaZipFile class, thus allowing to preserve binary compatibility between releases, the technique known as the Pimpl (private implementation) idiom.

Definition at line 37 of file quazipfile.cpp.

Constructor & Destructor Documentation

QuaZipFilePrivate::QuaZipFilePrivate ( QuaZipFile q)
inlineprivate

Definition at line 78 of file quazipfile.cpp.

78  :
79  q(q), zip(NULL), internal(true), zipError(UNZ_OK) {}
int zipError
The last error.
Definition: quazipfile.cpp:67
QuaZipFile * q
The pointer to the associated QuaZipFile instance.
Definition: quazipfile.cpp:41
#define UNZ_OK
Definition: unzip.h:79
QuaZip * zip
The QuaZip object to work with.
Definition: quazipfile.cpp:43
QuaZipFilePrivate::QuaZipFilePrivate ( QuaZipFile q,
const QString &  zipName 
)
inlineprivate

Definition at line 81 of file quazipfile.cpp.

81  :
82  q(q), internal(true), zipError(UNZ_OK)
83  {
84  zip=new QuaZip(zipName);
85  }
int zipError
The last error.
Definition: quazipfile.cpp:67
QuaZipFile * q
The pointer to the associated QuaZipFile instance.
Definition: quazipfile.cpp:41
#define UNZ_OK
Definition: unzip.h:79
ZIP archive.
Definition: quazip.h:84
QuaZip * zip
The QuaZip object to work with.
Definition: quazipfile.cpp:43
QuaZipFilePrivate::QuaZipFilePrivate ( QuaZipFile q,
const QString &  zipName,
const QString &  fileName,
QuaZip::CaseSensitivity  cs 
)
inlineprivate

Definition at line 87 of file quazipfile.cpp.

88  :
89  q(q), internal(true), zipError(UNZ_OK)
90  {
91  zip=new QuaZip(zipName);
92  this->fileName=fileName;
93  if (this->fileName.startsWith('/'))
94  this->fileName = this->fileName.mid(1);
95  this->caseSensitivity=cs;
96  }
int zipError
The last error.
Definition: quazipfile.cpp:67
QuaZipFile * q
The pointer to the associated QuaZipFile instance.
Definition: quazipfile.cpp:41
#define UNZ_OK
Definition: unzip.h:79
QString fileName
The file name.
Definition: quazipfile.cpp:45
QuaZip::CaseSensitivity caseSensitivity
Case sensitivity mode.
Definition: quazipfile.cpp:47
ZIP archive.
Definition: quazip.h:84
QuaZip * zip
The QuaZip object to work with.
Definition: quazipfile.cpp:43
QuaZipFilePrivate::QuaZipFilePrivate ( QuaZipFile q,
QuaZip zip 
)
inlineprivate

Definition at line 98 of file quazipfile.cpp.

98  :
99  q(q), zip(zip), internal(false), zipError(UNZ_OK) {}
int zipError
The last error.
Definition: quazipfile.cpp:67
QuaZipFile * q
The pointer to the associated QuaZipFile instance.
Definition: quazipfile.cpp:41
#define UNZ_OK
Definition: unzip.h:79
QuaZip * zip
The QuaZip object to work with.
Definition: quazipfile.cpp:43
QuaZipFilePrivate::~QuaZipFilePrivate ( )
inlineprivate

Definition at line 101 of file quazipfile.cpp.

102  {
103  if (internal)
104  delete zip;
105  }
QuaZip * zip
The QuaZip object to work with.
Definition: quazipfile.cpp:43

Member Function Documentation

void QuaZipFilePrivate::resetZipError ( ) const
inlineprivate

Definition at line 69 of file quazipfile.cpp.

References UNZ_OK.

Referenced by QuaZipFile::close(), and QuaZipFile::open().

#define UNZ_OK
Definition: unzip.h:79
void setZipError(int zipError) const
Sets the zip error.
Definition: quazipfile.cpp:211

+ Here is the caller graph for this function:

void QuaZipFilePrivate::setZipError ( int  zipError) const
private

This function is marked as const although it changes one field. This allows to call it from const functions that don't change anything by themselves.

Definition at line 211 of file quazipfile.cpp.

References q, UNZ_OK, and zipError.

Referenced by QuaZipFile::close(), QuaZipFile::csize(), QuaZipFile::getActualFileName(), QuaZipFile::getFileInfo(), QuaZipFile::open(), QuaZipFile::readData(), QuaZipFile::usize(), and QuaZipFile::writeData().

212 {
213  QuaZipFilePrivate *fakeThis = const_cast<QuaZipFilePrivate*>(this); // non-const
214  fakeThis->zipError=zipError;
215  if(zipError==UNZ_OK)
216  q->setErrorString(QString());
217  else
218  q->setErrorString(QuaZipFile::tr("ZIP/UNZIP API error %1").arg(zipError));
219 }
int zipError
The last error.
Definition: quazipfile.cpp:67
QuaZipFile * q
The pointer to the associated QuaZipFile instance.
Definition: quazipfile.cpp:41
#define UNZ_OK
Definition: unzip.h:79
The implementation class for QuaZip.
Definition: quazipfile.cpp:37

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class QuaZipFile
friend

Definition at line 38 of file quazipfile.cpp.

Field Documentation

QuaZip::CaseSensitivity QuaZipFilePrivate::caseSensitivity
private
quint32 QuaZipFilePrivate::crc
private

Definition at line 59 of file quazipfile.cpp.

Referenced by QuaZipFile::close(), and QuaZipFile::open().

QString QuaZipFilePrivate::fileName
private
bool QuaZipFilePrivate::internal
private

This is true if the archive was opened by name, rather than by supplying an existing QuaZip instance.

Definition at line 65 of file quazipfile.cpp.

Referenced by QuaZipFile::close(), QuaZipFile::getZip(), QuaZipFile::open(), QuaZipFile::setFileName(), QuaZipFile::setZip(), and QuaZipFile::setZipName().

QuaZipFile* QuaZipFilePrivate::q
private

Definition at line 41 of file quazipfile.cpp.

Referenced by setZipError().

bool QuaZipFilePrivate::raw
private

Definition at line 49 of file quazipfile.cpp.

Referenced by QuaZipFile::isRaw(), QuaZipFile::open(), and QuaZipFile::size().

quint64 QuaZipFilePrivate::uncompressedSize
private

Definition at line 57 of file quazipfile.cpp.

Referenced by QuaZipFile::close(), and QuaZipFile::open().

qint64 QuaZipFilePrivate::writePos
private

QIODevice::pos() is broken for non-seekable devices, so we need our own position.

Definition at line 55 of file quazipfile.cpp.

Referenced by QuaZipFile::open(), QuaZipFile::pos(), QuaZipFile::size(), and QuaZipFile::writeData().


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