mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:07:44 +00:00
LibPDF: Implement name tree lookups
Name Trees are hierarchical, string-keyed, sorted-by-key dictionary structures in PDF where each node (except the root) specifies the bounds of the values it holds, and either its kids (more nodes) or the key/value pairs it contains. This commit implements a series of lookup calls for finding a key in such name trees. This implementation follows the tree as needed on each lookup, but if that becomes inefficient in the long run we can switch to creating a HashMap with all the contents, which as a drawback will require more memory.
This commit is contained in:
parent
8c79f0e0cf
commit
5420261347
3 changed files with 46 additions and 0 deletions
|
@ -139,6 +139,10 @@ private:
|
|||
|
||||
PDFErrorOr<NonnullRefPtr<Object>> get_inheritable_object(FlyString const& name, NonnullRefPtr<DictObject>);
|
||||
|
||||
PDFErrorOr<NonnullRefPtr<Object>> find_in_name_tree(NonnullRefPtr<DictObject> root, FlyString name);
|
||||
PDFErrorOr<NonnullRefPtr<Object>> find_in_name_tree_nodes(NonnullRefPtr<ArrayObject> siblings, FlyString name);
|
||||
PDFErrorOr<NonnullRefPtr<Object>> find_in_key_value_array(NonnullRefPtr<ArrayObject> key_value_array, FlyString name);
|
||||
|
||||
NonnullRefPtr<DocumentParser> m_parser;
|
||||
RefPtr<DictObject> m_catalog;
|
||||
RefPtr<DictObject> m_trailer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue