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 
70  void runUnzip(QString path, QUrl url, bool autoAdd, bool isZip);
71 
76  QString getTempDir();
77 
78 signals:
79 
89  void unzipResult(QString zipFile, QStringList unzipFile, bool autoAdd, bool isZip);
90 
91 private:
92  bool isTempDir(QString tempDir);
93  bool hasModel(QStringList fileList);
94  QStringList unzipFile(QString path, QString tempDir);
95  void recursiveFileScan(QFileInfo file, QString* dirName);
96  void downloadZip(QString path, const QString link);
97 
98 };
99 
100 #endif // hifi_ArchiveDownloadInterface_h
101 
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)
QString getTempDir()
Definition: ArchiveDownloadInterface.cpp:119