Qt TAR examples


Table Of Contents


There is an example code inside QtTAR/examples/tartool.

In most cases, you will need to inherit QtTarBall to process TAR files.  If you are using compression methods, such as gz or bzip2 and so on, you should use QFile::DecoderFn and QFile::EncoderFn to handle the compression formats.

If you are using QtArchivers, QtArchivers uses an unified data streaming format in CIOS Data Manipulation Subsystem, you won't be need to handle such problems.


Listing Tarball


void ListTarBall(QString filename)
{
  QDir    d = QDir::current ( )   ;
  TarBALL tarball                 ;
  tarball . List ( d , filename ) ;
}


Extract Tarball


void ExtractTarBall(QString filename,QDir root)
{
  TarBALL tarball                       ;
  tarball . Extract ( root , filename ) ;
}


Creating Tarball


void MakeTarBall(QString filename,QDir src)
{
  TarBALL tarball                             ;
  QDir    root = QDir::current ( )            ;
  tarball . TarBall ( filename , root , src ) ;
}


Neutrino International Inc. 2001~2015