1 /////////////////////////////////////////////////////////////////////////////
3 // WinMerge: An interactive diff/merge utility
4 // Copyright (C) 1997 Dean P. Grimm
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 /////////////////////////////////////////////////////////////////////////////
22 * @file MergeCmdLineInfo.h
24 * @brief MergeCmdLineInfo class declaration.
27 // ID line follows -- this is updated by SVN
28 // $Id: MergeCmdLineInfo.h 6940 2009-08-01 17:29:01Z kimmov $
30 #ifndef _MERGE_CMD_LINE_INFO_INCLUDED_
31 #define _MERGE_CMD_LINE_INFO_INCLUDED_
33 #include "UnicodeString.h"
34 #include "PathContext.h"
37 * @brief WinMerge's command line handler.
38 * This class calls command line parser(s) and allows reading parsed values
39 * from public member variables.
41 class MergeCmdLineInfo
44 explicit MergeCmdLineInfo(const TCHAR *);
50 Disabled, /**< Don't exit. */
51 Exit, /**< Exit and show message. */
52 ExitQuiet, /**< Exit and don't show message. */
62 ShowWindowType m_nCmdShow; /**< Initial state of the application's window. */
64 bool m_bClearCaseTool; /**< Running as Rational ClearCase external tool. */
65 bool m_bEscShutdown; /**< Pressing ESC will close the application */
66 ExitNoDiff m_bExitIfNoDiff; /**< Exit if files are identical. */
67 bool m_bRecurse; /**< Include sub folder in directories compare. */
68 bool m_bNonInteractive; /**< Suppress user's notifications. */
69 bool m_bSingleInstance; /**< Allow only one instance of WinMerge executable. */
70 bool m_bShowUsage; /**< Show a brief reminder to command line arguments. */
71 int m_nCodepage; /**< Codepage. */
73 unsigned m_dwLeftFlags; /**< Left side file's behavior options. */
74 unsigned m_dwMiddleFlags; /**< Middle side file's behavior options. */
75 unsigned m_dwRightFlags; /**< Right side file's behavior options. */
77 String m_sLeftDesc; /**< Left side file's description. */
78 String m_sMiddleDesc; /**< Middle side file's description. */
79 String m_sRightDesc; /**< Right side file's description. */
81 String m_sFileFilter; /**< File filter mask. */
82 String m_sPreDiffer; /**< Pre-differ name. */
86 PathContext m_Files; /**< Files (or directories) to compare. */
90 static const TCHAR *EatParam(const TCHAR *, String &, bool *flag = 0);
91 static const TCHAR *SetOption(const TCHAR *, const String& key, const TCHAR *value = _T("1"));
92 void ParseClearCaseCmdLine(const TCHAR *, const TCHAR *basedesc);
93 void ParseWinMergeCmdLine(const TCHAR *);
94 void AddPath(const String &path);
96 /** Operator= is not implemented. */
97 MergeCmdLineInfo& operator=(const MergeCmdLineInfo& rhs);
100 #endif // _MERGE_CMD_LINE_INFO_INCLUDED_