kio Library API Documentation

KArchiveFile Class Reference

A file in an archive. More...

#include <karchive.h>

Inheritance diagram for KArchiveFile:

KArchiveEntry List of all members.

Public Methods

int position () const
 Position of the data in the [uncompressed] archive.

int size () const
 Size of the data.

void setSize (int s)
 Set size of data, usually after writing the file.

virtual QByteArray data () const
QIODevicedevice () const
 This method returns QIODevice (internal class: KLimitedIODevice) on top of the underlying QIODevice.

virtual bool isFile () const
void copyTo (const QString &dest) const
 Extracts the file to the directory dest
Since:
3.1.



Protected Methods

virtual void virtual_hook (int id, void *data)

Detailed Description

A file in an archive.

See also:
KArchive , KArchiveDirectory

Definition at line 243 of file karchive.h.


Member Function Documentation

int KArchiveFile::position  
 

Position of the data in the [uncompressed] archive.

Definition at line 262 of file karchive.cpp.

Referenced by KArchiveDirectory::copyTo().

int KArchiveFile::size  
 

Size of the data.

Definition at line 267 of file karchive.cpp.

void KArchiveFile::setSize int    s [inline]
 

Set size of data, usually after writing the file.

Definition at line 263 of file karchive.h.

QByteArray KArchiveFile::data   [virtual]
 

Returns:
the content of this file. Call data() with care (only once per file), this data isn't cached.

Definition at line 272 of file karchive.cpp.

References QIODevice::at(), KArchive::device(), and QIODevice::readBlock().

Referenced by copyTo().

QIODevice * KArchiveFile::device  
 

This method returns QIODevice (internal class: KLimitedIODevice) on top of the underlying QIODevice.

This is obviously for reading only. Note that the ownership of the device is being transferred to the caller, who will have to delete it. The returned device auto-opens (in readonly mode), no need to open it.

Definition at line 289 of file karchive.cpp.

virtual bool KArchiveFile::isFile   const [inline, virtual]
 

Returns:
true, since this entry is a file

Reimplemented from KArchiveEntry.

Definition at line 283 of file karchive.h.

void KArchiveFile::copyTo const QString   dest const
 

Extracts the file to the directory dest

Since:
3.1.

Definition at line 294 of file karchive.cpp.

References QFile::close(), data(), KArchiveEntry::name(), and QFile::open().

Referenced by KArchiveDirectory::copyTo().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:34 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001