OSDN Git Service

- Remove MFC dependency
[winmerge-jp/winmerge-jp.git] / Src / TempFile.h
1 /**
2  *  @file TempFile.h
3  *
4  *  @brief Declaration of TempFile
5  */
6 // ID line follows -- this is updated by SVN
7 // $Id: TempFile.h 6566 2009-03-12 18:16:39Z kimmov $
8
9 #ifndef _TEMP_FILE_
10 #define _TEMP_FILE_
11
12 #include <vector>
13 #include "UnicodeString.h"
14
15 /**
16  * @brief A simple temporary file holder class.
17  * This class creates and holds temporary file names. When instance
18  * gets destroyed, the temporary file is also deleted.
19  */
20 class TempFile
21 {
22 public:
23         TempFile() {}
24         ~TempFile();
25         void Create();
26         String Create(const TCHAR *prefix = NULL, const TCHAR *ext = NULL);
27         String CreateFromFile(const TCHAR *filepath, const TCHAR *prefix);
28         String GetPath();
29         bool Delete();
30
31 private:
32         String m_path; /**< Temporary file path. */
33 };
34
35 void CleanupWMtemp();
36 bool CleanupWMtempfolder(std::vector <int> processIDs);
37 bool WMrunning(std::vector <int> processIDs, int iPI);
38 bool ClearTempfolder(const String &pathName);
39
40 #endif // _TEMP_FILE_