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

ark

  • sources
  • kde-4.14
  • 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 doKill();
49  bool copyFiles(const QVariantList& files, const QString& destinationDirectory, ExtractionOptions options);
50  bool addFiles(const QStringList& files, const CompressionOptions& options);
51  bool deleteFiles(const QVariantList& files);
52 
53 private:
54  void emitEntryFromArchiveEntry(struct archive_entry *entry);
55  int extractionFlags() const;
56  void copyData(const QString& filename, struct archive *dest, bool partialprogress = true);
57  void copyData(struct archive *source, struct archive *dest, bool partialprogress = true);
58  bool writeFile(const QString& fileName, struct archive* arch);
59 
60  struct ArchiveReadCustomDeleter;
61  struct ArchiveWriteCustomDeleter;
62  typedef QScopedPointer<struct archive, ArchiveReadCustomDeleter> ArchiveRead;
63  typedef QScopedPointer<struct archive, ArchiveWriteCustomDeleter> ArchiveWrite;
64 
65  int m_cachedArchiveEntryCount;
66  qlonglong m_currentExtractedFilesSize;
67  bool m_emitNoEntries;
68  qlonglong m_extractedFilesSize;
69  QDir m_workDir;
70  QStringList m_writtenFiles;
71  ArchiveRead m_archiveReadDisk;
72  bool m_abortOperation;
73 };
74 
75 #endif // LIBARCHIVEHANDLER_H
Kerfuffle::ReadWriteArchiveInterface
Definition: archiveinterface.h:121
archiveinterface.h
QHash
QObject
QScopedPointer< struct archive, ArchiveReadCustomDeleter >
QString
QStringList
QDir
LibArchiveInterface
Definition: libarchivehandler.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:37 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
  • ktimer
  • kwallet
  • 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