Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginFilter.h

Issue 29331055: Issue #1234 - Remove 'CString' from PluginFilter.* (Closed)
Patch Set: rebase Created Jan. 5, 2016, 4:07 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/plugin/PluginFilter.h
===================================================================
--- a/src/plugin/PluginFilter.h
+++ b/src/plugin/PluginFilter.h
@@ -34,21 +34,17 @@
// CFilterElementHideAttrSelector
// ============================================================================
-class CFilterElementHideAttrSelector
+struct CFilterElementHideAttrSelector
{
+ CFilterElementHideAttrPos m_pos;
+ CFilterElementHideAttrType m_type;
+ std::wstring m_attr;
+ std::wstring m_value;
-public:
-
- CFilterElementHideAttrPos m_pos;
-
- CFilterElementHideAttrType m_type;
-
- CComBSTR m_bstrAttr;
- CString m_value;
-
- CFilterElementHideAttrSelector();
- CFilterElementHideAttrSelector(const CFilterElementHideAttrSelector& filter);
- ~CFilterElementHideAttrSelector();
+ CFilterElementHideAttrSelector()
+ : m_type(TYPE_NONE), m_pos(POS_NONE)
+ {
+ }
};
@@ -68,18 +64,17 @@
TRAVERSER_TYPE_ERROR
};
-
- CString m_filterText;
+ std::wstring m_filterText;
// For domain specific filters only
- CString m_tagId;
- CString m_tagClassName;
- CString m_tag;
+ std::wstring m_tagId;
+ std::wstring m_tagClassName;
+ std::wstring m_tag;
std::vector<CFilterElementHideAttrSelector> m_attributeSelectors;
std::shared_ptr<CFilterElementHide> m_predecessor;
- CFilterElementHide(const CString& filterText="");
+ CFilterElementHide(const std::wstring& filterText = L"");
CFilterElementHide(const CFilterElementHide& filter);
ETraverserComplexType m_type;
@@ -112,7 +107,7 @@
bool m_isFromStart;
bool m_isFromEnd;
int m_hitCount;
- CString m_filterText;
+ std::wstring m_filterText;
CFilter(const CFilter&);
CFilter();
@@ -127,13 +122,13 @@
private:
- CString m_dataPath;
+ std::wstring m_dataPath;
// (Tag,Name) -> Filter
- typedef std::multimap<std::pair<CString,CString>, CFilterElementHide> TFilterElementHideTagsNamed;
+ typedef std::multimap<std::pair<std::wstring, std::wstring>, CFilterElementHide> TFilterElementHideTagsNamed;
// Tag -> Filter
- typedef std::multimap<CString, CFilterElementHide> TFilterElementHideTags;
+ typedef std::multimap<std::wstring, CFilterElementHide> TFilterElementHideTags;
TFilterElementHideTagsNamed m_elementHideTagsId;
@@ -144,11 +139,11 @@
public:
- CPluginFilter(const CString& dataPath = "");
+ CPluginFilter(const std::wstring& dataPath = L"");
bool LoadHideFilters(std::vector<std::wstring> filters);
- bool AddFilterElementHide(CString filter);
+ bool AddFilterElementHide(std::wstring filter);
bool IsElementHidden(const std::wstring& tag, IHTMLElement* pEl, const std::wstring& domain, const std::wstring& indent) const;
« no previous file with comments | « adblockplus.gyp ('k') | src/plugin/PluginFilter.cpp » ('j') | src/plugin/TokenSequence.h » ('J')

Powered by Google App Engine
This is Rietveld