OSDN Git Service

Make unit tests buildable again
[winmerge-jp/winmerge-jp.git] / Src / MergeCmdLineInfo.h
1 /////////////////////////////////////////////////////////////////////////////
2 //
3 //    WinMerge: An interactive diff/merge utility
4 //    Copyright (C) 1997 Dean P. Grimm
5 //
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.
10 //
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.
15 //
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.
19 //
20 /////////////////////////////////////////////////////////////////////////////
21 /** 
22  * @file  MergeCmdLineInfo.h
23  *
24  * @brief MergeCmdLineInfo class declaration.
25  *
26  */
27 // ID line follows -- this is updated by SVN
28 // $Id: MergeCmdLineInfo.h 6940 2009-08-01 17:29:01Z kimmov $
29
30 #ifndef _MERGE_CMD_LINE_INFO_INCLUDED_
31 #define _MERGE_CMD_LINE_INFO_INCLUDED_
32
33 #include <vector>
34 #include "UnicodeString.h"
35 #include "PathContext.h"
36
37 /** 
38  * @brief WinMerge's command line handler.
39  * This class calls command line parser(s) and allows reading parsed values
40  * from public member variables.
41  */
42 class MergeCmdLineInfo
43 {
44 public:
45         MergeCmdLineInfo(LPCTSTR);
46
47 public:
48
49         enum ExitNoDiff
50         {
51                 Disabled, /**< Don't exit. */
52                 Exit, /**< Exit and show message. */
53                 ExitQuiet, /**< Exit and don't show message. */
54         };
55
56         int m_nCmdShow; /**< Initial state of the application's window. */
57
58         bool m_bClearCaseTool; /**< Running as Rational ClearCase external tool. */
59         bool m_bEscShutdown; /**< Pressing ESC will close the application */
60         ExitNoDiff m_bExitIfNoDiff; /**< Exit if files are identical. */
61         bool m_bRecurse; /**< Include sub folder in directories compare. */
62         bool m_bNonInteractive; /**< Suppress user's notifications. */
63         bool m_bSingleInstance; /**< Allow only one instance of WinMerge executable. */
64         bool m_bShowUsage; /**< Show a brief reminder to command line arguments. */
65         int  m_nCodepage;  /**< Codepage. */
66
67         DWORD m_dwLeftFlags; /**< Left side file's behavior options. */
68         DWORD m_dwMiddleFlags; /**< Middle side file's behavior options. */
69         DWORD m_dwRightFlags; /**< Right side file's behavior options. */
70
71         String m_sLeftDesc; /**< Left side file's description. */
72         String m_sMiddleDesc; /**< Middle side file's description. */
73         String m_sRightDesc; /**< Right side file's description. */
74
75         String m_sFileFilter; /**< File filter mask. */
76         String m_sPreDiffer; /**< Pre-differ name. */
77
78         String m_sOutputpath;
79
80         PathContext m_Files; /**< Files (or directories) to compare. */
81
82 private:
83
84         static LPCTSTR EatParam(LPCTSTR, String &, bool *flag = 0);
85         static LPCTSTR SetOption(LPCTSTR, LPCTSTR key, LPCTSTR value = _T("1"));
86         void ParseClearCaseCmdLine(LPCTSTR, LPCTSTR basedesc);
87         void ParseWinMergeCmdLine(LPCTSTR);
88         void AddPath(const String &path);
89
90         /** Operator= is not implemented. */
91         MergeCmdLineInfo& operator=(const MergeCmdLineInfo& rhs);
92 };
93
94 #endif // _MERGE_CMD_LINE_INFO_INCLUDED_