libzypp 17.31.7
zypp::filesystem::TmpPath Class Reference

Automaticaly deletes files or directories when no longer needed. More...

#include <fs/TmpPath.h>

Inheritance diagram for zypp::filesystem::TmpPath:


class  Impl
 Clean or delete a directory on destruction. More...

Public Member Functions

 TmpPath ()
 Default Ctor. More...
 TmpPath (const Pathname &tmpPath_r)
 Ctor. More...
virtual ~TmpPath ()
 Dtor. More...
 operator bool () const
 Test whether the Pathname is valid (i.e. More...
Pathname path () const
 operator Pathname () const
 Type conversion to Pathname. More...
bool autoCleanup () const
 Whether path is valid and deleted when the last reference drops. More...
void autoCleanup (bool yesno_r)
 Turn autoCleanup on/off if path is valid. More...

Static Public Member Functions

static const PathnamedefaultLocation ()

Protected Attributes

RW_pointer< Impl_impl

Detailed Description

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.

Definition at line 40 of file TmpPath.h.

Constructor & Destructor Documentation

◆ TmpPath() [1/2]

zypp::filesystem::TmpPath::TmpPath ( )

Default Ctor.

An empty Pathname.

Definition at line 108 of file

◆ TmpPath() [2/2]

zypp::filesystem::TmpPath::TmpPath ( const Pathname tmpPath_r)


Takes a Pathname.

Definition at line 116 of file

◆ ~TmpPath()

zypp::filesystem::TmpPath::~TmpPath ( )


Definition at line 125 of file

Member Function Documentation

◆ operator bool()

zypp::filesystem::TmpPath::operator bool ( ) const

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

◆ path()

Pathname zypp::filesystem::TmpPath::path ( ) const
The Pathname.

Definition at line 146 of file

◆ operator Pathname()

zypp::filesystem::TmpPath::operator Pathname ( ) const

Type conversion to Pathname.

Definition at line 75 of file TmpPath.h.

◆ autoCleanup() [1/2]

bool zypp::filesystem::TmpPath::autoCleanup ( ) const

Whether path is valid and deleted when the last reference drops.

Definition at line 163 of file

◆ autoCleanup() [2/2]

void zypp::filesystem::TmpPath::autoCleanup ( bool  yesno_r)

Turn autoCleanup on/off if path is valid.

Definition at line 166 of file

◆ defaultLocation()

const Pathname & zypp::filesystem::TmpPath::defaultLocation ( )
The default directory where temporary files should be are created (/var/tmp).

Definition at line 157 of file

Member Data Documentation

◆ _impl

RW_pointer<Impl> zypp::filesystem::TmpPath::_impl

Definition at line 98 of file TmpPath.h.

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