summaryrefslogtreecommitdiff
path: root/.devcontainer
diff options
context:
space:
mode:
authorRodrigo Tobar <rtobarc@gmail.com>2023-01-06 00:19:12 +0800
committerAndreas Kling <kling@serenityos.org>2023-01-06 18:06:41 +0100
commit8c79f0e0cfdc2be6a4f81ae02840f0d5f8d78f53 (patch)
tree985864673bb5d941213ffd0d917da7004e352c85 /.devcontainer
parent0e1c858f90471745ebd51c4664c33bde08ed4257 (diff)
downloadserenity-8c79f0e0cfdc2be6a4f81ae02840f0d5f8d78f53.zip
LibPDF: Add more utility methods to {Dict,Array}Object
Being both of them containers, these classes already offered a set of methods to retrieve an inner element by key or index, respectively, with different methods for the different subtypes of the PDF::Object type returning the element cast to the correct type pointer. On top of that, DictObject offered an additional method to obtain an element as an Object pointer. While these methods were useful, they have some shortcomings: * They always take a Document pointer to first perform an object resolution, in case the element is a Reference. This is not always necessary though, as there are values that are always meant to be immediate, and hence the resolution lookup adds overhead. * There was no easy way to get an individual Object element from an ArrayObject like there is in DictObject. This makes it difficult to obtain such values, as one first needs to call dict.get() to get a Value, then cast it manually to a NonnullRefPtr<Object>. This commit fixes these two issues by: * Adding a new method that returns an Object for a given index. * Adding overloads for this new method, and all the existing methods described above, that do *not* take a Document, and therefore do *not* perform an object resolution lookup.
Diffstat (limited to '.devcontainer')
0 files changed, 0 insertions, 0 deletions