MCPcopy Create free account
hub / github.com/GNOME/gjs / copy_source_file_to_coverage_output

Function copy_source_file_to_coverage_output

gjs/coverage.cpp:87–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87[[nodiscard]]
88static GErrorResult<> copy_source_file_to_coverage_output(
89 GFile* source_file, GFile* destination_file) {
90 /* We need to recursively make the directory we want to copy to, as
91 * g_file_copy doesn't do that */
92 Gjs::AutoError error;
93 Gjs::AutoUnref<GFile> destination_dir{g_file_get_parent(destination_file)};
94 if (!g_file_make_directory_with_parents(destination_dir, nullptr,
95 error.out())) {
96 if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_EXISTS))
97 return Err(error.release());
98 error.reset();
99 }
100
101 if (!g_file_copy(source_file, destination_file, G_FILE_COPY_OVERWRITE,
102 nullptr, nullptr, nullptr, error.out()))
103 return Err(error.release());
104 return Ok{};
105}
106
107// This function will strip a URI scheme and return the string with the URI
108// scheme stripped or nullptr if the path was not a valid URI

Callers 1

coverage.cppFile · 0.85

Calls 4

ErrFunction · 0.85
outMethod · 0.45
releaseMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected