-class FormatNamesEqual : public unary_function<Format, bool> {
-public:
- FormatNamesEqual(string const & name)
- : name_(name) {}
- bool operator()(Format const & f) const
- {
- return f.name() == name_;
- }
-private:
- string name_;
-};
-
-
-class FormatExtensionsEqual : public unary_function<Format, bool> {
-public:
- FormatExtensionsEqual(string const & extension)
- : extension_(extension) {}
- bool operator()(Format const & f) const
- {
- return f.hasExtension(extension_);
- }
-private:
- string extension_;
-};
-
-
-class FormatMimeEqual : public unary_function<Format, bool> {
-public:
- FormatMimeEqual(string const & mime)
- : mime_(mime) {}
- bool operator()(Format const & f) const
- {
- // The test for empty mime strings is needed since we allow
- // formats with empty mime types.
- return f.mime() == mime_ && !mime_.empty();
- }
-private:
- string mime_;
-};
-
-
-class FormatPrettyNameEqual : public unary_function<Format, bool> {
-public:
- FormatPrettyNameEqual(string const & prettyname)
- : prettyname_(prettyname) {}
- bool operator()(Format const & f) const
- {
- return f.prettyname() == prettyname_;
- }
-private:
- string prettyname_;
-};
-
-} //namespace anon