OSDN Git Service

Fix issue #784: Error on try to show differences between two different gif
[winmerge-jp/winmerge-jp.git] / Src / DiffContext.h
index 6482265..4f9af4a 100644 (file)
@@ -3,28 +3,22 @@
  *
  *  @brief Declarations of CDiffContext and diff structures
  */
-// ID line follows -- this is updated by SVN
-// $Id: DiffContext.h 6910 2009-07-12 09:06:54Z kimmov $
-
-#if !defined(AFX_DIFFCONTEXT_H__D3CC86BE_F11E_11D2_826C_00A024706EDC__INCLUDED_)
-#define AFX_DIFFCONTEXT_H__D3CC86BE_F11E_11D2_826C_00A024706EDC__INCLUDED_
 #pragma once
+
 #define POCO_NO_UNWINDOWS 1
 #include <Poco/Mutex.h>
-#include <Poco/ThreadLocal.h>
-#include <boost/scoped_ptr.hpp>
+#include <memory>
 #include "PathContext.h"
-#include "DiffFileInfo.h"
 #include "DiffItemList.h"
+#include "FilterList.h"
+#include "SubstitutionList.h"
 
 class PackingInfo;
 class PrediffingInfo;
 class IDiffFilter;
-struct DIFFITEM;
 class CompareStats;
 class IAbortable;
 class CDiffWrapper;
-class FilterList;
 class CompareOptions;
 struct DIFFOPTIONS;
 
@@ -60,7 +54,7 @@ public:
        CDiffContext(const PathContext & paths, int compareMethod);
        ~CDiffContext();
 
-       void UpdateVersion(DIFFITEM & di, int nIndex) const;
+       void UpdateVersion(DIFFITEM &di, int nIndex) const;
 
        /**
         * Get the main compare method used in this compare.
@@ -111,8 +105,8 @@ public:
        //@}
 
        // change an existing difference
-       bool UpdateInfoFromDiskHalf(DIFFITEM & di, int nIndex);
-       void UpdateStatusFromDisk(Poco::UIntPtr diffpos, int index);
+       bool UpdateInfoFromDiskHalf(DIFFITEM &di, int nIndex);
+       void UpdateStatusFromDisk(DIFFITEM *diffpos, int nIndex);
 
        bool CreateCompareOptions(int compareMethod, const DIFFOPTIONS & options);
        CompareOptions * GetCompareOptions(int compareMethod);
@@ -146,18 +140,22 @@ public:
 
        int GetCompareDirs() const { return m_paths.GetSize(); }
 
+       void Swap(int idx1, int idx2)
+       {
+               String tmp;
+               tmp = m_paths.GetPath(idx1);
+               m_paths.SetPath(idx1, m_paths.GetPath(idx2));
+               m_paths.SetPath(idx2, tmp);
+               DiffItemList::Swap(idx1, idx2);
+       }
+
+       const DIFFOPTIONS *GetOptions() const { return m_pOptions.get(); }
+
        IDiffFilter * m_piFilterGlobal; /**< Interface for file filtering. */
+       IDiffFilter * m_pImgfileFilter; /**< Interface for image file filtering */
        IPluginInfos * m_piPluginInfos;
        int m_iGuessEncodingType;
 
-       /**
-        * The current and effective compare method.
-        * During the compare we may change compare method per file. This may
-        * happen for various reasons. But the change is always temporarily and
-        * we must return to the main method indicated by m_nCompMethod.
-        */
-       Poco::ThreadLocal<int> m_nCurrentCompMethod;
-
        bool m_bIgnoreSmallTimeDiff; /**< Ignore small timedifferences when comparing by date */
        CompareStats *m_pCompareStats; /**< Pointer to compare statistics */
 
@@ -177,6 +175,8 @@ public:
         */
        int m_nQuickCompareLimit;
 
+       int m_nBinaryCompareLimit;
+
        /**
         * Walk into unique folders and add contents.
         * This enables/disables walking into unique folders. If we don't walk into
@@ -188,11 +188,14 @@ public:
         */
        bool m_bWalkUniques;
        bool m_bIgnoreReparsePoints;
+       bool m_bIgnoreCodepage;
+       bool m_bEnableImageCompare;
+       double m_dColorDistanceThreshold;
 
        bool m_bRecursive; /**< Do we include subfolders to compare? */
        bool m_bPluginsEnabled; /**< Are plugins enabled? */
-       boost::scoped_ptr<FilterList> m_pFilterList; /**< Filter list for line filters */
-       CDiffWrapper *m_pDiffWrapper;
+       std::unique_ptr<FilterList> m_pFilterList; /**< Filter list for line filters */
+       std::shared_ptr<SubstitutionList> m_pSubstitutionList; /// list for Substitution Filters
 
 private:
        /**
@@ -203,12 +206,10 @@ private:
         */
        int m_nCompMethod;
 
-       boost::scoped_ptr<DIFFOPTIONS> m_pOptions; /**< Generalized compare options. */
-       boost::scoped_ptr<CompareOptions> m_pContentCompareOptions; /**< Per compare method compare options. */
-       boost::scoped_ptr<CompareOptions> m_pQuickCompareOptions;   /**< Per compare method compare options. */
+       std::unique_ptr<DIFFOPTIONS> m_pOptions; /**< Generalized compare options. */
+       std::unique_ptr<CompareOptions> m_pContentCompareOptions; /**< Per compare method compare options. */
+       std::unique_ptr<CompareOptions> m_pQuickCompareOptions;   /**< Per compare method compare options. */
        PathContext m_paths; /**< (root) paths for this context */
        IAbortable *m_piAbortable; /**< Interface for aborting the compare. */
        Poco::FastMutex m_mutex;
 };
-
-#endif // !defined(AFX_DIFFCONTEXT_H__D3CC86BE_F11E_11D2_826C_00A024706EDC__INCLUDED_)