mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 17:40:27 +00:00
LibWeb/MimeSniff: Add move/copy construct and assignment to MimeType
This change exists to avoid having to reparse a MIME type when we need to move/copy elsewhere.
This commit is contained in:
parent
96d44b1572
commit
a2a61d6941
Notes:
sideshowbarker
2024-07-17 21:11:12 +09:00
Author: https://github.com/kemzeb Commit: https://github.com/SerenityOS/serenity/commit/a2a61d6941 Pull-request: https://github.com/SerenityOS/serenity/pull/21350 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/Lubrsi Reviewed-by: https://github.com/UkuLoskit
2 changed files with 12 additions and 0 deletions
|
@ -64,6 +64,12 @@ MimeType::MimeType(String type, String subtype)
|
|||
VERIFY(!m_subtype.is_empty() && contains_only_http_token_code_points(m_subtype));
|
||||
}
|
||||
|
||||
MimeType::MimeType(MimeType const& other) = default;
|
||||
MimeType& MimeType::operator=(MimeType const& other) = default;
|
||||
|
||||
MimeType::MimeType(MimeType&& other) = default;
|
||||
MimeType& MimeType::operator=(MimeType&& other) = default;
|
||||
|
||||
MimeType::~MimeType() = default;
|
||||
|
||||
ErrorOr<MimeType> MimeType::create(String type, String subtype)
|
||||
|
|
|
@ -20,6 +20,12 @@ public:
|
|||
static ErrorOr<MimeType> create(String type, String subtype);
|
||||
static ErrorOr<Optional<MimeType>> parse(StringView);
|
||||
|
||||
MimeType(MimeType const&);
|
||||
MimeType& operator=(MimeType const&);
|
||||
|
||||
MimeType(MimeType&&);
|
||||
MimeType& operator=(MimeType&&);
|
||||
|
||||
~MimeType();
|
||||
|
||||
String const& type() const { return m_type; }
|
||||
|
|
Loading…
Reference in a new issue