.TH "KAr" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KAr \- A class for reading ar archives.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kar.h>\fP
.PP
Inherits \fBKArchive\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKAr\fP (const  \fBQString\fP &filename)"
.br
.RI "\fICreates an instance that operates on the given filename. \fP"
.ti -1c
.RI "\fBKAr\fP (\fBQIODevice\fP *dev)"
.br
.RI "\fICreates an instance that operates on the given device. \fP"
.ti -1c
.RI "virtual \fB~KAr\fP ()"
.br
.RI "\fIIf the ar file is still opened, then it will be closed automatically by the destructor. \fP"
.ti -1c
.RI "\fBQString\fP \fBfileName\fP ()"
.br
.RI "\fIThe name of the ar file, as passed to the constructor Null if you used the \fBQIODevice\fP constructor. \fP"
.ti -1c
.RI "virtual bool \fBprepareWriting\fP (const  \fBQString\fP &, const  \fBQString\fP &, const  \fBQString\fP &, uint)"
.br
.RI "\fIHere's another way of writing a file into an archive: Call \fBprepareWriting\fP, then call \fBdevice()\fP->writeBlock() (for tar files) or writeData (for zip files) [NEW VIRTUAL METHOD NEEDED] as many times as wanted then call \fBdoneWriting\fP( totalSize ) For tar.gz files, you need to know the size before hand, it is needed in the header! For zip files, size isn't used. \fP"
.ti -1c
.RI "virtual bool \fBdoneWriting\fP (uint)"
.br
.RI "\fICall \fBdoneWriting\fP after writing the data. \fP"
.ti -1c
.RI "virtual bool \fBwriteDir\fP (const  \fBQString\fP &, const  \fBQString\fP &, const  \fBQString\fP &)"
.br
.RI "\fIIf an archive is opened for writing then you can add new directories using this function. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBopenArchive\fP (int mode)"
.br
.RI "\fIOpens the archive for reading. \fP"
.ti -1c
.RI "virtual bool \fBcloseArchive\fP ()"
.br
.RI "\fICloses the archive. \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
A class for reading ar archives. 

\fBAuthor:\fP
.RS 4
Laurence Anderson <l.d.anderson@warwick.ac.uk> 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 36 of file kar.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KAr::KAr (const \fBQString\fP & filename)"
.PP
Creates an instance that operates on the given filename. \fBParameters:\fP
.RS 4
\fIfilename\fP is a local path (e.g. '/home/holger/myfile.ar') 
.RE
.PP
Definition at line 42 of file kar.cpp.
.SS "KAr::KAr (\fBQIODevice\fP * dev)"
.PP
Creates an instance that operates on the given device. The device can be compressed (\fBKFilterDev\fP) or not (\fBQFile\fP, etc.). Definition at line 51 of file kar.cpp.
.SS "KAr::~\fBKAr\fP ()\fC [virtual]\fP"
.PP
If the ar file is still opened, then it will be closed automatically by the destructor. Definition at line 58 of file kar.cpp.
.PP
References KArchive::close(), KArchive::device(), QString::isEmpty(), and KArchive::isOpened().
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KAr::fileName ()\fC [inline]\fP"
.PP
The name of the ar file, as passed to the constructor Null if you used the \fBQIODevice\fP constructor. Definition at line 62 of file kar.h.
.SS "virtual bool KAr::prepareWriting (const \fBQString\fP &, const \fBQString\fP &, const \fBQString\fP &, uint)\fC [inline, virtual]\fP"
.PP
Here's another way of writing a file into an archive: Call \fBprepareWriting\fP, then call \fBdevice()\fP->writeBlock() (for tar files) or writeData (for zip files) [NEW VIRTUAL METHOD NEEDED] as many times as wanted then call \fBdoneWriting\fP( totalSize ) For tar.gz files, you need to know the size before hand, it is needed in the header! For zip files, size isn't used. Implements \fBKArchive\fP.
.PP
Definition at line 67 of file kar.h.
.SS "virtual bool KAr::doneWriting (uint)\fC [inline, virtual]\fP"
.PP
Call \fBdoneWriting\fP after writing the data. \fBSee also:\fP
.RS 4
\fBprepareWriting\fP 
.RE
.PP
Implements \fBKArchive\fP.
.PP
Definition at line 68 of file kar.h.
.SS "virtual bool KAr::writeDir (const \fBQString\fP &, const \fBQString\fP &, const \fBQString\fP &)\fC [inline, virtual]\fP"
.PP
If an archive is opened for writing then you can add new directories using this function. \fBKArchive\fP won't write one directory twice. Implements \fBKArchive\fP.
.PP
Definition at line 69 of file kar.h.
.SS "bool KAr::openArchive (int mode)\fC [protected, virtual]\fP"
.PP
Opens the archive for reading. Parses the directory listing of the archive and creates the KArchiveDirectory/KArchiveFile entries. Implements \fBKArchive\fP.
.PP
Definition at line 69 of file kar.cpp.
.PP
References KArchiveDirectory::addEntry(), QIODevice::at(), QIODevice::atEnd(), KArchive::device(), QString::find(), QString::left(), QString::mid(), QCString::mid(), KStdAccel::name(), QIODevice::readBlock(), QString::replace(), QCString::resize(), QCString::right(), KArchive::rootDir(), and QString::stripWhiteSpace().
.SS "bool KAr::closeArchive ()\fC [protected, virtual]\fP"
.PP
Closes the archive. Called by \fBclose\fP. Implements \fBKArchive\fP.
.PP
Definition at line 161 of file kar.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
