mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-28 10:44:33 +00:00
59 lines
1.3 KiB
C++
59 lines
1.3 KiB
C++
/*
|
|
* Copyright (C) 2018-2020 QuasarApp.
|
|
* Distributed under the lgplv3 software license, see the accompanying
|
|
* Everyone is permitted to copy and distribute verbatim copies
|
|
* of this license document, but changing it is not allowed.
|
|
*/
|
|
|
|
#ifndef WINDEPENDENCIESSCANNER_H
|
|
#define WINDEPENDENCIESSCANNER_H
|
|
|
|
#include <QMultiMap>
|
|
#include <QStringList>
|
|
#include "deploy_global.h"
|
|
#include "pe_type.h"
|
|
#include "elf_type.h"
|
|
#include "libinfo.h"
|
|
|
|
|
|
enum class PrivateScaner: unsigned char {
|
|
UNKNOWN,
|
|
PE,
|
|
ELF
|
|
};
|
|
|
|
class DEPLOYSHARED_EXPORT DependenciesScanner {
|
|
|
|
|
|
private:
|
|
|
|
QMultiHash<QString, QString> _EnvLibs;
|
|
QHash<QString, LibInfo> _scanedLibs;
|
|
|
|
PE _peScaner;
|
|
ELF _elfScaner;
|
|
|
|
PrivateScaner getScaner(const QString& lib) const;
|
|
|
|
QMultiMap<LibPriority, LibInfo> getLibsFromEnvirement(const QString& libName) const;
|
|
|
|
void recursiveDep(LibInfo& lib, QSet<LibInfo> &res, QSet<QString> &libStack);
|
|
|
|
void addToWinAPI(const QString& lib, QHash<WinAPI, QSet<QString> > &res);
|
|
|
|
public:
|
|
explicit DependenciesScanner();
|
|
|
|
void setEnvironment(const QStringList &env);
|
|
|
|
QSet<LibInfo> scan(const QString& path);
|
|
bool fillLibInfo(LibInfo& info ,const QString& file) const;
|
|
|
|
~DependenciesScanner();
|
|
|
|
friend class deploytest;
|
|
void clearScaned();
|
|
};
|
|
|
|
#endif // WINDEPENDENCIESSCANNER_H
|