Overte C++ Documentation
ArchiveDownloadInterface.h
1 //
2 // ArchiveDownloadInterface.h
3 // libraries/script-engine/src
4 //
5 // Created by Elisa Lupin-Jimenez on 6/28/16.
6 // Copyright 2016 High Fidelity, Inc.
7 // Copyright 2023 Overte e.V.
8 //
9 // Distributed under the Apache License, Version 2.0.
10 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
11 //
12 
15 
16 #ifndef hifi_ArchiveDownloadInterface_h
17 #define hifi_ArchiveDownloadInterface_h
18 
19 #include <QtCore/QObject>
20 #include <QtCore/QUrl>
21 #include <QFileInfo>
22 #include <QString>
23 
27 class ArchiveDownloadInterface : public QObject {
28  Q_OBJECT
29 
30 public:
31  ArchiveDownloadInterface(QObject* parent);
32 
33 public slots:
34 
41  QString convertUrlToPath(QUrl url);
42 
73  void runUnzip(QString path, QUrl url, bool autoAdd, bool isZip, bool isBlocks);
74 
79  QString getTempDir();
80 
81 signals:
82 
93  void unzipResult(QString zipFile, QStringList unzipFile, bool autoAdd, bool isZip, bool isBlocks);
94 
95 private:
96  bool isTempDir(QString tempDir);
97  bool hasModel(QStringList fileList);
98  QStringList unzipFile(QString path, QString tempDir);
99  void recursiveFileScan(QFileInfo file, QString* dirName);
100  void downloadZip(QString path, const QString link);
101 
102 };
103 
104 #endif // hifi_ArchiveDownloadInterface_h
105 
The ArchiveDownloadInterface API provides some facilities for working with the file system.
Definition: ArchiveDownloadInterface.h:27
QString convertUrlToPath(QUrl url)
Extracts a filename from a URL, where the filename is specified in the query part of the URL as filen...
Definition: ArchiveDownloadInterface.cpp:126
void unzipResult(QString zipFile, QStringList unzipFile, bool autoAdd, bool isZip, bool isBlocks)
QString getTempDir()
Definition: ArchiveDownloadInterface.cpp:119