1 /*****************************************************************************
2  * Copyright (C) 2000 David Faure <faure@kde.org>                            *
3  * Copyright (C) 2002 Szombathelyi György <gyurco@users.sourceforge.net>     *
4  * Copyright (C) 2003 Leo Savernik <l.savernik@aon.at>                       *
5  * Copyright (C) 2004-2019 Krusader Krew [https://krusader.org]              *
6  *                                                                           *
7  * This file is heavily based on ktar from kdelibs                           *
8  *                                                                           *
9  * This file is part of Krusader [https://krusader.org].                     *
10  *                                                                           *
11  * Krusader is free software: you can redistribute it and/or modify          *
12  * it under the terms of the GNU General Public License as published by      *
13  * the Free Software Foundation, either version 2 of the License, or         *
14  * (at your option) any later version.                                       *
15  *                                                                           *
16  * Krusader is distributed in the hope that it will be useful,               *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
19  * GNU General Public License for more details.                              *
20  *                                                                           *
21  * You should have received a copy of the GNU General Public License         *
22  * along with Krusader.  If not, see [http://www.gnu.org/licenses/].         *
23  *****************************************************************************/
24 
25 #ifndef ISO_H
26 #define ISO_H
27 
28 // QtCore
29 #include <QByteArray>
30 #include <QUrl>
31 
32 #include <KIO/SlaveBase>
33 
34 #include "kisofile.h"
35 
36 class KIso;
37 
38 class kio_isoProtocol : public KIO::SlaveBase
39 {
40 public:
41     kio_isoProtocol(const QByteArray &pool, const QByteArray &app);
42     virtual ~kio_isoProtocol();
43 
44     virtual void listDir(const QUrl &url) Q_DECL_OVERRIDE;
45     virtual void stat(const QUrl &url) Q_DECL_OVERRIDE;
46     virtual void get(const QUrl &url) Q_DECL_OVERRIDE;
47 
48 protected:
49     void getFile(const KIsoFile *isoFileEntry, const QString &path);
50     void createUDSEntry(const KArchiveEntry * isoEntry, KIO::UDSEntry & entry);
51     bool checkNewFile(QString fullPath, QString & path, int startsec);
52     QString getPath(const QUrl &url);
53 
54     KIso * m_isoFile;
55     time_t m_mtime;
56     int m_mode;
57 };
58 
59 #endif
60