MCPcopy Create free account
hub / github.com/MeisApps/pcbu-desktop / ReadBytes

Method ReadBytes

common/src/shell/Shell.cpp:152–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152std::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
162bool Shell::WriteBytes(const std::filesystem::path &path, const std::vector<uint8_t> &data) {
163 std::ofstream file(path, std::ios::out | std::ios::binary);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected