| 78 | } |
| 79 | |
| 80 | bool CopyFile(const std::string& src, const std::string& dst) { |
| 81 | try { |
| 82 | auto srcPath = Utf8ToPath(src); |
| 83 | if (!fs::exists(srcPath)) { |
| 84 | return false; |
| 85 | } |
| 86 | auto dstPath = Utf8ToPath(dst); |
| 87 | auto parentPath = dstPath.parent_path(); |
| 88 | if (!parentPath.empty() && !fs::exists(parentPath)) { |
| 89 | fs::create_directories(parentPath); |
| 90 | } |
| 91 | fs::copy_file(srcPath, dstPath, fs::copy_options::overwrite_existing); |
| 92 | return true; |
| 93 | } catch (...) { |
| 94 | return false; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | bool WriteToFile(const std::string& filePath, const char* data, std::streamsize size, |
| 99 | std::ios::openmode mode) { |
no test coverage detected