Add ShouldSkip variant that can read a --match flag directly.
Just seemed like we were going through lots of hoops for this common case.
BUG=
R=scroggo@google.com
Author: mtklein@google.com
Review URL: https://chromiumcodereview.appspot.com/23708009
git-svn-id: http://skia.googlecode.com/svn/trunk@11034 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/flags/SkCommandLineFlags.cpp b/tools/flags/SkCommandLineFlags.cpp
index 084f48a..656a00a 100644
--- a/tools/flags/SkCommandLineFlags.cpp
+++ b/tools/flags/SkCommandLineFlags.cpp
@@ -304,7 +304,10 @@
}
}
-bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const char* name) {
+namespace {
+
+template <typename Strings>
+bool ShouldSkipImpl(const Strings& strings, const char* name) {
int count = strings.count();
size_t testLen = strlen(name);
bool anyExclude = count == 0;
@@ -334,3 +337,12 @@
}
return !anyExclude;
}
+
+} // namespace
+
+bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const char* name) {
+ return ShouldSkipImpl(strings, name);
+}
+bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name) {
+ return ShouldSkipImpl(strings, name);
+}