Commit c810f0f21edf7416c6e7944d6b1619e308c764c3
1 parent
db8a02c2
TODO: QPDFObject parent idea
Showing
1 changed file
with
23 additions
and
0 deletions
TODO
| @@ -8,6 +8,29 @@ Before Release: | @@ -8,6 +8,29 @@ Before Release: | ||
| 8 | * Stay on top of https://github.com/pikepdf/pikepdf/pull/315 | 8 | * Stay on top of https://github.com/pikepdf/pikepdf/pull/315 |
| 9 | * Release qtest with updates to qtest-driver and copy back into qpdf | 9 | * Release qtest with updates to qtest-driver and copy back into qpdf |
| 10 | 10 | ||
| 11 | +Parent pointer idea: | ||
| 12 | + | ||
| 13 | +* Have replaceKey, removeKey, and eraseItem return the old values. The | ||
| 14 | + comments will clarify the difference between these and the andGet | ||
| 15 | + versions. | ||
| 16 | +* Add std::weak_ptr<QPDFObject> parent to QPDFObject. When adding a | ||
| 17 | + direct object to an array or dictionary, set its parent. When | ||
| 18 | + removing it, clear the parent pointer. | ||
| 19 | +* When a direct object that already has a parent is added to | ||
| 20 | + something, it is a warning and will become an error in qpdf 12. | ||
| 21 | + There needs to be unsafe add methods used by unsafeShallowCopy. | ||
| 22 | + These will add but not modify the parent pointer. | ||
| 23 | + | ||
| 24 | +This allows an object to be moved from one object to another by | ||
| 25 | +removing it, which returns the now orphaned object, and then inserting | ||
| 26 | +it somewhere else. It also doesn't break the pattern of adding a | ||
| 27 | +direct object to something and subsequently mutating it. It just | ||
| 28 | +prevents the same object from being added to more than one thing. | ||
| 29 | + | ||
| 30 | +Note that arrays and dictionaries still need to contain | ||
| 31 | +QPDFObjectHandle because of indirect objects. This only pertains to | ||
| 32 | +direct objects, which are always "resolved" in QPDFObjectHandle. | ||
| 33 | + | ||
| 11 | Next: | 34 | Next: |
| 12 | * JSON v2 fixes | 35 | * JSON v2 fixes |
| 13 | 36 |