diff options
Diffstat (limited to 'include/qpdf/QPDFNameTreeObjectHelper.hh')
-rw-r--r-- | include/qpdf/QPDFNameTreeObjectHelper.hh | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/include/qpdf/QPDFNameTreeObjectHelper.hh b/include/qpdf/QPDFNameTreeObjectHelper.hh index baa6e5e9..1523b142 100644 --- a/include/qpdf/QPDFNameTreeObjectHelper.hh +++ b/include/qpdf/QPDFNameTreeObjectHelper.hh @@ -22,11 +22,11 @@ #ifndef QPDFNAMETREEOBJECTHELPER_HH #define QPDFNAMETREEOBJECTHELPER_HH -#include <qpdf/QPDFObjectHelper.hh> #include <qpdf/QPDFObjGen.hh> +#include <qpdf/QPDFObjectHelper.hh> +#include <iterator> #include <map> #include <memory> -#include <iterator> #include <qpdf/DLL.h> @@ -48,16 +48,14 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper // The qpdf object is required so that this class can issue // warnings, attempt repairs, and add indirect objects. QPDF_DLL - QPDFNameTreeObjectHelper(QPDFObjectHandle, QPDF&, - bool auto_repair = true); + QPDFNameTreeObjectHelper(QPDFObjectHandle, QPDF&, bool auto_repair = true); // ABI: Legacy Constructor will be removed in QPDF 11. A // QPDFNameTreeObjectHelper constructed in this way can't be // modified or repaired and will silently ignore problems in the // structure. - [[deprecated("use constructor that takes QPDF&")]] - QPDF_DLL - QPDFNameTreeObjectHelper(QPDFObjectHandle); + [[deprecated("use constructor that takes QPDF&")]] QPDF_DLL + QPDFNameTreeObjectHelper(QPDFObjectHandle); // Create an empty name tree QPDF_DLL @@ -80,6 +78,7 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper class iterator { friend class QPDFNameTreeObjectHelper; + public: typedef std::pair<std::string, QPDFObjectHandle> T; using iterator_category = std::bidirectional_iterator_tag; @@ -94,7 +93,8 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper QPDF_DLL iterator& operator++(); QPDF_DLL - iterator operator++(int) + iterator + operator++(int) { iterator t = *this; ++(*this); @@ -103,7 +103,8 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper QPDF_DLL iterator& operator--(); QPDF_DLL - iterator operator--(int) + iterator + operator--(int) { iterator t = *this; --(*this); @@ -116,9 +117,10 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper QPDF_DLL bool operator==(iterator const& other) const; QPDF_DLL - bool operator!=(iterator const& other) const + bool + operator!=(iterator const& other) const { - return ! operator==(other); + return !operator==(other); } // DANGER: this method can create inconsistent trees if not @@ -162,8 +164,8 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper // Find the entry with the given key. If return_prev_if_not_found // is true and the item is not found, return the next lower item. QPDF_DLL - iterator find(std::string const& key, - bool return_prev_if_not_found = false); + iterator + find(std::string const& key, bool return_prev_if_not_found = false); // Insert a new item. If the key already exists, it is replaced. QPDF_DLL |