mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-01 13:49:05 +00:00
LibGfx/ISOBMFF: Remove Box::read_from_stream()
This doesn't have to be a virtual method: it's called from various create_from_stream() methods that have a static type that's created. There's no point in the virtual call here, and it makes it harder to add additional parameters to read_from_stream() in some subclasses.
This commit is contained in:
parent
c84487ed2d
commit
b7a120c47e
Notes:
sideshowbarker
2024-07-17 03:51:15 +09:00
Author: https://github.com/nico
Commit: b7a120c47e
Pull-request: https://github.com/SerenityOS/serenity/pull/23682
Reviewed-by: https://github.com/LucasChollet
Reviewed-by: https://github.com/Zaggy1024
Reviewed-by: https://github.com/timschumi ✅
1 changed files with 4 additions and 5 deletions
|
@ -31,7 +31,6 @@ ErrorOr<BoxHeader> read_box_header(BoxStream& stream);
|
|||
struct Box {
|
||||
Box() = default;
|
||||
virtual ~Box() = default;
|
||||
virtual ErrorOr<void> read_from_stream(BoxStream&) { return {}; }
|
||||
virtual BoxType box_type() const { return BoxType::None; }
|
||||
virtual void dump(String const& prepend = {}) const;
|
||||
};
|
||||
|
@ -39,7 +38,7 @@ struct Box {
|
|||
using BoxList = Vector<NonnullOwnPtr<Box>>;
|
||||
|
||||
struct FullBox : public Box {
|
||||
virtual ErrorOr<void> read_from_stream(BoxStream& stream) override;
|
||||
ErrorOr<void> read_from_stream(BoxStream& stream);
|
||||
virtual void dump(String const& prepend = {}) const override;
|
||||
|
||||
u8 version { 0 };
|
||||
|
@ -59,7 +58,7 @@ struct UnknownBox final : public Box {
|
|||
{
|
||||
}
|
||||
virtual ~UnknownBox() override = default;
|
||||
virtual ErrorOr<void> read_from_stream(BoxStream&) override;
|
||||
ErrorOr<void> read_from_stream(BoxStream&);
|
||||
virtual BoxType box_type() const override { return m_box_type; }
|
||||
virtual void dump(String const& prepend = {}) const override;
|
||||
|
||||
|
@ -77,7 +76,7 @@ private:
|
|||
} \
|
||||
BoxName() = default; \
|
||||
virtual ~BoxName() override = default; \
|
||||
virtual ErrorOr<void> read_from_stream(BoxStream& stream) override; \
|
||||
ErrorOr<void> read_from_stream(BoxStream& stream); \
|
||||
virtual BoxType box_type() const override \
|
||||
{ \
|
||||
return BoxType::BoxName; \
|
||||
|
@ -96,7 +95,7 @@ struct FileTypeBox final : public Box {
|
|||
// A box that contains other boxes.
|
||||
struct SuperBox : public Box {
|
||||
SuperBox() = default;
|
||||
virtual ErrorOr<void> read_from_stream(BoxStream&) override;
|
||||
ErrorOr<void> read_from_stream(BoxStream&);
|
||||
virtual void dump(String const& prepend = {}) const override;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue