1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:47:45 +00:00

LibPDF: Parse linearized PDF files

This is a big step, as most PDFs which are downloaded online will be
linearized. Pretty much the only difference is that the xref structure
is slightly different.
This commit is contained in:
Matthew Olsson 2021-05-26 22:52:05 -07:00 committed by Ali Mohammad Pur
parent be1be47613
commit e23bfd7252
8 changed files with 270 additions and 45 deletions

View file

@ -124,11 +124,17 @@ public:
[[nodiscard]] ALWAYS_INLINE const HashMap<FlyString, Value>& map() const { return m_map; }
ALWAYS_INLINE bool contains(const FlyString& key) const { return m_map.contains(key); }
template<typename... Args>
bool contains(Args&&... keys) const { return (m_map.contains(keys) && ...); }
ALWAYS_INLINE Optional<Value> get(const FlyString& key) const { return m_map.get(key); }
Value get_value(const FlyString& key) const { return get(key).value(); }
Value get_value(const FlyString& key) const
{
auto value = get(key);
VERIFY(value.has_value());
return value.value();
}
NonnullRefPtr<Object> get_object(Document*, const FlyString& key) const;