diff3.push_back(dr3);
-#ifdef _DEBUG
- Poco::Debugger::message(Poco::format("left=%d,%d middle=%d,%d right=%d,%d",
- dr3.begin[0], dr3.end[0], dr3.begin[1], dr3.end[1], dr3.begin[2], dr3.end[2]));
- Poco::Debugger::message(Poco::format("op=%d\n", (int)dr3.op));
-#endif
-
diff3i++;
diff10i = diff10itmp;
diff12i = diff12itmp;
#endif
static bool IsTextFileStylePure(const UniMemFile::txtstats & stats);
-static CString GetLineByteTimeReport(UINT lines, int64_t bytes,
- const COleDateTime & start);
static void EscapeControlChars(String &s);
static CRLFSTYLE GetTextFileStyle(const UniMemFile::txtstats & stats);
}
/**
- * @brief Return a string giving #lines and #bytes and how much time elapsed.
- * @param [in] lines Count of lines.
- * @param [in] bytes Count of bytes.
- * @param [in] start Time used.
- * @return Formatted string.
- */
-static CString GetLineByteTimeReport(UINT lines, int64_t bytes,
- const COleDateTime & start)
-{
- String sLines = locality::NumToLocaleStr((int)lines);
- String sBytes = locality::NumToLocaleStr(bytes);
- COleDateTimeSpan duration = COleDateTime::GetCurrentTime() - start;
- String sMinutes = locality::NumToLocaleStr((int)duration.GetTotalMinutes());
- CString str;
- str.Format(_T("%s lines (%s byte) saved in %sm%02ds")
- , sLines.c_str(), sBytes.c_str(), sMinutes.c_str()
- , duration.GetSeconds()
- );
- return str;
-}
-
-/**
* @brief Escape control characters.
* @param [in,out] s Line of text excluding eol chars.
*
String eol, preveol;
String sline;
bool done = false;
-#ifdef _DEBUG
- UINT next_line_report = 100; // for trace messages
- UINT next_line_multiple = 5; // for trace messages
-#endif
COleDateTime start = COleDateTime::GetCurrentTime(); // for trace messages
// Manually grow line array exponentially
AppendLine(lineno, sline.c_str(), sline.length());
++lineno;
preveol = eol;
-
-#ifdef _DEBUG
- // send occasional line counts to trace
- // (at 100, 500, 1000, 5000, etc)
- if (lineno == next_line_report)
- {
- int64_t dwBytesRead = pufile->GetPosition();
- COleDateTimeSpan duration = COleDateTime::GetCurrentTime() - start;
- if (duration.GetTotalMinutes() > 0)
- {
- CString strace = GetLineByteTimeReport(lineno, dwBytesRead, start);
- TRACE(_T("%s\n"), (LPCTSTR)strace);
- }
- next_line_report = next_line_multiple * next_line_report;
- next_line_multiple = (next_line_multiple == 5) ? 2 : 5;
- }
-#endif // _DEBUG
} while (!done);
-#ifdef _DEBUG
- // Send report of duration to trace (if it took a while)
- COleDateTime end = COleDateTime::GetCurrentTime();
- COleDateTimeSpan duration = end - start;
- if (duration.GetTotalMinutes() > 0)
- {
- int64_t dwBytesRead = pufile->GetPosition();
- CString strace = GetLineByteTimeReport(lineno, dwBytesRead, start);
- TRACE(_T("%s\n"), (LPCTSTR)strace);
- }
-#endif // _DEBUG
-
// fix array size (due to our manual exponential growth
m_aLines.resize(lineno);
}
AddDiffRange(m_pDiffList, trans_a0-1, trans_b0-1, trans_a1-1, trans_b1-1, op);
-#ifdef _DEBUG
- Debugger::message(format("left=%d,%d right=%d,%d op=%d\n",
- trans_a0-1, trans_b0-1, trans_a1-1, trans_b1-1, (int)op));
-#endif
}
}
}
AddDiffRange(pdiff, trans_a0-1, trans_b0-1, trans_a1-1, trans_b1-1, op);
-#ifdef _DEBUG
- Debugger::message(format("left=%d,%d right=%d,%d op=%d\n",
- trans_a0-1, trans_b0-1, trans_a1-1, trans_b1-1, op));
-#endif
}
}
break;
// Comparing directories leftDirs[i].name to rightDirs[j].name
-#ifdef _DEBUG
-TCHAR buf[1024];
-if (nDirs == 2)
- wsprintf(buf, _T("%s %s\n"), (i < dirs[0].size()) ? dirs[0][i].filename.get().c_str() : _T(""), (j < dirs[1].size()) ? dirs[1][j].filename.get().c_str() : _T(""));
-else
- wsprintf(buf, _T("%s %s %s\n"), (i < dirs[0].size()) ? dirs[0][i].filename.get().c_str() : _T(""), (j < dirs[1].size()) ? dirs[1][j].filename.get().c_str() : _T(""), (k < dirs[2].size()) ? dirs[2][k].filename.get().c_str() : _T(""));
-OutputDebugString(buf);
-#endif
-
if (i<dirs[0].size() && (j==dirs[1].size() || collstr(dirs[0][i].filename, dirs[1][j].filename, casesensitive)<0)
&& (nDirs < 3 || (k==dirs[2].size() || collstr(dirs[0][i].filename, dirs[2][k].filename, casesensitive)<0) ))
{
depth - 1, me, bUniques);
if (result == -1)
return -1;
-/*
- if (result == 0)
- {
- if (!(nDiffCode & DIFFCODE::FIRST) || !(nDiffCode & DIFFCODE::SECOND))
- {
- AddToList(subdir[0], subdir[1],
- nDiffCode & DIFFCODE::FIRST ? &dirs[0][i] : NULL,
- nDiffCode & DIFFCODE::SECOND ? &dirs[1][j] : NULL,
- nDiffCode, myStruct, parent);
- }
- }
-*/
}
}
else
depth - 1, me, bUniques);
if (result == -1)
return -1;
-/*
- if (result == 0)
- {
- if (!(nDiffCode & DIFFCODE::FIRST) || !(nDiffCode & DIFFCODE::SECOND) || !(nDiffCode & DIFFCODE::THIRD))
- {
- AddToList(subdir[0], subdir[1], subdir[2],
- nDiffCode & DIFFCODE::FIRST ? &dirs[0][i] : NULL,
- nDiffCode & DIFFCODE::SECOND ? &dirs[1][j] : NULL,
- nDiffCode & DIFFCODE::THIRD ? &dirs[2][k] : NULL,
- nDiffCode, myStruct, parent);
- }
- }
-*/
}
}
}
// Comparing file files[0][i].name to files[1][j].name
-#ifdef _DEBUG
-TCHAR buf[1024];
-if (nDirs == 2)
- wsprintf(buf, _T("%s %s\n"), (i < files[0].size()) ? files[0][i].filename.get().c_str() : _T(""), (j < files[1].size()) ? files[1][j].filename.get().c_str() : _T(""));
-else
- wsprintf(buf, _T("%s %s %s\n"), (i < files[0].size()) ? files[0][i].filename.get().c_str() : _T(""), (j < files[1].size()) ? files[1][j].filename.get().c_str() : _T(""),
-(k < files[2].size()) ? files[2][k].filename.get().c_str() : _T(""));
-OutputDebugString(buf);
-#endif
if (i<files[0].size() && (j==files[1].size() ||
collstr(files[0][i].filename, files[1][j].filename, casesensitive) < 0)
&& (nDirs < 3 ||
{
DeleteAllDisplayItems();
- ValidateColumnOrdering();
SaveColumnOrders();
SaveColumnWidths();
String GetColDescription(int col) const;
int GetColLogCount() const;
void LoadColumnOrders();
- void ValidateColumnOrdering();
void ClearColumnOrders();
void ResetColumnOrdering();
void MoveColumn(int psrc, int pdest);
{
ResetColumnOrdering();
}
-
- ValidateColumnOrdering();
-}
-
-/**
- * @brief Sanity check column ordering
- */
-void CDirView::ValidateColumnOrdering()
-{
-
-#if _DEBUG
- ASSERT(m_invcolorder[0]>=0);
- ASSERT(m_numcols == GetColLogCount());
- // Check that any logical->physical mapping is reversible
- for (int i=0; i<m_numcols; ++i)
- {
- int phy = m_colorder[i];
- if (phy >= 0)
- {
- int log = m_invcolorder[phy];
- ASSERT(i == log);
- }
- }
- // Bail out if header doesn't exist yet
- int hdrcnt = GetListCtrl().GetHeaderCtrl()->GetItemCount();
- if (hdrcnt)
- {
- ASSERT(hdrcnt == m_dispcols);
- }
- return;
-#endif
}
/**
++m_dispcols;
}
}
- ValidateColumnOrdering();
}
/**
if (m_colorder[i] >= 0)
m_invcolorder[m_colorder[i]] = i;
}
- ValidateColumnOrdering();
InitiateSort();
- ValidateColumnOrdering();
}
/**
ReloadColumns();
Redisplay();
}
- ValidateColumnOrdering();
}
diffmap.InitDiffMap(nlines0);
AdjustDiffBlock(diffmap, diffrange, lo0, hi0, lo1, hi1);
-#ifdef _DEBUG
- std::vector<int>::const_iterator iter = diffmap.m_map.begin();
- int i = 0;
- while (iter != diffmap.m_map.end())
- {
- TCHAR buf[256];
- wsprintf(buf, _T("begin[0]=%d begin[1]=%d diffmap[%d]=%d\n"),
- diffrange.begin[0], diffrange.begin[1], i, diffmap.m_map[i]);
- OutputDebugString(buf);
- iter++;
- i++;
- }
-#endif
-
// divide diff blocks
DIFFRANGE dr;
int line0, line1, lineend0;
m_diffList.Clear();
nDiffCount = newDiffList.GetSize();
for (nDiff = 0; nDiff < nDiffCount; nDiff++)
- {
-#ifdef _DEBUG
- TCHAR buf[256];
- DIFFRANGE di = *newDiffList.DiffRangeAt(nDiff);
- wsprintf(buf, _T("%d: begin[0]=%d end[0]=%d begin[1]=%d end[1]=%d\n"), nDiff,
- di.begin[0], di.end[0], di.begin[1], di.end[1]);
- OutputDebugString(buf);
-#endif
m_diffList.AddDiff(*newDiffList.DiffRangeAt(nDiff));
- }
}
/**
BEGIN_MESSAGE_MAP(COpenDoc, CDocument)
END_MESSAGE_MAP()
-
-
-// COpenDoc diagnostics
-
-#ifdef _DEBUG
-void COpenDoc::AssertValid() const
-{
- CDocument::AssertValid();
-}
-
-void COpenDoc::Dump(CDumpContext& dc) const
-{
- CDocument::Dump(dc);
-}
-#endif //_DEBUG
-
public:
COpenDoc();
virtual ~COpenDoc();
-#ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
-#endif
DWORD m_dwFlags[3];
PathContext m_files;
return CMDIChildWnd::DestroyWindow();
}
-// COpenFrame diagnostics
-
-#ifdef _DEBUG
-void COpenFrame::AssertValid() const
-{
- CMDIChildWnd::AssertValid();
-}
-
-void COpenFrame::Dump(CDumpContext& dc) const
-{
- CMDIChildWnd::Dump(dc);
-}
-
-#endif //_DEBUG
-
-
// COpenFrame message handlers
// Implementation
public:
virtual ~COpenFrame();
-#ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
-#endif
// Generated message map functions
protected:
// COpenView diagnostics
#ifdef _DEBUG
-void COpenView::AssertValid() const
-{
- CFormView::AssertValid();
-}
-
-void COpenView::Dump(CDumpContext& dc) const
-{
- CFormView::Dump(dc);
-}
-
COpenDoc* COpenView::GetDocument() const // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(COpenDoc)));
// Implementation
public:
virtual ~COpenView();
-#ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
-#endif
protected:
void SetStatus(UINT msgID);