コード例 #1
0
ファイル: TextCompare.cpp プロジェクト: GordonSmith/eclide
//  ===========================================================================
void TextCompare(const std::_tstring & base, const std::_tstring & comp, CLineVector & baseResult, CLineVector & compResult)
{
	if (base.length() == 0 && comp.length() == 0)
		return;

	CTable baseTable(base);
	CTable compTable(comp);
	CAnchors compare(baseTable, compTable, 1);
	compare.GetPaddedResults(baseResult, compResult);
}
コード例 #2
0
 void ShowEcl(const std::_tstring & searchTerm, FINDMODE findmode)
 {
     m_tabbedChildWindow.GetTabCtrl().SetCurSel(0);
     if (searchTerm.length())
     {
         int flags = 0;
         m_dlgview.GetView().DoFind(searchTerm, flags, findmode, true);
     }
 }
コード例 #3
0
ファイル: TextCompare.cpp プロジェクト: GordonSmith/eclide
void CLine::hash_string(const std::_tstring & s)
{
	// Calc Hash
	boost::crc_32_type computer;
	computer.reset();
	computer.process_bytes(s.c_str(), sizeof(TCHAR) * s.length());
	m_hash = computer.checksum();

	// Calc Anchor Hash
	bool prevIsGraph = true;
	static boost::crc_32_type anchorComputer;
	anchorComputer.reset();
	for (unsigned int i = 0; i < s.length(); ++i)
	{
		bool isGraph = iswgraph(s[i]) != 0 || s[i] == '\r' || s[i] == '\n';
		if (isGraph)
			anchorComputer.process_bytes(&s[i], sizeof(TCHAR));
		prevIsGraph = isGraph;
	}
	m_anchorHash = anchorComputer.checksum();
}
コード例 #4
0
ファイル: BookmarksView.cpp プロジェクト: drealeed/eclide
std::_tstring CBookmarksView::FindTag(std::_tstring str, std::_tstring tag, int &index) {
    std::_tstring tagEnd = _T("</") + tag + _T(">");
    std::_tstring foundStr = _T("");
    tag = _T("<") + tag + _T(">");

    int n = static_cast<int>(str.find(tag, index));
    if (n >= 0)
    {
        int tagLen = tag.length();
        int indexEnd = static_cast<int>(str.find(tagEnd, index));
        foundStr = str.substr(n + tagLen, indexEnd - n - tagLen);
        index = indexEnd + tagEnd.length() + 1;
    }
    else
    {
        index = -1;
        foundStr = _T("");
    }
    return foundStr;
}
コード例 #5
0
	bool Has(const std::_tstring & item) const
	{
		return item.length() > 0;
	}