Index: extensions/common/url_pattern_set.cc |
diff --git a/extensions/common/url_pattern_set.cc b/extensions/common/url_pattern_set.cc |
index a04d6346d7e470446da5d9d3e2d670a50ff1e5e6..1f06be430246b1bc00e8d10e0700ce4205abdd01 100644 |
--- a/extensions/common/url_pattern_set.cc |
+++ b/extensions/common/url_pattern_set.cc |
@@ -99,6 +99,24 @@ bool URLPatternSet::operator==(const URLPatternSet& other) const { |
return patterns_ == other.patterns_; |
} |
+std::ostream& operator<<(std::ostream& out, |
+ const URLPatternSet& url_pattern_set) { |
+ out << "{ "; |
+ std::set<URLPattern>::const_iterator end = url_pattern_set.patterns().end(); |
+ if (!url_pattern_set.patterns().empty()) |
+ --end; |
+ |
+ copy(url_pattern_set.patterns().begin(), |
Jeffrey Yasskin
2014/05/28 21:06:08
Heh. Nice use of the STL, but I think it'll wind u
aboxhall
2014/05/28 22:06:44
Done (not much simpler actually!)
|
+ end, |
+ std::ostream_iterator<URLPattern>(out, ", ")); |
+ |
+ if (!url_pattern_set.patterns().empty()) |
+ out << *end << " "; |
+ |
+ out << "}"; |
+ return out; |
+} |
+ |
bool URLPatternSet::is_empty() const { |
return patterns_.empty(); |
} |