• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

Public Member Functions | Protected Member Functions | List of all members
KAr Class Reference

#include <kar.h>

Inheritance diagram for KAr:
Inheritance graph
[legend]

Public Member Functions

 KAr (const QString &filename)
 
 KAr (QIODevice *dev)
 
virtual ~KAr ()
 
- Public Member Functions inherited from KArchive
virtual ~KArchive ()
 
bool addLocalDirectory (const QString &path, const QString &destName)
 
bool addLocalFile (const QString &fileName, const QString &destName)
 
virtual bool close ()
 
QIODevice * device () const
 
const KArchiveDirectory * directory () const
 
QString fileName () const
 
virtual bool finishWriting (qint64 size)
 
bool isOpen () const
 
QIODevice::OpenMode mode () const
 
virtual bool open (QIODevice::OpenMode mode)
 
virtual bool prepareWriting (const QString &name, const QString &user, const QString &group, qint64 size, mode_t perm=0100644, time_t atime=UnknownTime, time_t mtime=UnknownTime, time_t ctime=UnknownTime)
 
virtual bool writeData (const char *data, qint64 size)
 
virtual bool writeDir (const QString &name, const QString &user, const QString &group, mode_t perm=040755, time_t atime=UnknownTime, time_t mtime=UnknownTime, time_t ctime=UnknownTime)
 
virtual bool writeFile (const QString &name, const QString &user, const QString &group, const char *data, qint64 size, mode_t perm=0100644, time_t atime=UnknownTime, time_t mtime=UnknownTime, time_t ctime=UnknownTime)
 
virtual bool writeSymLink (const QString &name, const QString &target, const QString &user, const QString &group, mode_t perm=0120755, time_t atime=UnknownTime, time_t mtime=UnknownTime, time_t ctime=UnknownTime)
 

Protected Member Functions

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

Additional Inherited Members

- Public Types inherited from KArchive
enum  { UnknownTime = static_cast<time_t>( -1 ) }
 

Detailed Description

KAr is a class for reading archives in ar format.

Writing is not supported. A class for reading ar archives.

Author
Laurence Anderson l.d.a.nosp@m.nder.nosp@m.son@w.nosp@m.arwi.nosp@m.ck.ac.nosp@m..uk

Definition at line 29 of file kar.h.

Constructor & Destructor Documentation

KAr::KAr ( const QString &  filename)

Creates an instance that operates on the given filename.

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

Definition at line 42 of file kar.cpp.

KAr::KAr ( QIODevice *  dev)

Creates an instance that operates on the given device.

The device can be compressed (KFilterDev) or not (QFile, etc.).

Parameters
devthe device to read from

Definition at line 47 of file kar.cpp.

KAr::~KAr ( )
virtual

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

Definition at line 52 of file kar.cpp.

Member Function Documentation

bool KAr::closeArchive ( )
protectedvirtual

Closes the archive.

Called by close.

Implements KArchive.

Definition at line 176 of file kar.cpp.

bool KAr::doFinishWriting ( qint64  size)
protectedvirtual

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 65 of file kar.cpp.

bool KAr::doPrepareWriting ( const QString &  name,
const QString &  user,
const QString &  group,
qint64  size,
mode_t  perm,
time_t  atime,
time_t  mtime,
time_t  ctime 
)
protectedvirtual

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 59 of file kar.cpp.

bool KAr::doWriteDir ( const QString &  name,
const QString &  user,
const QString &  group,
mode_t  perm,
time_t  atime,
time_t  mtime,
time_t  ctime 
)
protectedvirtual

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 70 of file kar.cpp.

bool KAr::doWriteSymLink ( const QString &  name,
const QString &  target,
const QString &  user,
const QString &  group,
mode_t  perm,
time_t  atime,
time_t  mtime,
time_t  ctime 
)
protectedvirtual

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 76 of file kar.cpp.

bool KAr::openArchive ( QIODevice::OpenMode  mode)
protectedvirtual

Opens the archive for reading.

Parses the directory listing of the archive and creates the KArchiveDirectory/KArchiveFile entries.

Implements KArchive.

Definition at line 82 of file kar.cpp.

void KAr::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Reimplemented from KArchive.

Definition at line 182 of file kar.cpp.


The documentation for this class was generated from the following files:
  • kar.h
  • kar.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal