diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-02-25 17:24:38 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-02-25 17:24:56 +0100 |
commit | e7ecc348f9c48af9a04a5426ca30b9f414ba12d9 (patch) | |
tree | 7dc89aa075946f5323a56a98611eaeedd12569e4 | |
parent | 527810e939816190e491db7c0a308100d255da85 (diff) | |
download | qpdf-e7ecc348f9c48af9a04a5426ca30b9f414ba12d9.tar.zst |
TODO: clarify fluent interfaces for QPDFObjectHandle
-rw-r--r-- | TODO | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -511,13 +511,17 @@ Comments appear in the code prefixed by "ABI" valid. * Use `= delete` and `= default` for constructors and destructors where possible -* Consider having setters return Class& where possible to allow for - use of fluent interfaces -* Consider having addArrayItem, replaceKey, etc. return the new value - so you can say - auto oh = dict.replaceKey("/Key", QPDFObjectHandle::newSomething()); - But this has to be clean with respect to fluent interfaces, so we - might need something slightly different. +* Having QPDFObjectHandle setters return Class& to allow for + use of fluent interfaces. This includes array and dictionary + mutators. + newDictionary().replaceKey("/X", "1"_qpdf),replaceKey("/Y", "(asdf)"_qpdf); +* Add replaceKeyAndGet, appendItemAndGet, setArrayItemAndGet, + insertItemAndGet that return the new item so you can say + auto oh = dict.replaceKeyAndGet("/Key", QPDFObjectHandle::newSomething()); +* Add getOrInsertKey("/X", oh) that returns the existing value or adds + oh as the new value and returns it. +* Add default values to the getters, like getIntValue(default_value). + If a default value is passed in, you never get a type warning. * Added QPDFObjectHandle::ParserCallbacks::handleWarning but had to revert because it was not binary compatible. Consider re-adding. The commit that added this comment includes the reverting of the change. |