MCPcopy Create free account
hub / github.com/JRickey/BattleShip / write_bytes

Function write_bytes

port/android_torch_bridge.cpp:140–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static bool write_bytes(const std::filesystem::path &path, const unsigned char *data, int size) {
141 std::error_code ec;
142 std::filesystem::create_directories(path.parent_path(), ec);
143 if (ec) {
144 LOGE("CSS stage assets: mkdirs failed for %s: %s",
145 path.parent_path().string().c_str(), ec.message().c_str());
146 return false;
147 }
148
149 std::ofstream f(path, std::ios::binary | std::ios::trunc);
150 if (!f) {
151 return false;
152 }
153 f.write(reinterpret_cast<const char *>(data), size);
154 return (bool)f;
155}
156
157static bool extract_reloc_file(const std::vector<uint8_t> &rom, uint32_t file_id,
158 std::vector<uint8_t> &out) {

Callers 1

write_png_rgbaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected