class KTarBase
|
generic class for reading/writing tar archives
Common functionality for KTarGz and KTarData. More... |
|
|
Public Methods
- KTarBase ()
- virtual ~KTarBase ()
- virtual bool open ( int mode )
- virtual void close ()
- bool isOpened () const
- void writeDir ( const QString& name, const QString& user, const QString& group )
- void writeFile ( const QString& name, const QString& user, const QString& group, uint size, const char* data )
- const KTarDirectory* directory () const
- virtual int read ( char * buffer, int len )
- virtual void write ( const char * buffer, int len )
- virtual int position ()
- KTarDirectory * findOrCreate ( const QString & path )
- void fillBuffer ( char * buffer, const char * mode, int size, char typeflag, const char * uname, const char * gname )
Protected Methods
- KTarBase ()
- virtual ~KTarBase ()
- virtual bool open ( int mode )
- virtual void close ()
- bool isOpened () const
- void writeDir ( const QString& name, const QString& user, const QString& group )
- void writeFile ( const QString& name, const QString& user, const QString& group, uint size, const char* data )
- const KTarDirectory* directory () const
- virtual int read ( char * buffer, int len )
- virtual void write ( const char * buffer, int len )
- virtual int position ()
- KTarDirectory * findOrCreate ( const QString & path )
- void fillBuffer ( char * buffer, const char * mode, int size, char typeflag, const char * uname, const char * gname )
Protected Members
[protected:
]
[protected:
virtual]
[virtual]
Opens the tar file/data for reading or writing.
Parameters:
mode | may be IO_ReadOnly or IO_WriteOnly
|
See also: close
[virtual]
Closes the tar file/data.
See also: open
[const]
Returns: true if the file is opened
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 )
|
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]
If a tar file is opened for reading, then the contents
of the file can be accessed via this function.
int read ( char * buffer, int len )
|
[protected:
pure virtual]
Read len
data into buffer
- reimplemented
Returns: length read
void write ( const char * buffer, int len )
|
[protected:
pure virtual]
Write len
data from buffer
- reimplemented
[protected:
pure virtual]
Returns: the current position - reimplemented
[protected:
]
Ensure path exists, create otherwise.
This handles tar files missing directory entries, like mico-2.3.0.tar.gz :)
void fillBuffer ( char * buffer, const char * mode, int size, char typeflag, const char * uname, const char * gname )
|
[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:
mode | is expected to be 6 chars long, [uname and gname 31].
|
[protected:
]
[protected:
]
[protected:
]
[protected:
]
- Author: David Faure <faure@kde.org>
- Generated: marc@yogi on Tue Mar 27 13:07:59 2001, using kdoc 2.0a48.