]> git.lyx.org Git - lyx.git/blobdiff - src/support/TempFile.h
Fix bugs #6078 and #9364
[lyx.git] / src / support / TempFile.h
index 2adbb9f8de64b3f1656c1e69801a2db10fba68d0..53e91f0ae56a81632eb5c053db52d04167555be3 100644 (file)
@@ -26,14 +26,18 @@ class FileName;
  * of this class must stay alive as long as the file is needed.
  */
 class TempFile {
+       /// noncopyable
+       TempFile(TempFile const &);
+       /// nonassignable
+       TempFile & operator=(TempFile const &);
 public:
        /**
         *Create a temporary file with the given mask.
-        * \p mask must be in filesystem encoding, if it contains a
-        * relative path, the template file will be created in the global
-        * temporary directory as given by 'package().temp_dir()'.
+        * \p mask must be in filesystem encoding, the template file
+        * will be created in the global temporary directory as given
+        * by 'package().temp_dir()'.
         * If the mask contains "XXXXXX" this portion will be replaced by
-        * a uniquely generetd string. If it does not contain this portion,
+        * a uniquely generated string. If it does not contain this portion,
         * it will be automatically appended using a dot. Therefore, please
         * specify the "XXXXXX" portion if the extension of the generated
         * name is important (e.g. for the converter machinery).
@@ -46,6 +50,13 @@ public:
         * This is empty if the file could not be created.
         */
        FileName name() const;
+       /**
+        * Set whether the file should be automatically deleted in the
+        * destructor.
+        * Automatic deletion is the default, but it can be switched off if
+        * the file should be kept, because it should be renamed afterwards.
+        */
+       void setAutoRemove(bool autoremove);
 private:
        ///
        struct Private;