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

Unified Diff: shell/src/MatchesCommand.cpp

Issue 10100009: FilterEngine API improvements (Closed)
Patch Set: Created April 4, 2013, 5:04 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: shell/src/MatchesCommand.cpp
===================================================================
--- a/shell/src/MatchesCommand.cpp
+++ b/shell/src/MatchesCommand.cpp
@@ -10,29 +10,31 @@ MatchesCommand::MatchesCommand(AdblockPl
void MatchesCommand::operator()(const std::string& arguments)
{
std::istringstream argumentStream(arguments);
std::string url;
argumentStream >> url;
std::string contentType;
argumentStream >> contentType;
- if (!url.size() || !contentType.size())
+ std::string documentUrl;
+ argumentStream >> documentUrl;
+ if (!url.size() || !contentType.size() || !documentUrl.size())
{
ShowUsage();
return;
}
- if (filterEngine.Matches(url, contentType))
+ if (filterEngine.Matches(url, contentType, documentUrl))
std::cout << "Match" << std::endl;
else
std::cout << "No match" << std::endl;
}
std::string MatchesCommand::GetDescription() const
{
return "Returns the first filter that matches the supplied URL";
}
std::string MatchesCommand::GetUsage() const
{
- return name + " URL CONTENT_TYPE";
+ return name + " URL CONTENT_TYPE DOCUMENT_URL";
}

Powered by Google App Engine
This is Rietveld