mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:54:58 +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
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…
Add table
Add a link
Reference in a new issue