OSDN Git Service

Avoid infinite loops in the RegularExpression::subst() function when the length of...
[winmerge-jp/winmerge-jp.git] / Src / ConfigLog.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /** 
3  * @file  ConfigLog.h
4  *
5  * @brief Declaration file ConfigLog class
6  */
7 #pragma once
8
9
10 #include "UnicodeString.h"
11 #include <memory>
12
13 class UniStdioFile;
14
15 /** 
16  * @brief Class for saving configuration log file
17  */
18 class CConfigLog
19 {
20 public:
21         CConfigLog();
22         ~CConfigLog();
23
24         String GetFileName() const;
25         bool WriteLogFile(String &sError);
26
27         // Implementation methods
28 protected:
29         void WriteItem(int indent, const String& key, const tchar_t *value = nullptr);
30         void WriteItem(int indent, const String& key, const String &str);
31         void WriteItem(int indent, const String& key, long value);
32         void WriteVersionOf1(int indent, const String& path);
33         void WriteLocaleSettings(unsigned locid, const String& title);
34         void WriteWinMergeConfig(void);
35
36 private:
37         bool DoFile(String &sError);
38         void WritePluginsInLogFile(const wchar_t *transformationEvent);
39         static String GetWindowsVer();
40         static String GetProcessorInfo();
41         static String GetBuildFlags();
42         void FileWriteString(const String& lpsz);
43         void CloseFile();
44
45         // Implementation data
46 private:
47         String m_sFileName;
48         std::unique_ptr<UniStdioFile> m_pfile;
49 };
50
51 /**
52  * @brief Return logfile name and path
53  */
54 inline String CConfigLog::GetFileName() const
55 {
56         return m_sFileName;
57 }