Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::AutoDelete Class Reference

#include <file-system.hh>

Public Member Functions

 AutoDelete (AutoDelete &&x) noexcept
AutoDelete & operator= (AutoDelete &&x) noexcept
 AutoDelete (const std::filesystem::path &p, bool recursive=true)
 AutoDelete (const AutoDelete &)=delete
AutoDelete & operator= (const AutoDelete &)=delete
void deletePath ()
void cancel () noexcept
const std::filesystem::path & path () const
PathView view () const
 operator const std::filesystem::path & () const
 operator PathView () const

Friends

void swap (AutoDelete &lhs, AutoDelete &rhs) noexcept

Detailed Description

Automatic cleanup of resources.

Member Function Documentation

◆ cancel()

void nix::AutoDelete::cancel ( )
noexcept

Cancel the pending deletion

◆ deletePath()

void nix::AutoDelete::deletePath ( )

Delete the file the path points to, and cancel this AutoDelete, so deletion is not attempted a second time by the destructor.

The destructor calls this, but ignoring any exception.


The documentation for this class was generated from the following files: