kio
KAr Class Reference
KAr is a class for reading archives in ar format. More...
#include <kar.h>
Public Member Functions | |
virtual bool | doneWriting (uint size) |
QString | fileName () |
KAr (QIODevice *dev) | |
KAr (const QString &filename) | |
virtual bool | prepareWriting (const QString &name, const QString &user, const QString &group, uint size) |
virtual bool | writeDir (const QString &name, const QString &user, const QString &group) |
virtual | ~KAr () |
Protected Member Functions | |
virtual bool | closeArchive () |
virtual bool | openArchive (int mode) |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
KAr is a class for reading archives in ar format.Writing is not supported. A class for reading ar archives.
- Since:
- 3.1
Definition at line 38 of file kar.h.
Constructor & Destructor Documentation
KAr::KAr | ( | const QString & | filename | ) |
KAr::KAr | ( | QIODevice * | dev | ) |
Creates an instance that operates on the given device.
The device can be compressed (KFilterDev) or not (QFile, etc.).
- Parameters:
-
dev the device to read from
KAr::~KAr | ( | ) | [virtual] |
Member Function Documentation
bool KAr::closeArchive | ( | ) | [protected, virtual] |
virtual bool KAr::doneWriting | ( | uint | size | ) | [inline, virtual] |
Call doneWriting after writing the data.
- Parameters:
-
size the size of the file
- See also:
- prepareWriting()
Implements KArchive.
QString KAr::fileName | ( | ) | [inline] |
bool KAr::openArchive | ( | int | mode | ) | [protected, virtual] |
virtual bool KAr::prepareWriting | ( | const QString & | name, | |
const QString & | user, | |||
const QString & | group, | |||
uint | size | |||
) | [inline, virtual] |
Here's another way of writing a file into an archive: Call prepareWriting, then call writeData() as many times as wanted then call doneWriting( totalSize ).
For tar.gz files, you need to know the size before hand, since it is needed in the header. For zip files, size isn't used.
- Parameters:
-
name the name of the file user the user that owns the file group the group that owns the file size the size of the file
- Todo:
- TODO(BIC): make this a thin non-virtual wrapper around prepareWriting(name,user,group,size,perm,atime,mtime,ctime) or eliminate it.
Implements KArchive.
void KAr::virtual_hook | ( | int | id, | |
void * | data | |||
) | [protected, virtual] |
virtual bool KAr::writeDir | ( | const QString & | name, | |
const QString & | user, | |||
const QString & | group | |||
) | [inline, virtual] |
If an archive is opened for writing then you can add new directories using this function.
KArchive won't write one directory twice.
- Parameters:
-
name the name of the directory user the user that owns the directory group the group that owns the directory
- Todo:
- TODO(BIC): make this a thin wrapper around writeDir(name,user,group,perm,atime,mtime,ctime) or eliminate it
Implements KArchive.
The documentation for this class was generated from the following files: