libzypp 17.31.23
|
Automaticaly deletes files or directories when no longer needed. More...
#include <fs/TmpPath.h>
Classes | |
class | Impl |
Clean or delete a directory on destruction. More... | |
Public Member Functions | |
TmpPath () | |
Default Ctor. | |
TmpPath (const Pathname &tmpPath_r) | |
Ctor. | |
virtual | ~TmpPath () |
Dtor. | |
operator bool () const | |
Test whether the Pathname is valid (i.e. | |
Pathname | path () const |
operator Pathname () const | |
Type conversion to Pathname. | |
bool | autoCleanup () const |
Whether path is valid and deleted when the last reference drops. | |
void | autoCleanup (bool yesno_r) |
Turn autoCleanup on/off if path is valid. | |
Static Public Member Functions | |
static const Pathname & | defaultLocation () |
Protected Attributes | |
RW_pointer< Impl > | _impl |
Automaticaly deletes files or directories when no longer needed.
TmpPath is constructed from a Pathname. Multiple TmpPath instances created by copy and assign, share the same reference counted internal repesentation.
When the last reference drops any file or directory located at the path passed to the ctor is deleted (recursivly in case of directories). This behavior can be canged by calling autoCleanup.
Principally serves as base class, but standalone usable.
zypp::filesystem::TmpPath::TmpPath | ( | ) |
|
explicit |
|
virtual |
Dtor.
Definition at line 125 of file TmpPath.cc.
|
explicit |
Test whether the Pathname is valid (i.e.
not empty. NOT whether it really denotes an existing file or directory).
Definition at line 135 of file TmpPath.cc.
Pathname zypp::filesystem::TmpPath::path | ( | ) | const |
Definition at line 146 of file TmpPath.cc.
|
inline |
bool zypp::filesystem::TmpPath::autoCleanup | ( | ) | const |
Whether path is valid and deleted when the last reference drops.
Definition at line 163 of file TmpPath.cc.
void zypp::filesystem::TmpPath::autoCleanup | ( | bool | yesno_r | ) |
Turn autoCleanup on/off if path is valid.
Definition at line 166 of file TmpPath.cc.
|
static |
Definition at line 157 of file TmpPath.cc.
|
protected |