MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / FileWriter

Method FileWriter

include/storage/tar.hpp:318–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316 };
317
318 FileWriter(const std::filesystem::path &path, FingerprintFlag flag) : path(path)
319 {
320 a = archive_write_new();
321 int ret = archive_write_set_format_pax_restricted(a);
322 detail::checkArchiveError(a, ret, path, "set format pax restricted");
323 ret = archive_write_open_filename(a, path.string().c_str());
324 if (ret != ARCHIVE_OK)
325 {
326 const char *err = archive_error_string(a);
327 std::string errmsg = err ? err : "unknown error";
328 archive_write_free(a);
329 a = nullptr;
330 throw util::RuntimeError(
331 path.string(), ErrorCode::FileOpenError, SOURCE_REF, errmsg.c_str());
332 }
333
334 if (flag == GenerateFingerprint)
335 {
336 WriteFingerprint();
337 }
338 }
339
340 ~FileWriter()
341 {

Callers

nothing calls this directly

Calls 2

checkArchiveErrorFunction · 0.85
RuntimeErrorClass · 0.85

Tested by

no test coverage detected