class KTarBase

generic class for reading/writing tar archives Doesn't really have any reason for being separated from KTarGz anymore. Will be merged with KTarGz and renamed to KTar in KDE 3.0. More...

Contains pure virtuals
Definition#include <ktar.h>
Inherited byKTarData, KTarGz
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods

Protected Members


Detailed Description

 KTarBase ()

KTarBase

[protected]

 KTarBase (QIODevice * dev)

KTarBase

[protected]

 ~KTarBase ()

~KTarBase

[protected virtual]

bool  open ( int mode )

open

[virtual]

Opens the tar file/data for reading or writing.

Parameters:
modemay be IO_ReadOnly or IO_WriteOnly

See also: close

void  close ()

close

[virtual]

Closes the tar file/data.

See also: open

bool  isOpened ()

isOpened

[const]

Returns: true if the file is opened

void  writeDir ( const QString& name, const QString& user, const QString& group )

writeDir

If a tar file is opened for writing then you can add new directories using this function. KTar won't write one directory twice.

void  writeFile ( const QString& name, const QString& user, const QString& group, uint size, const char* data )

writeFile

If a tar file is opened for writing then you can add a new file using this function. If the file name is for example "mydir/test1" then the directory "mydir" is automatically appended first if that did not happen yet.

const KTarDirectory*  directory ()

directory

[const]

If a tar file is opened for reading, then the contents of the file can be accessed via this function.

QIODevice *  device ()

device

[const]

void  setDevice ( QIODevice * dev )

setDevice

int  read ( char * buffer, int len )

read

[protected pure virtual]

Read len data into buffer - reimplemented

Returns: length read

void  write ( const char * buffer, int len )

write

[protected pure virtual]

Write len data from buffer - reimplemented

int  position ()

position

[protected pure virtual]

Returns: the current position - reimplemented

KTarDirectory *  findOrCreate ( const QString & path )

findOrCreate

[protected]

Ensure path exists, create otherwise. This handles tar files missing directory entries, like mico-2.3.0.tar.gz :)

KTarDirectory*  rootDir ()

rootDir

[protected]

Retrieve or create the root directory

void  fillBuffer ( char * buffer, const char * mode, int size, char typeflag, const char * uname, const char * gname )

fillBuffer

[protected]

Fills buffer for writing a file as required by the tar format Has to be called LAST, since it does the checksum (normally, only the name has to be filled in before)

Parameters:
modeis expected to be 6 chars long, [uname and gname 31].

KTarBasePrivate * d

d

[protected]

bool m_open

m_open

[protected]

QStringList m_dirList

m_dirList

[protected]

char m_mode

m_mode

[protected]