| 150 | } |
| 151 | |
| 152 | std::vector<uint8_t> Shell::ReadBytes(const std::filesystem::path &path) { |
| 153 | std::ifstream file{}; |
| 154 | file.open(path, std::ios_base::binary); |
| 155 | if(!file) { |
| 156 | spdlog::error("Failed to open file '{}'.", path.string()); |
| 157 | return {}; |
| 158 | } |
| 159 | return {std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()}; |
| 160 | } |
| 161 | |
| 162 | bool Shell::WriteBytes(const std::filesystem::path &path, const std::vector<uint8_t> &data) { |
| 163 | std::ofstream file(path, std::ios::out | std::ios::binary); |
nothing calls this directly
no outgoing calls
no test coverage detected