KRcc

Search for usage in LXR

#include <krcc.h>

Inheritance diagram for KRcc:

Public Member Functions

 KRcc (const QString &filename)
 
 ~KRcc () override
 
- Public Member Functions inherited from KArchive
bool addLocalDirectory (const QString &path, const QString &destName)
 
bool addLocalFile (const QString &fileName, const QString &destName)
 
virtual bool close ()
 
QIODevicedevice () const
 
const KArchiveDirectorydirectory () const
 
QString errorString () const
 
QString fileName () const
 
bool finishWriting (qint64 size)
 
bool isOpen () const
 
QIODevice::OpenMode mode () const
 
virtual bool open (QIODevice::OpenMode mode)
 
bool prepareWriting (const QString &name, const QString &user, const QString &group, qint64 size, mode_t perm=0100644, const QDateTime &atime=QDateTime(), const QDateTime &mtime=QDateTime(), const QDateTime &ctime=QDateTime())
 
bool writeData (const char *data, qint64 size)
 
bool writeData (QByteArrayView data)
 
bool writeDir (const QString &name, const QString &user=QString(), const QString &group=QString(), mode_t perm=040755, const QDateTime &atime=QDateTime(), const QDateTime &mtime=QDateTime(), const QDateTime &ctime=QDateTime())
 
bool writeFile (const QString &name, QByteArrayView data, mode_t perm=0100644, const QString &user=QString(), const QString &group=QString(), const QDateTime &atime=QDateTime(), const QDateTime &mtime=QDateTime(), const QDateTime &ctime=QDateTime())
 
bool writeSymLink (const QString &name, const QString &target, const QString &user=QString(), const QString &group=QString(), mode_t perm=0120755, const QDateTime &atime=QDateTime(), const QDateTime &mtime=QDateTime(), const QDateTime &ctime=QDateTime())
 

Protected Member Functions

bool closeArchive () override
 
bool doFinishWriting (qint64 size) override
 
bool doPrepareWriting (const QString &name, const QString &user, const QString &group, qint64 size, mode_t perm, const QDateTime &atime, const QDateTime &mtime, const QDateTime &ctime) override
 
bool doWriteDir (const QString &name, const QString &user, const QString &group, mode_t perm, const QDateTime &atime, const QDateTime &mtime, const QDateTime &ctime) override
 
bool doWriteSymLink (const QString &name, const QString &target, const QString &user, const QString &group, mode_t perm, const QDateTime &atime, const QDateTime &mtime, const QDateTime &ctime) override
 
bool openArchive (QIODevice::OpenMode mode) override
 
void virtual_hook (int id, void *data) override
 
- Protected Member Functions inherited from KArchive
 KArchive (const QString &fileName)
 
 KArchive (QIODevice *dev)
 
virtual bool createDevice (QIODevice::OpenMode mode)
 
virtual bool doWriteData (const char *data, qint64 size)
 
KArchiveDirectoryfindOrCreate (const QString &path)
 
virtual KArchiveDirectoryrootDir ()
 
void setDevice (QIODevice *dev)
 
void setErrorString (const QString &errorStr)
 
void setRootDir (KArchiveDirectory *rootDir)
 

Detailed Description

KRcc is a class for reading dynamic binary resources created by Qt's rcc tool from a .qrc file and the files it points to.

Writing is not supported.

A class for reading rcc resources.

Since
5.3

Definition at line 19 of file krcc.h.

Constructor & Destructor Documentation

◆ KRcc()

KRcc::KRcc ( const QString & filename)
explicit

Creates an instance that operates on the given filename.

Parameters
filenameis a local path (e.g. "/home/holger/myfile.rcc")

Definition at line 67 of file krcc.cpp.

◆ ~KRcc()

KRcc::~KRcc ( )
override

If the rcc file is still opened, then it will be closed automatically by the destructor.

Definition at line 73 of file krcc.cpp.

Member Function Documentation

◆ closeArchive()

bool KRcc::closeArchive ( )
overrideprotectedvirtual

Unregisters the .rcc resource from the QResource system.

Implements KArchive.

Definition at line 151 of file krcc.cpp.

◆ doFinishWriting()

bool KRcc::doFinishWriting ( qint64 size)
overrideprotectedvirtual

Called after writing the data.

This virtual method must be implemented by subclasses.

Parameters
sizethe size of the file
See also
finishWriting()

Implements KArchive.

Definition at line 88 of file krcc.cpp.

◆ doPrepareWriting()

bool KRcc::doPrepareWriting ( const QString & name,
const QString & user,
const QString & group,
qint64 size,
mode_t perm,
const QDateTime & atime,
const QDateTime & mtime,
const QDateTime & ctime )
overrideprotectedvirtual

This virtual method must be implemented by subclasses.

Depending on the archive type not all metadata might be used.

Parameters
namethe name of the file
userthe user that owns the file
groupthe group that owns the file
sizethe size of the file
permpermissions of the file. Use 0100644 if you don't have any more specific permissions to set.
atimetime the file was last accessed
mtimemodification time of the file
ctimetime of last status change
See also
prepareWriting

Implements KArchive.

Definition at line 81 of file krcc.cpp.

◆ doWriteDir()

bool KRcc::doWriteDir ( const QString & name,
const QString & user,
const QString & group,
mode_t perm,
const QDateTime & atime,
const QDateTime & mtime,
const QDateTime & ctime )
overrideprotectedvirtual

Write a directory to the archive.

This virtual method must be implemented by subclasses.

Depending on the archive type not all metadata might be used.

Parameters
namethe name of the directory
userthe user that owns the directory
groupthe group that owns the directory
permpermissions of the directory. Use 040755 if you don't have any other information.
atimetime the file was last accessed
mtimemodification time of the file
ctimetime of last status change
See also
writeDir

Implements KArchive.

Definition at line 95 of file krcc.cpp.

◆ doWriteSymLink()

bool KRcc::doWriteSymLink ( const QString & name,
const QString & target,
const QString & user,
const QString & group,
mode_t perm,
const QDateTime & atime,
const QDateTime & mtime,
const QDateTime & ctime )
overrideprotectedvirtual

Writes a symbolic link to the archive.

This virtual method must be implemented by subclasses.

Parameters
namename of symbolic link
targettarget of symbolic link
userthe user that owns the directory
groupthe group that owns the directory
permpermissions of the directory
atimetime the file was last accessed
mtimemodification time of the file
ctimetime of last status change
See also
writeSymLink

Implements KArchive.

Definition at line 102 of file krcc.cpp.

◆ openArchive()

bool KRcc::openArchive ( QIODevice::OpenMode mode)
overrideprotectedvirtual

Registers the .rcc resource in the QResource system under a unique identifier, then lists that, and creates the KArchiveFile/KArchiveDirectory entries.

Implements KArchive.

Definition at line 109 of file krcc.cpp.

◆ virtual_hook()

void KRcc::virtual_hook ( int id,
void * data )
overrideprotectedvirtual

Reimplemented from KArchive.

Definition at line 159 of file krcc.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.