| 108 | } |
| 109 | |
| 110 | bool SaveExternalFile(std::string_view path, PathRootType root, StringView contents) |
| 111 | { |
| 112 | auto absolutePath = GetPathForExternalIo(path, root); |
| 113 | if (!absolutePath) return false; |
| 114 | |
| 115 | if (!CreateParentDirectoryRecursive(*absolutePath)) return false; |
| 116 | |
| 117 | std::ofstream f(absolutePath->c_str(), std::ios::out | std::ios::binary); |
| 118 | if (!f.good()) { |
| 119 | OsiError("Could not open file for writing: '" << path << "'"); |
| 120 | return false; |
| 121 | } |
| 122 | |
| 123 | f.write(contents.data(), contents.length()); |
| 124 | return true; |
| 125 | } |
| 126 | |
| 127 | } |
nothing calls this directly
no test coverage detected