OSDN Git Service

Merge from rev.7103:7118
[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 /**
13  * @brief A simple temporary file holder class.
14  * This class creates and holds temporary file names. When instance
15  * gets destroyed, the temporary file is also deleted.
16  */
17 class TempFile
18 {
19 public:
20         TempFile() {}
21         ~TempFile();
22         void Create();
23         String Create(LPCTSTR prefix = NULL, LPCTSTR ext = NULL);
24         String CreateFromFile(LPCTSTR filepath, LPCTSTR prefix);
25         String GetPath();
26         bool Delete();
27
28 private:
29         String m_path; /**< Temporary file path. */
30 };
31
32 void CleanupWMtemp();
33 BOOL CleanupWMtempfolder(std::vector <int> processIDs);
34 BOOL WMrunning(std::vector <int> processIDs, int iPI);
35 BOOL ClearTempfolder(const String &pathName);
36
37 #endif // _TEMP_FILE_