SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
safe_filesystem_entry.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <cassert>
13#include <filesystem>
14#include <system_error>
15
17
18namespace seqan3::detail
19{
20
100
101} // namespace seqan3::detail
A safe guard to manage a filesystem entry, e.g. a file or a directory.
Definition safe_filesystem_entry.hpp:35
safe_filesystem_entry()=delete
Deleted.
safe_filesystem_entry(safe_filesystem_entry &&)=default
Defaulted.
std::uintmax_t remove_all()
Removes a file or directory and all its contents, recursively.
Definition safe_filesystem_entry.hpp:91
safe_filesystem_entry(safe_filesystem_entry const &)=delete
Deleted.
std::filesystem::path entry
The managed resource.
Definition safe_filesystem_entry.hpp:98
bool remove()
Removes a file or empty directory.
Definition safe_filesystem_entry.hpp:70
~safe_filesystem_entry()
Calls std::filesystem::remove_all on the wrapped entry.
Definition safe_filesystem_entry.hpp:53
safe_filesystem_entry & operator=(safe_filesystem_entry const &)=delete
Deleted.
safe_filesystem_entry & operator=(safe_filesystem_entry &&)=default
Defaulted.
bool remove_no_throw() const noexcept
Removes a file or empty directory.
Definition safe_filesystem_entry.hpp:76
safe_filesystem_entry(std::filesystem::path p)
Constructs the safe guard from a std::filesystem::path.
Definition safe_filesystem_entry.hpp:49
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
SeqAn specific customisations in the standard namespace.
Provides platform and dependency checks.
T remove_all(T... args)
Hide me