本文整理汇总了C++中atl::CString::MakeLower方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::MakeLower方法的具体用法?C++ CString::MakeLower怎么用?C++ CString::MakeLower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atl::CString
的用法示例。
在下文中一共展示了CString::MakeLower方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsMatchFilterElementHide
bool CFilterElementHide::IsMatchFilterElementHide(IHTMLElement* pEl) const
{
HRESULT hr;
if (!m_tagId.IsEmpty())
{
CComBSTR id;
hr = pEl->get_id(&id);
if ((hr != S_OK) || (id != CComBSTR(m_tagId)))
{
return false;
}
}
if (!m_tagClassName.IsEmpty())
{
CComBSTR classNameBSTR;
hr = pEl->get_className(&classNameBSTR);
if (hr == S_OK)
{
CString className = classNameBSTR;
int start = 0;
CString specificClass;
bool foundMatch = false;
while ((specificClass = className.Tokenize(L" ", start)) != L"")
{
// TODO: Consider case of multiple classes. (m_tagClassName can be something like "foo.bar")
if (specificClass == m_tagClassName)
{
foundMatch = true;
}
}
if (!foundMatch)
{
return false;
}
}
}
if (!m_tag.IsEmpty())
{
CComBSTR tagName;
hr = pEl->get_tagName(&tagName);
tagName.ToLower();
if ((hr != S_OK) || (tagName != CComBSTR(m_tag)))
{
return false;
}
}
// Check attributes
for (std::vector<CFilterElementHideAttrSelector>::const_iterator attrIt = m_attributeSelectors.begin();
attrIt != m_attributeSelectors.end(); ++ attrIt)
{
ATL::CString value;
bool attrFound = false;
if (attrIt->m_type == CFilterElementHideAttrType::STYLE)
{
CComPtr<IHTMLStyle> pStyle;
if (SUCCEEDED(pEl->get_style(&pStyle)) && pStyle)
{
CComBSTR bstrStyle;
if (SUCCEEDED(pStyle->get_cssText(&bstrStyle)) && bstrStyle)
{
value = bstrStyle;
value.MakeLower();
attrFound = true;
}
}
}
else if (attrIt->m_type == CFilterElementHideAttrType::CLASS)
{
CComBSTR bstrClassNames;
if (SUCCEEDED(pEl->get_className(&bstrClassNames)) && bstrClassNames)
{
value = bstrClassNames;
attrFound = true;
}
}
else if (attrIt->m_type == CFilterElementHideAttrType::ID)
{
CComBSTR bstrId;
if (SUCCEEDED(pEl->get_id(&bstrId)) && bstrId)
{
value = bstrId;
attrFound = true;
}
}
else
{
auto attributeValue = GetHtmlElementAttribute(*pEl, attrIt->m_bstrAttr);
if (attrFound = attributeValue.isAttributeFound)
{
value = ToCString(attributeValue.attributeValue);
}
}
if (attrFound)
{
if (attrIt->m_pos == CFilterElementHideAttrPos::EXACT)
{
//.........这里部分代码省略.........