2021-07-30 13:52:43 +00:00
|
|
|
#ifndef slic3r_BlacklistedLibraryCheck_hpp_
|
|
|
|
#define slic3r_BlacklistedLibraryCheck_hpp_
|
2021-01-27 09:39:39 +00:00
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
#include <windows.h>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#endif //WIN32
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
#ifdef WIN32
|
2021-07-30 13:52:43 +00:00
|
|
|
class BlacklistedLibraryCheck
|
2021-01-27 09:39:39 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-07-30 13:52:43 +00:00
|
|
|
static BlacklistedLibraryCheck& get_instance()
|
2021-01-27 09:39:39 +00:00
|
|
|
{
|
2021-07-30 13:52:43 +00:00
|
|
|
static BlacklistedLibraryCheck instance;
|
2021-01-27 09:39:39 +00:00
|
|
|
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
private:
|
2021-07-30 13:52:43 +00:00
|
|
|
BlacklistedLibraryCheck() = default;
|
2021-01-27 09:39:39 +00:00
|
|
|
|
|
|
|
std::vector<std::wstring> m_found;
|
|
|
|
public:
|
2021-07-30 13:52:43 +00:00
|
|
|
BlacklistedLibraryCheck(BlacklistedLibraryCheck const&) = delete;
|
|
|
|
void operator=(BlacklistedLibraryCheck const&) = delete;
|
2021-01-27 09:39:39 +00:00
|
|
|
// returns all found blacklisted dlls
|
|
|
|
bool get_blacklisted(std::vector<std::wstring>& names);
|
|
|
|
std::wstring get_blacklisted_string();
|
|
|
|
// returns true if enumerating found blacklisted dll
|
|
|
|
bool perform_check();
|
|
|
|
|
2021-07-30 13:52:43 +00:00
|
|
|
// UTF-8 encoded path
|
|
|
|
static bool is_blacklisted(const std::string &dllpath);
|
|
|
|
static bool is_blacklisted(const std::wstring &dllpath);
|
2021-01-27 09:39:39 +00:00
|
|
|
private:
|
|
|
|
static const std::vector<std::wstring> blacklist;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //WIN32
|
|
|
|
|
|
|
|
} // namespace Slic3r
|
|
|
|
|
2021-07-30 13:52:43 +00:00
|
|
|
#endif //slic3r_BlacklistedLibraryCheck_hpp_
|