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

Delta Between Two Patch Sets: compiled/filter/RegExpFilter.cpp

Issue 29613616: Issue 6064 - Put C++ code into a configurable namespace (Closed) Base URL: https://github.com/adblockplus/adblockpluscore.git
Left Patch Set: Created Nov. 21, 2017, 1:53 p.m.
Right Patch Set: rebase Created Feb. 6, 2018, 9:54 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 { 213 {
214 data.mSitekeysStart = valueStart; 214 data.mSitekeysStart = valueStart;
215 data.mSitekeysEnd = valueEnd; 215 data.mSitekeysEnd = valueEnd;
216 } 216 }
217 } 217 }
218 else if (name.equals(u"match-case"_str)) 218 else if (name.equals(u"match-case"_str))
219 data.mMatchCase = !reverse; 219 data.mMatchCase = !reverse;
220 else if (name.equals(u"third-party"_str)) 220 else if (name.equals(u"third-party"_str))
221 data.mThirdParty = reverse ? TrippleState::NO : TrippleState::YES; 221 data.mThirdParty = reverse ? TrippleState::NO : TrippleState::YES;
222 else if (name.equals(u"collapse"_str)) 222 else if (name.equals(u"collapse"_str))
223 data.mCollapse = reverse ? TrippleState::NO : TrippleState::YES; 223 data.mCollapse = !reverse;
224 else 224 else
225 error.reset(u"filter_unknown_option"_str); 225 error.reset(u"filter_unknown_option"_str);
226 } 226 }
227 227
228 void ParseOptions(String& text, DependentString& error, RegExpFilterData& data , 228 void ParseOptions(String& text, DependentString& error, RegExpFilterData& data ,
229 String::size_type optionsStart) 229 String::size_type optionsStart)
230 { 230 {
231 data.mMatchCase = false; 231 data.mMatchCase = false;
232 data.mThirdParty = TrippleState::ANY; 232 data.mThirdParty = TrippleState::ANY;
233 data.mCollapse = TrippleState::ANY; 233 data.mCollapse = true;
234 data.mDomainsStart = String::npos; 234 data.mDomainsStart = String::npos;
235 data.mSitekeysStart = String::npos; 235 data.mSitekeysStart = String::npos;
236 if (optionsStart >= text.length()) 236 if (optionsStart >= text.length())
237 { 237 {
238 data.mContentType = defaultTypeMask; 238 data.mContentType = defaultTypeMask;
239 return; 239 return;
240 } 240 }
241 241
242 data.mContentType = -1; 242 data.mContentType = -1;
243 243
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 return false; 390 return false;
391 } 391 }
392 392
393 if (!mData.RegExpParsingDone()) 393 if (!mData.RegExpParsingDone())
394 { 394 {
395 const OwnedString pattern(mData.GetRegExpSource(mText)); 395 const OwnedString pattern(mData.GetRegExpSource(mText));
396 mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase)) ; 396 mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase)) ;
397 } 397 }
398 return TestRegExp(mData.mRegexpId, location); 398 return TestRegExp(mData.mRegexpId, location);
399 } 399 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld