Write userdata string to history log (fate#312521)
[platform/upstream/libzypp.git] / zypp / TmpPath.h
index 73f0f2c..bb58f6c 100644 (file)
@@ -31,7 +31,8 @@ namespace zypp {
      * 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).
+     * passed to the ctor is deleted (recursivly in case of directories). This
+     * behavior can be canged by calling \ref autoCleanup.
      *
      * Principally serves as base class, but standalone usable.
      **/
@@ -57,9 +58,9 @@ namespace zypp {
 
         /**
          * Test whether the Pathname is valid (i.e. not empty. NOT whether
-         * it realy denotes an existing file or directory).
+         * it really denotes an existing file or directory).
          **/
-        operator const void *const() const;
+        operator const void * () const;
 
         /**
          * @return The Pathname.
@@ -73,6 +74,16 @@ namespace zypp {
         operator Pathname() const
         { return path(); }
 
+        /**
+        * Whether path is valid and deleted when the last reference drops.
+        */
+        bool autoCleanup() const;
+
+        /**
+        * Turn \ref autoCleanup on/off if path is valid.
+        */
+       void autoCleanup( bool yesno_r );
+
       public:
         /**
          * @return The default directory where temporary
@@ -109,7 +120,6 @@ namespace zypp {
      * name unique. Different location and file prefix may be passed to
      * the ctor. TmpFile is created with mode 0600.
      *
-     * The directory where the temporary file is to be created must exist.
      * TmpFile provides the Pathname of the temporary file, or an empty
      * path in case of any error.
      **/
@@ -154,7 +164,6 @@ namespace zypp {
      * the  name unique. Different location and file prefix may be passed
      * to the ctor. TmpDir is created with mode 0700.
      *
-     * The directory where the temporary directory is to be created must exist.
      * TmpDir provides the Pathname of the temporary directory , or an empty
      * path in case of any error.
      **/