2018-03-21 19:58:30 +08:00
|
|
|
/*
|
2021-10-06 19:43:42 +08:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2018-03-21 19:58:30 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-03-21 19:58:30 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <algorithm>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class KernelFilenameHelper {
|
|
|
|
public:
|
|
|
|
static void getKernelFilenameFromInternalOption(std::string &option, std::string &filename) {
|
|
|
|
// remove leading spaces
|
|
|
|
size_t position = option.find_first_not_of(" ");
|
|
|
|
filename = option.substr(position);
|
|
|
|
// replace space with underscore
|
|
|
|
std::replace(filename.begin(), filename.end(), ' ', '_');
|
|
|
|
}
|
|
|
|
};
|