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"
19 * @brief WinMerge's command line handler.
20 * This class calls command line parser(s) and allows reading parsed values
21 * from public member variables.
23 class MergeCmdLineInfo
26 explicit MergeCmdLineInfo(const TCHAR *);
32 Disabled, /**< Don't exit. */
33 Exit, /**< Exit and show message. */
34 ExitQuiet, /**< Exit and don't show message. */
44 ShowWindowType m_nCmdShow; /**< Initial state of the application's window. */
46 bool m_bEscShutdown; /**< Pressing ESC will close the application */
47 ExitNoDiff m_bExitIfNoDiff; /**< Exit if files are identical. */
48 bool m_bRecurse; /**< Include sub folder in directories compare. */
49 bool m_bNonInteractive; /**< Suppress user's notifications. */
50 bool m_bSingleInstance; /**< Allow only one instance of WinMerge executable. */
51 bool m_bShowUsage; /**< Show a brief reminder to command line arguments. */
52 int m_nCodepage; /**< Codepage. */
53 bool m_bNoPrefs; /**< Do not load or remember options (preferences) */
55 unsigned m_dwLeftFlags; /**< Left side file's behavior options. */
56 unsigned m_dwMiddleFlags; /**< Middle side file's behavior options. */
57 unsigned m_dwRightFlags; /**< Right side file's behavior options. */
59 String m_sLeftDesc; /**< Left side file's description. */
60 String m_sMiddleDesc; /**< Middle side file's description. */
61 String m_sRightDesc; /**< Right side file's description. */
63 String m_sFileFilter; /**< File filter mask. */
64 String m_sPreDiffer; /**< Pre-differ name. */
65 String m_sUnpacker; /**< Unpacker name. */
70 PathContext m_Files; /**< Files (or directories) to compare. */
72 std::map<String, String> m_Options;
74 std::vector<String> m_sErrorMessages;
78 static const TCHAR *EatParam(const TCHAR *, String &, bool *flag = nullptr);
79 const TCHAR *SetOption(const TCHAR *, const String& key, const TCHAR *value = _T("1"));
80 const TCHAR *SetConfig(const TCHAR *);
81 void ParseWinMergeCmdLine(const TCHAR *);
82 void AddPath(const String &path);
84 /** Operator= is not implemented. */
85 MergeCmdLineInfo& operator=(const MergeCmdLineInfo& rhs);