OSDN Git Service

Leave the class name as CIniOptionsMgr, but rename the filename to IniOptionsMgr.*
[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         String CreateFromFile(const String& filepath, const String& prefix);
23         /**
24          * @brief Get temp file path (including filename).
25          * @return Full path to temp file.
26          */
27         const String& GetPath() const { return m_path; }
28         bool Delete();
29
30 private:
31         String m_path; /**< Temporary file path. */
32 };
33
34 void CleanupWMtemp();
35 bool ClearTempfolder(const String &pathName);