• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

ark

  • sources
  • kde-4.12
  • kdeutils
  • ark
  • plugins
  • libarchive
libarchivehandler.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007 Henrique Pinto <henrique.pinto@kdemail.net>
3  * Copyright (c) 2008-2009 Harald Hvaal <haraldhv@stud.ntnu.no>
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 #ifndef LIBARCHIVEHANDLER_H
28 #define LIBARCHIVEHANDLER_H
29 
30 #include "kerfuffle/archiveinterface.h"
31 
32 #include <QDir>
33 #include <QList>
34 #include <QScopedPointer>
35 #include <QStringList>
36 
37 using namespace Kerfuffle;
38 
39 class LibArchiveInterface: public ReadWriteArchiveInterface
40 {
41  Q_OBJECT
42 
43 public:
44  explicit LibArchiveInterface(QObject *parent, const QVariantList& args);
45  ~LibArchiveInterface();
46 
47  bool list();
48  bool copyFiles(const QVariantList& files, const QString& destinationDirectory, ExtractionOptions options);
49  bool addFiles(const QStringList& files, const CompressionOptions& options);
50  bool deleteFiles(const QVariantList& files);
51 
52 private:
53  void emitEntryFromArchiveEntry(struct archive_entry *entry);
54  int extractionFlags() const;
55  void copyData(const QString& filename, struct archive *dest, bool partialprogress = true);
56  void copyData(struct archive *source, struct archive *dest, bool partialprogress = true);
57  bool writeFile(const QString& fileName, struct archive* arch);
58 
59  struct ArchiveReadCustomDeleter;
60  struct ArchiveWriteCustomDeleter;
61  typedef QScopedPointer<struct archive, ArchiveReadCustomDeleter> ArchiveRead;
62  typedef QScopedPointer<struct archive, ArchiveWriteCustomDeleter> ArchiveWrite;
63 
64  int m_cachedArchiveEntryCount;
65  qlonglong m_currentExtractedFilesSize;
66  bool m_emitNoEntries;
67  qlonglong m_extractedFilesSize;
68  QDir m_workDir;
69  QStringList m_writtenFiles;
70  ArchiveRead m_archiveReadDisk;
71 };
72 
73 #endif // LIBARCHIVEHANDLER_H
QObject
Kerfuffle::ReadWriteArchiveInterface
Definition: archiveinterface.h:121
archiveinterface.h
Kerfuffle::CompressionOptions
QHash< QString, QVariant > CompressionOptions
These are the extra options for doing the compression.
Definition: archive.h:85
LibArchiveInterface
Definition: libarchivehandler.h:39
Kerfuffle::ExtractionOptions
QHash< QString, QVariant > ExtractionOptions
Definition: archive.h:86
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:08:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ark

Skip menu "ark"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal