OSDN Git Service

Plugins: Fix a crash on Window XP
[winmerge-jp/winmerge-jp.git] / Src / MergeCmdLineInfo.h
index b4ca85f..7d54398 100644 (file)
@@ -1,22 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
-//
 //    WinMerge: An interactive diff/merge utility
 //    Copyright (C) 1997 Dean P. Grimm
-//
-//    This program is free software; you can redistribute it and/or modify
-//    it under the terms of the GNU General Public License as published by
-//    the Free Software Foundation; either version 2 of the License, or
-//    (at your option) any later version.
-//
-//    This program is distributed in the hope that it will be useful,
-//    but WITHOUT ANY WARRANTY; without even the implied warranty of
-//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//    GNU General Public License for more details.
-//
-//    You should have received a copy of the GNU General Public License
-//    along with this program; if not, write to the Free Software
-//    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
+//    SPDX-License-Identifier: GPL-2.0-or-later
 /////////////////////////////////////////////////////////////////////////////
 /** 
  * @file  MergeCmdLineInfo.h
  * @brief MergeCmdLineInfo class declaration.
  *
  */
-// ID line follows -- this is updated by SVN
-// $Id$
+#pragma once
 
-#ifndef _MERGE_CMD_LINE_INFO_INCLUDED_
-#define _MERGE_CMD_LINE_INFO_INCLUDED_
-
-#include <vector>
 #include "UnicodeString.h"
+#include "PathContext.h"
+#include <map>
+#include <optional>
 
 /** 
  * @brief WinMerge's command line handler.
 class MergeCmdLineInfo
 {
 public:
-       MergeCmdLineInfo(LPCTSTR);
+       explicit MergeCmdLineInfo(const TCHAR *);
 
 public:
 
-       int m_nCmdShow; /**< Initial state of the application's window. */
+       enum ExitNoDiff
+       {
+               Disabled, /**< Don't exit. */
+               Exit, /**< Exit and show message. */
+               ExitQuiet, /**< Exit and don't show message. */
+       };
+
+       enum ShowWindowType
+       {
+               SHOWNORMAL = 1,
+               MAXIMIZE = 3,
+               MINIMIZE = 6,
+       };
+
+       enum CompareMethodType
+       {
+               CONTENT,
+               QUICK_CONTENT,
+               BINARY_CONTENT,
+               DATE,
+               DATE_SIZE,
+               SIZE,
+       };
+
+       ShowWindowType m_nCmdShow; /**< Initial state of the application's window. */
 
-       bool m_bClearCaseTool; /**< Running as Rational ClearCase external tool. */
        bool m_bEscShutdown; /**< Pressing ESC will close the application */
-       bool m_bExitIfNoDiff; /**< Exit after telling the user that files are identical. */
+       ExitNoDiff m_bExitIfNoDiff; /**< Exit if files are identical. */
        bool m_bRecurse; /**< Include sub folder in directories compare. */
+       std::optional<CompareMethodType> m_nCompMethod; /**< Compare method */
        bool m_bNonInteractive; /**< Suppress user's notifications. */
-       bool m_bSingleInstance; /**< Allow only one instance of WinMerge executable. */
+       std::optional<int> m_nSingleInstance; /**< Allow only one instance of WinMerge executable. */
        bool m_bShowUsage; /**< Show a brief reminder to command line arguments. */
        int  m_nCodepage;  /**< Codepage. */
+       bool m_bNoPrefs; /**< Do not load or remember options (preferences) */   
+       bool m_bSelfCompare; /**< Compares the specified file with a copy of the file */
 
-       DWORD m_dwLeftFlags; /**< Left side file's behavior options. */
-       DWORD m_dwRightFlags; /**< Right side file's behavior options. */
+       unsigned m_dwLeftFlags; /**< Left side file's behavior options. */
+       unsigned m_dwMiddleFlags; /**< Middle side file's behavior options. */
+       unsigned m_dwRightFlags; /**< Right side file's behavior options. */
 
        String m_sLeftDesc; /**< Left side file's description. */
+       String m_sMiddleDesc; /**< Middle side file's description. */
        String m_sRightDesc; /**< Right side file's description. */
 
        String m_sFileFilter; /**< File filter mask. */
        String m_sPreDiffer; /**< Pre-differ name. */
+       String m_sUnpacker; /**< Unpacker name. */
+
+       String m_sOutputpath;
+       String m_sReportFile;
+
+       PathContext m_Files; /**< Files (or directories) to compare. */
+
+       std::map<String, String> m_Options;
 
-       std::vector<String> m_Files; /**< Files (or directories) to compare. */
+       std::vector<String> m_sErrorMessages;
 
 private:
 
-       static LPCTSTR EatParam(LPCTSTR, String &, bool *flag = 0);
-       static LPCTSTR SetOption(LPCTSTR, LPCTSTR key, LPCTSTR value = _T("1"));
-       void ParseClearCaseCmdLine(LPCTSTR);
-       void ParseWinMergeCmdLine(LPCTSTR);
+       static const TCHAR *EatParam(const TCHAR *, String &, bool *flag = nullptr);
+       const TCHAR *SetOption(const TCHAR *, const String& key, const TCHAR *value = _T("1"));
+       const TCHAR *SetConfig(const TCHAR *);
+       void ParseWinMergeCmdLine(const TCHAR *);
        void AddPath(const String &path);
 
        /** Operator= is not implemented. */
        MergeCmdLineInfo& operator=(const MergeCmdLineInfo& rhs);
 };
 
-#endif // _MERGE_CMD_LINE_INFO_INCLUDED_