|
@@ -20,19 +20,19 @@ class MimeData : public EventReceiver {
|
|
public:
|
|
public:
|
|
virtual ~MimeData() = default;
|
|
virtual ~MimeData() = default;
|
|
|
|
|
|
- ByteBuffer data(DeprecatedString const& mime_type) const { return m_data.get(mime_type).value_or({}); }
|
|
|
|
|
|
+ ByteBuffer data(StringView mime_type) const { return m_data.get(mime_type).value_or({}); }
|
|
void set_data(DeprecatedString const& mime_type, ByteBuffer&& data) { m_data.set(mime_type, move(data)); }
|
|
void set_data(DeprecatedString const& mime_type, ByteBuffer&& data) { m_data.set(mime_type, move(data)); }
|
|
|
|
|
|
- bool has_format(DeprecatedString const& mime_type) const { return m_data.contains(mime_type); }
|
|
|
|
|
|
+ bool has_format(StringView mime_type) const { return m_data.contains(mime_type); }
|
|
Vector<DeprecatedString> formats() const;
|
|
Vector<DeprecatedString> formats() const;
|
|
|
|
|
|
// Convenience helpers for "text/plain"
|
|
// Convenience helpers for "text/plain"
|
|
- bool has_text() const { return has_format("text/plain"); }
|
|
|
|
|
|
+ bool has_text() const { return has_format("text/plain"sv); }
|
|
DeprecatedString text() const;
|
|
DeprecatedString text() const;
|
|
void set_text(DeprecatedString const&);
|
|
void set_text(DeprecatedString const&);
|
|
|
|
|
|
// Convenience helpers for "text/uri-list"
|
|
// Convenience helpers for "text/uri-list"
|
|
- bool has_urls() const { return has_format("text/uri-list"); }
|
|
|
|
|
|
+ bool has_urls() const { return has_format("text/uri-list"sv); }
|
|
Vector<URL> urls() const;
|
|
Vector<URL> urls() const;
|
|
ErrorOr<void> set_urls(Vector<URL> const&);
|
|
ErrorOr<void> set_urls(Vector<URL> const&);
|
|
|
|
|