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

Class Comp02Functor

Src/DiffWrapper.cpp:1421–1448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1419}
1420
1421struct Comp02Functor
1422{
1423 Comp02Functor(const file_data * inf10, const file_data * inf12) :
1424 inf10_(inf10), inf12_(inf12)
1425 {
1426 }
1427 bool operator()(const DiffRangeInfo &dr3)
1428 {
1429 int line0 = dr3.begin[0];
1430 int line2 = dr3.begin[2];
1431 int line0end = dr3.end[0];
1432 int line2end = dr3.end[2];
1433 if (line0end - line0 != line2end - line2)
1434 return false;
1435 const char **linbuf0 = inf10_[1].linbuf + inf10_[1].linbuf_base;
1436 const char **linbuf2 = inf12_[1].linbuf + inf12_[1].linbuf_base;
1437 for (int i = 0; i < line0end - line0 + 1; ++i)
1438 {
1439 const size_t line0len = linbuf0[line0 + i + 1] - linbuf0[line0 + i];
1440 const size_t line2len = linbuf2[line2 + i + 1] - linbuf2[line2 + i];
1441 if (line_cmp(linbuf0[line0 + i], line0len, linbuf2[line2 + i], line2len) != 0)
1442 return false;
1443 }
1444 return true;
1445 }
1446 const file_data *inf10_;
1447 const file_data *inf12_;
1448};
1449
1450/**
1451 * @brief Walk the diff utils change script, building the WinMerge list of diff blocks

Calls

no outgoing calls

Tested by

no test coverage detected