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
64 ShowWindowType m_nCmdShow; /**< Initial state of the application's window. */
65 WindowType m_nWindowType; /**< The type of window that displays the files to compare. */
67 bool m_bEscShutdown; /**< Pressing ESC will close the application */
68 ExitNoDiff m_bExitIfNoDiff; /**< Exit if files are identical. */
69 bool m_bRecurse; /**< Include sub folder in directories compare. */
70 std::optional<CompareMethodType> m_nCompMethod; /**< Compare method */
71 bool m_bNonInteractive; /**< Suppress user's notifications. */
72 std::optional<int> m_nSingleInstance; /**< Allow only one instance of WinMerge executable. */
73 bool m_bShowUsage; /**< Show a brief reminder to command line arguments. */
74 int m_nCodepage; /**< Codepage. */
75 bool m_bNoPrefs; /**< Do not load or remember options (preferences) */
76 bool m_bSelfCompare; /**< Compares the specified file with a copy of the file */
77 bool m_bNewCompare; /**< Show a new blank window */
78 bool m_bEnableExitCode; /**< Returns the comparison result as a process exit code */
79 int m_nLineIndex; /**< Line number to jump after loading files */
80 int m_nCharIndex; /**< Character position to jump after loading files */
81 std::optional<TCHAR> m_cTableDelimiter; /**< Delimiter character for table editing*/
82 std::optional<TCHAR> m_cTableQuote; /* Quote character for table editing *< */
83 std::optional<bool> m_bTableAllowNewlinesInQuotes; /**< Allow newlines in quotes */
85 unsigned m_dwLeftFlags; /**< Left side file's behavior options. */
86 unsigned m_dwMiddleFlags; /**< Middle side file's behavior options. */
87 unsigned m_dwRightFlags; /**< Right side file's behavior options. */
89 String m_sLeftDesc; /**< Left side file's description. */
90 String m_sMiddleDesc; /**< Middle side file's description. */
91 String m_sRightDesc; /**< Right side file's description. */
93 String m_sFileFilter; /**< File filter mask. */
94 String m_sPreDiffer; /**< Pre-differ name. */
95 String m_sUnpacker; /**< Unpacker name. */
96 String m_sFileExt; /**< File extension for determining syntax highliting */
101 String m_sIniFilepath;
103 PathContext m_Files; /**< Files (or directories) to compare. */
105 std::map<String, String> m_Options;
107 std::vector<String> m_sErrorMessages;
111 static const TCHAR *EatParam(const TCHAR *, String &, bool *flag = nullptr);
112 const TCHAR *SetOption(const TCHAR *, const String& key, const TCHAR *value = _T("1"));
113 const TCHAR *SetConfig(const TCHAR *);
114 void ParseWinMergeCmdLine(const TCHAR *);
115 void AddPath(const String &path);
117 /** Operator= is not implemented. */
118 MergeCmdLineInfo& operator=(const MergeCmdLineInfo& rhs);