mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-26 02:14:15 +08:00
35 lines
655 B
C++
35 lines
655 B
C++
#ifndef _TEST_CRASH_PRINTER_HELPER_H
|
|
#define _TEST_CRASH_PRINTER_HELPER_H
|
|
|
|
|
|
#include <filesystem>
|
|
#include <string>
|
|
|
|
static inline bool remove_file(const std::string &file)
|
|
{
|
|
if (!std::filesystem::exists(file)) {
|
|
return true;
|
|
}
|
|
|
|
if (std::filesystem::is_directory(file)) {
|
|
return false;
|
|
}
|
|
|
|
return std::filesystem::remove(file);
|
|
}
|
|
|
|
static inline bool remove_file(const std::wstring &file)
|
|
{
|
|
if (!std::filesystem::exists(file)) {
|
|
return true;
|
|
}
|
|
|
|
if (std::filesystem::is_directory(file)) {
|
|
return false;
|
|
}
|
|
|
|
return std::filesystem::remove(file);
|
|
}
|
|
|
|
|
|
#endif // _TEST_CRASH_PRINTER_HELPER_H
|