.TH "KAr" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KAr \- KAr is a class for reading archives in ar format. 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
.ti -1c
.RI "\fBKAr\fP (\fBQIODevice\fP *dev)"
.br
.ti -1c
.RI "virtual \fB~KAr\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBfileName\fP ()"
.br
.ti -1c
.RI "virtual bool \fBprepareWriting\fP (const \fBQString\fP &, const \fBQString\fP &, const \fBQString\fP &, uint)"
.br
.ti -1c
.RI "virtual bool \fBdoneWriting\fP (uint)"
.br
.ti -1c
.RI "virtual bool \fBwriteDir\fP (const \fBQString\fP &, const \fBQString\fP &, const \fBQString\fP &)"
.br
.in -1c
.SS "Protected Member Functions"

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

Writing is not supported. 
.PP
\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 38 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. 
.PP
\fBParameters:\fP
.RS 4
\fIfilename\fP is a local path (e.g. '/home/holger/myfile.ar') 
.RE
.PP

.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. 
.PP
The device can be compressed (\fBKFilterDev\fP) or not (\fBQFile\fP, etc.). 
.PP
\fBParameters:\fP
.RS 4
\fIdev\fP the device to read from 
.RE
.PP

.PP
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. 
.PP
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. 
.PP
\fBReturns:\fP
.RS 4
the filename. Null if you used the \fBQIODevice\fP constructor 
.RE
.PP

.PP
Definition at line 65 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 prepareWriting, then call \fBwriteData()\fP as many times as wanted then call doneWriting( totalSize ). 
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the file 
.br
\fIuser\fP the user that owns the file 
.br
\fIgroup\fP the group that owns the file 
.br
\fIsize\fP the size of the file // TODO(BIC): make this a thin non-virtual wrapper around // prepareWriting(name,user,group,size,perm,atime,mtime,ctime) or eliminate it. 
.RE
.PP

.PP
Implements \fBKArchive\fP.
.PP
Definition at line 71 of file kar.h.
.SS "virtual bool KAr::doneWriting (uint)\fC [inline, virtual]\fP"
.PP
Call doneWriting after writing the data. 
.PP
\fBParameters:\fP
.RS 4
\fIsize\fP the size of the file 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBprepareWriting()\fP 
.RE
.PP

.PP
Implements \fBKArchive\fP.
.PP
Definition at line 77 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. 
.PP
\fBKArchive\fP won't write one directory twice.
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the directory 
.br
\fIuser\fP the user that owns the directory 
.br
\fIgroup\fP the group that owns the directory // TODO(BIC): make this a thin wrapper around // writeDir(name,user,group,perm,atime,mtime,ctime) // or elimitate it 
.RE
.PP

.PP
Implements \fBKArchive\fP.
.PP
Definition at line 83 of file kar.h.
.SS "bool KAr::openArchive (int mode)\fC [protected, virtual]\fP"
.PP
Opens the archive for reading. 
.PP
Parses the directory listing of the archive and creates the KArchiveDirectory/KArchiveFile entries. 
.PP
Implements \fBKArchive\fP.
.PP
Definition at line 69 of file kar.cpp.
.PP
References KArchiveDirectory::addEntry(), QIODevice::at(), QIODevice::atEnd(), KArchive::device(), endl(), QString::find(), kdDebug(), kdWarning(), QString::left(), QString::mid(), QCString::mid(), QIODevice::readBlock(), QString::replace(), QCString::resize(), QCString::right(), KArchive::rootDir(), QString::stripWhiteSpace(), QString::toInt(), and QCString::toInt().
.SS "bool KAr::closeArchive ()\fC [protected, virtual]\fP"
.PP
Closes the archive. 
.PP
Called by close. 
.PP
Implements \fBKArchive\fP.
.PP
Definition at line 163 of file kar.cpp.

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