OSDN Git Service

Shell Extension for Windows 11 or later (5)
[winmerge-jp/winmerge-jp.git] / Src / TempFile.h
1 /**
2  *  @file TempFile.h
3  *
4  *  @brief Declaration of TempFile
5  */
6 #pragma once
7
8 #include <vector>
9 #include "UnicodeString.h"
10
11 /**
12  * @brief A simple temporary file holder class.
13  * This class creates and holds temporary file names. When instance
14  * gets destroyed, the temporary file is also deleted.
15  */
16 class TempFile
17 {
18 public:
19         TempFile() {}
20         ~TempFile();
21         String Create(const String& prefix = _T(""), const String& ext = _T(""));
22         /**
23          * @brief Get temp file path (including filename).
24          * @return Full path to temp file.
25          */
26         const String& GetPath() const { return m_path; }
27         bool Delete();
28
29 private:
30         String m_path; /**< Temporary file path. */
31 };
32
33 void CleanupWMtemp();
34 bool ClearTempfolder(const String &pathName);