mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Moved pathExists from SysCalls to path.h. In ULTs, use unchanged pathExists and mock stat, getFileAttributesA instead. Add Windows and Linux ULTs for pathExists. Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
32 lines
525 B
C++
32 lines
525 B
C++
/*
|
|
* Copyright (C) 2023-2024 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "os_inc.h"
|
|
|
|
#include <string>
|
|
|
|
namespace NEO {
|
|
inline std::string joinPath(const std::string &lhs, const std::string &rhs) {
|
|
if (lhs.size() == 0) {
|
|
return rhs;
|
|
}
|
|
|
|
if (rhs.size() == 0) {
|
|
return lhs;
|
|
}
|
|
|
|
if (*lhs.rbegin() == PATH_SEPARATOR) {
|
|
return lhs + rhs;
|
|
}
|
|
|
|
return lhs + PATH_SEPARATOR + rhs;
|
|
}
|
|
|
|
bool pathExists(const std::string &path);
|
|
} // namespace NEO
|