MCPcopy Create free account
hub / github.com/WinMerge/winmerge / RunAndGetMessage

Method RunAndGetMessage

Src/MergeFrameCommon.cpp:63–87  ·  view source on GitHub ↗

* @brief Run the binary comparison and get the result message. */

Source from the content-addressed store, hash-verified

61 * @brief Run the binary comparison and get the result message.
62 */
63 String RunAndGetMessage(std::atomic_bool& cancelFlag) override
64 {
65 m_pCancelFlag = &cancelFlag;
66 DIFFITEM di;
67 PathContext paths;
68 for (int i = 0; i < m_paths.GetSize(); ++i)
69 {
70 paths.SetPath(i, paths::GetParentPath(m_paths[i]));
71 di.diffFileInfo[i].path = _T("");
72 di.diffFileInfo[i].filename = paths::FindFileName(m_paths[i]);
73 if (di.diffFileInfo[i].Update(m_paths[i]))
74 di.diffcode.setSideFlag(i);
75 }
76 if (m_paths.GetSize() == 3)
77 di.diffcode.diffcode |= DIFFCODE::THREEWAY;
78 CDiffContext ctxt(paths, CMP_BINARY_CONTENT);
79 ctxt.SetAbortable(this);
80 CompareEngines::BinaryCompare binaryCompare(ctxt);
81 binaryCompare.CompareFiles(di);
82 if (di.diffcode.isResultError())
83 return _("Selected files are identical (with current settings).\r\nBut binary comparison failed.");
84 return di.diffcode.isResultSame()
85 ? _("Selected files are identical (binary match).")
86 : _("Selected files are identical (with current settings).\r\nBut differ at the binary level.");
87 }
88
89private:
90 std::atomic_bool* m_pCancelFlag;

Callers 1

AsyncTaskThreadMethod · 0.80

Calls 10

GetParentPathFunction · 0.85
FindFileNameFunction · 0.85
setSideFlagMethod · 0.80
GetSizeMethod · 0.45
SetPathMethod · 0.45
UpdateMethod · 0.45
SetAbortableMethod · 0.45
CompareFilesMethod · 0.45
isResultErrorMethod · 0.45
isResultSameMethod · 0.45

Tested by

no test coverage detected