OSDN Git Service

PATCH: [ 2725549 ] Set a codepage with command-line parameter
[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$
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         int m_nCmdShow; /**< Initial state of the application's window. */
49
50         bool m_bClearCaseTool; /**< Running as Rational ClearCase external tool. */
51         bool m_bEscShutdown; /**< Pressing ESC will close the application */
52         bool m_bExitIfNoDiff; /**< Exit after telling the user that files are identical. */
53         bool m_bRecurse; /**< Include sub folder in directories compare. */
54         bool m_bNonInteractive; /**< Suppress user's notifications. */
55         bool m_bSingleInstance; /**< Allow only one instance of WinMerge executable. */
56         bool m_bShowUsage; /**< Show a brief reminder to command line arguments. */
57         int  m_nCodepage;  /**< Codepage. */
58
59         DWORD m_dwLeftFlags; /**< Left side file's behavior options. */
60         DWORD m_dwRightFlags; /**< Right side file's behavior options. */
61
62         String m_sLeftDesc; /**< Left side file's description. */
63         String m_sRightDesc; /**< Right side file's description. */
64
65         String m_sFileFilter; /**< File filter mask. */
66         String m_sPreDiffer; /**< Pre-differ name. */
67
68         std::vector<String> m_Files; /**< Files (or directories) to compare. */
69
70 private:
71
72         static LPCTSTR EatParam(LPCTSTR, String &, bool *flag = 0);
73         static LPCTSTR SetOption(LPCTSTR, LPCTSTR key, LPCTSTR value = _T("1"));
74         void ParseClearCaseCmdLine(LPCTSTR);
75         void ParseWinMergeCmdLine(LPCTSTR);
76         void AddPath(const String &path);
77
78         /** Operator= is not implemented. */
79         MergeCmdLineInfo& operator=(const MergeCmdLineInfo& rhs);
80 };
81
82 #endif // _MERGE_CMD_LINE_INFO_INCLUDED_