43 G_EXCEPTION( Error ,
tx(
"cleanup error") )
46 explicit Block(
bool active =
true ) noexcept ;
56 const char * str()
const noexcept ;
57 bool isPath()
const noexcept ;
59 friend class G::CleanupImp ;
60 const char * m_ptr {
nullptr} ;
61 bool m_is_path {
false} ;
63 using Fn = bool (*)(
const Arg &) GDEF_FSIG_NOEXCEPT ;
81 static void atexit(
bool active =
true ) ;
89 static void block() noexcept ;
94 static
void release() noexcept ;
97 static
Arg arg( const
char * ) ;
125G::Cleanup::Block::~Block()
A static interface for registering cleanup functions that are called when the process terminates abno...
static Arg arg(const char *)
Duplicates a c-string for add().
static void atexit(bool active=true)
Ensures that the cleanup functions are also called via atexit(), in addition to abnormal-termination ...
static void release() noexcept
Releases block()ed signals.
static void block() noexcept
Temporarily blocks signals until release()d.
static void init()
An optional early-initialisation function. May be called more than once.
static void add(Fn, Arg arg)
Adds the given handler to the list of handlers that are to be called when the process terminates abno...
A Path object represents a file system path.
constexpr const char * tx(const char *p) noexcept
A briefer alternative to G::gettext_noop().
Opaque leaky string pointer wrapper created by G::Cleanup::arg().
A RAII class to temporarily block signal delivery.