1 /////////////////////////////////////////////////////////////////////////////
2 // WinMerge: An interactive diff/merge utility
3 // Copyright (C) 1997 Dean P. Grimm
4 // SPDX-License-Identifier: GPL-2.0-or-later
5 /////////////////////////////////////////////////////////////////////////////
7 * @file MergeCmdLineInfo.h
9 * @brief MergeCmdLineInfo class declaration.
14 #include "UnicodeString.h"
15 #include "PathContext.h"
20 * @brief WinMerge's command line handler.
21 * This class calls command line parser(s) and allows reading parsed values
22 * from public member variables.
24 class MergeCmdLineInfo
27 explicit MergeCmdLineInfo(const TCHAR *);
33 Disabled, /**< Don't exit. */
34 Exit, /**< Exit and show message. */
35 ExitQuiet, /**< Exit and don't show message. */
45 enum CompareMethodType
55 ShowWindowType m_nCmdShow; /**< Initial state of the application's window. */
57 bool m_bEscShutdown; /**< Pressing ESC will close the application */
58 ExitNoDiff m_bExitIfNoDiff; /**< Exit if files are identical. */
59 bool m_bRecurse; /**< Include sub folder in directories compare. */
60 std::optional<CompareMethodType> m_nCompMethod; /**< Compare method */
61 bool m_bNonInteractive; /**< Suppress user's notifications. */
62 std::optional<int> m_nSingleInstance; /**< Allow only one instance of WinMerge executable. */
63 bool m_bShowUsage; /**< Show a brief reminder to command line arguments. */
64 int m_nCodepage; /**< Codepage. */
65 bool m_bNoPrefs; /**< Do not load or remember options (preferences) */
66 bool m_bSelfCompare; /**< Compares the specified file with a copy of the file */
68 unsigned m_dwLeftFlags; /**< Left side file's behavior options. */
69 unsigned m_dwMiddleFlags; /**< Middle side file's behavior options. */
70 unsigned m_dwRightFlags; /**< Right side file's behavior options. */
72 String m_sLeftDesc; /**< Left side file's description. */
73 String m_sMiddleDesc; /**< Middle side file's description. */
74 String m_sRightDesc; /**< Right side file's description. */
76 String m_sFileFilter; /**< File filter mask. */
77 String m_sPreDiffer; /**< Pre-differ name. */
78 String m_sUnpacker; /**< Unpacker name. */
83 PathContext m_Files; /**< Files (or directories) to compare. */
85 std::map<String, String> m_Options;
87 std::vector<String> m_sErrorMessages;
91 static const TCHAR *EatParam(const TCHAR *, String &, bool *flag = nullptr);
92 const TCHAR *SetOption(const TCHAR *, const String& key, const TCHAR *value = _T("1"));
93 const TCHAR *SetConfig(const TCHAR *);
94 void ParseWinMergeCmdLine(const TCHAR *);
95 void AddPath(const String &path);
97 /** Operator= is not implemented. */
98 MergeCmdLineInfo& operator=(const MergeCmdLineInfo& rhs);