• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

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

#include <kar.h>

Inheritance diagram for KAr:
KArchive

Public Member Functions

 KAr (const TQString &filename)
 
 KAr (TQIODevice *dev)
 
virtual ~KAr ()
 
TQString fileName ()
 
virtual bool prepareWriting (const TQString &name, const TQString &user, const TQString &group, uint size)
 
virtual bool doneWriting (uint size)
 
virtual bool writeDir (const TQString &name, const TQString &user, const TQString &group)
 
- Public Member Functions inherited from KArchive
virtual bool open (int mode)
 
virtual void close ()
 
bool closeSucceeded () const
 
bool isOpened () const
 
int mode () const
 
TQIODevice * device () const
 
const KArchiveDirectory * directory () const
 
bool addLocalFile (const TQString &fileName, const TQString &destName)
 
bool addLocalDirectory (const TQString &path, const TQString &destName)
 
bool writeDir (const TQString &name, const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)
 
bool writeSymLink (const TQString &name, const TQString &target, const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)
 
virtual bool writeFile (const TQString &name, const TQString &user, const TQString &group, uint size, const char *data)
 
bool writeFile (const TQString &name, const TQString &user, const TQString &group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime, const char *data)
 
bool prepareWriting (const TQString &name, const TQString &user, const TQString &group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime)
 
bool writeData (const char *data, uint size)
 

Protected Member Functions

virtual bool openArchive (int mode)
 
virtual bool closeArchive ()
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from KArchive
 KArchive (TQIODevice *dev)
 
virtual KArchiveDirectory * rootDir ()
 
KArchiveDirectory * findOrCreate (const TQString &path)
 
void setDevice (TQIODevice *dev)
 
void setRootDir (KArchiveDirectory *rootDir)
 
bool prepareWriting_impl (const TQString &name, const TQString &user, const TQString &group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime)
 
bool writeFile_impl (const TQString &name, const TQString &user, const TQString &group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime, const char *data)
 
bool writeDir_impl (const TQString &name, const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)
 
bool writeSymLink_impl (const TQString &name, const TQString &target, const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)
 
bool writeData_impl (const char *data, uint size)
 

Additional Inherited Members

- Protected Types inherited from KArchive
enum  {
  VIRTUAL_WRITE_DATA = 1 , VIRTUAL_WRITE_SYMLINK , VIRTUAL_WRITE_DIR , VIRTUAL_WRITE_FILE ,
  VIRTUAL_PREPARE_WRITING
}
 

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
Since
3.1

Definition at line 38 of file kar.h.

Constructor & Destructor Documentation

◆ KAr() [1/2]

KAr::KAr ( const TQString &  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() [2/2]

KAr::KAr ( TQIODevice *  dev)

Creates an instance that operates on the given device.

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

Parameters
devthe device to read from

Definition at line 51 of file kar.cpp.

◆ ~KAr()

KAr::~KAr ( )
virtual

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

Definition at line 58 of file kar.cpp.

Member Function Documentation

◆ closeArchive()

bool KAr::closeArchive ( )
protectedvirtual

Closes the archive.

Called by close.

Implements KArchive.

Definition at line 163 of file kar.cpp.

◆ doneWriting()

virtual bool KAr::doneWriting ( uint  size)
inlinevirtual

Call doneWriting after writing the data.

Parameters
sizethe size of the file
See also
prepareWriting()

Implements KArchive.

Definition at line 77 of file kar.h.

◆ fileName()

TQString KAr::fileName ( )
inline

The name of the ar file, as passed to the constructor.

Returns
the filename. Null if you used the TQIODevice constructor

Definition at line 65 of file kar.h.

◆ openArchive()

bool KAr::openArchive ( int  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 69 of file kar.cpp.

◆ prepareWriting()

virtual bool KAr::prepareWriting ( const TQString &  name,
const TQString &  user,
const TQString &  group,
uint  size 
)
inlinevirtual

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
namethe name of the file
userthe user that owns the file
groupthe group that owns the file
sizethe 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.

Definition at line 71 of file kar.h.

◆ writeDir()

virtual bool KAr::writeDir ( const TQString &  name,
const TQString &  user,
const TQString &  group 
)
inlinevirtual

If an archive is opened for writing then you can add new directories using this function.

KArchive won't write one directory twice.

Parameters
namethe name of the directory
userthe user that owns the directory
groupthe 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.

Definition at line 83 of file kar.h.


The documentation for this class was generated from the following files:
  • kar.h
  • kar.cpp

tdeio/tdeio

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

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.