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

tdeio/tdeio

  • tdeio
  • tdeio
ktar.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 David Faure <faure@kde.org>
3  Copyright (C) 2003 Leo Savernik <l.savernik@aon.at>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 #ifndef __ktar_h
20 #define __ktar_h
21 
22 #include <sys/stat.h>
23 #include <sys/types.h>
24 
25 #include <tqdatetime.h>
26 #include <tqstring.h>
27 #include <tqstringlist.h>
28 #include <tqdict.h>
29 
30 #include <karchive.h>
31 
40 class TDEIO_EXPORT KTar : public KArchive
41 {
42 public:
54  KTar( const TQString& filename, const TQString & mimetype = TQString::null );
55 
64  KTar( TQIODevice * dev );
65 
70  virtual ~KTar();
71 
77  TQString fileName() { return m_filename; } // TODO KDE4 const
78 
85  void setOrigFileName( const TQCString & fileName );
86 
87  // TODO(BIC) make virtual. For now it must be implemented by virtual_hook.
88  bool writeSymLink(const TQString &name, const TQString &target,
89  const TQString &user, const TQString &group,
90  mode_t perm, time_t atime, time_t mtime, time_t ctime);
91  virtual bool writeDir( const TQString& name, const TQString& user, const TQString& group );
92  // TODO(BIC) make virtual. For now it must be implemented by virtual_hook.
93  bool writeDir( const TQString& name, const TQString& user, const TQString& group,
94  mode_t perm, time_t atime, time_t mtime, time_t ctime );
95  virtual bool prepareWriting( const TQString& name, const TQString& user, const TQString& group, uint size );
96  // TODO(BIC) make virtual. For now it must be implemented by virtual_hook.
97  bool prepareWriting( const TQString& name, const TQString& user,
98  const TQString& group, uint size, mode_t perm,
99  time_t atime, time_t mtime, time_t ctime );
100  virtual bool doneWriting( uint size );
101 
102 protected:
109  virtual bool openArchive( int mode );
110  virtual bool closeArchive();
111 
112 private:
116  void prepareDevice( const TQString & filename, const TQString & mimetype, bool forced = false );
117 
125  void fillBuffer( char * buffer, const char * mode, int size, time_t mtime,
126  char typeflag, const char * uname, const char * gname );
127 
139  void writeLonglink(char *buffer, const TQCString &name, char typeflag,
140  const char *uname, const char *gname);
141 
142  TQ_LONG readRawHeader(char *buffer);
143  bool readLonglink(char *buffer,TQCString &longlink);
144  TQ_LONG readHeader(char *buffer,TQString &name,TQString &symlink);
145 
146  TQString m_filename;
147 protected:
148  virtual void virtual_hook( int id, void* data );
149  bool prepareWriting_impl(const TQString& name, const TQString& user,
150  const TQString& group, uint size, mode_t perm,
151  time_t atime, time_t mtime, time_t ctime);
152  bool writeDir_impl(const TQString& name, const TQString& user,
153  const TQString& group, mode_t perm,
154  time_t atime, time_t mtime, time_t ctime );
155  bool writeSymLink_impl(const TQString &name, const TQString &target,
156  const TQString &user, const TQString &group,
157  mode_t perm, time_t atime, time_t mtime, time_t ctime);
158 private:
159  class KTarPrivate;
160  KTarPrivate * d;
161 };
162 
166 #define KTarGz KTar
167 #define KTarEntry KArchiveEntry
168 #define KTarFile KArchiveFile
169 #define KTarDirectory KArchiveDirectory
170 
171 #endif
KArchive::writeSymLink
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)
Writes a symbolic link to the archive if the archive must be opened for writing.
Definition: karchive.cpp:327
KArchive
KArchive is a base class for reading and writing archives.
Definition: karchive.h:42
KArchive::doneWriting
virtual bool doneWriting(uint size)=0
Call doneWriting after writing the data.
KArchive::openArchive
virtual bool openArchive(int mode)=0
Opens an archive for reading or writing.
KTar
A class for reading / writing (optionally compressed) tar archives.
Definition: ktar.h:40
KTar::fileName
TQString fileName()
The name of the tar file, as passed to the constructor Null if you used the TQIODevice constructor...
Definition: ktar.h:77
KArchive::closeArchive
virtual bool closeArchive()=0
Closes the archive.
KArchive::writeDir
virtual bool writeDir(const TQString &name, const TQString &user, const TQString &group)=0
If an archive is opened for writing then you can add new directories using this function.
KArchive::prepareWriting
virtual bool prepareWriting(const TQString &name, const TQString &user, const TQString &group, uint size)=0
Here's another way of writing a file into an archive: Call prepareWriting, then call writeData() as m...

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.8.8
This website is maintained by Timothy Pearson.