OSDN Git Service

Merge from rev.7121:7123
[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
36 /** 
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.
40  */
41 class MergeCmdLineInfo
42 {
43 public:
44         MergeCmdLineInfo(LPCTSTR);
45
46 public:
47
48         enum ExitNoDiff
49         {
50                 Disabled, /**< Don't exit. */
51                 Exit, /**< Exit and show message. */
52                 ExitQuiet, /**< Exit and don't show message. */
53         };
54
55         int m_nCmdShow; /**< Initial state of the application's window. */
56
57         bool m_bClearCaseTool; /**< Running as Rational ClearCase external tool. */
58         bool m_bEscShutdown; /**< Pressing ESC will close the application */
59         ExitNoDiff m_bExitIfNoDiff; /**< Exit if files are identical. */
60         bool m_bRecurse; /**< Include sub folder in directories compare. */
61         bool m_bNonInteractive; /**< Suppress user's notifications. */
62         bool m_bSingleInstance; /**< 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
66         DWORD m_dwLeftFlags; /**< Left side file's behavior options. */
67         DWORD m_dwMiddleFlags; /**< Middle side file's behavior options. */
68         DWORD m_dwRightFlags; /**< Right side file's behavior options. */
69
70         String m_sLeftDesc; /**< Left side file's description. */
71         String m_sMiddleDesc; /**< Middle side file's description. */
72         String m_sRightDesc; /**< Right side file's description. */
73
74         String m_sFileFilter; /**< File filter mask. */
75         String m_sPreDiffer; /**< Pre-differ name. */
76
77         String m_sOutputpath;
78
79         PathContext m_Files; /**< Files (or directories) to compare. */
80
81 private:
82
83         static LPCTSTR EatParam(LPCTSTR, String &, bool *flag = 0);
84         static LPCTSTR SetOption(LPCTSTR, LPCTSTR key, LPCTSTR value = _T("1"));
85         void ParseClearCaseCmdLine(LPCTSTR);
86         void ParseWinMergeCmdLine(LPCTSTR);
87         void AddPath(const String &path);
88
89         /** Operator= is not implemented. */
90         MergeCmdLineInfo& operator=(const MergeCmdLineInfo& rhs);
91 };
92
93 #endif // _MERGE_CMD_LINE_INFO_INCLUDED_