2018-08-20 12:55:55 +02:00
|
|
|
/*
|
2019-02-27 11:39:32 +01:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
2018-08-20 12:55:55 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2019-11-19 11:49:19 +01:00
|
|
|
#include "core/os_interface/os_library.h"
|
2019-06-26 21:19:34 +02:00
|
|
|
|
|
|
|
#include "igfxfmid.h"
|
|
|
|
|
2019-02-27 11:39:32 +01:00
|
|
|
#include <exception>
|
2019-06-26 21:19:34 +02:00
|
|
|
#include <memory>
|
2018-08-20 12:55:55 +02:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
void addSlash(std::string &path);
|
|
|
|
|
|
|
|
std::vector<char> readBinaryFile(const std::string &fileName);
|
|
|
|
|
|
|
|
void readFileToVectorOfStrings(std::vector<std::string> &lines, const std::string &fileName, bool replaceTabs = false);
|
|
|
|
|
|
|
|
size_t findPos(const std::vector<std::string> &lines, const std::string &whatToFind);
|
2019-03-26 15:11:49 +01:00
|
|
|
|
2019-06-26 21:19:34 +02:00
|
|
|
PRODUCT_FAMILY getProductFamilyFromDeviceName(const std::string &deviceName);
|
|
|
|
|
2019-03-26 15:11:49 +01:00
|
|
|
class MessagePrinter {
|
|
|
|
public:
|
|
|
|
MessagePrinter() = default;
|
|
|
|
MessagePrinter(bool suppressMessages) : suppressMessages(suppressMessages) {}
|
|
|
|
|
|
|
|
void printf(const char *message) {
|
|
|
|
if (!suppressMessages) {
|
|
|
|
::printf("%s", message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
void printf(const char *format, Args... args) {
|
|
|
|
if (!suppressMessages) {
|
|
|
|
::printf(format, std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool suppressMessages = false;
|
|
|
|
};
|