Commit 3f9191a34456e79ec6d98bfe46546d9df9abdcba
1 parent
858c7b89
Add ostream << for QPDFObjGen
Showing
3 changed files
with
15 additions
and
0 deletions
ChangeLog
| 1 | +2020-12-26 Jay Berkenbilt <ejb@ql.org> | ||
| 2 | + | ||
| 3 | + * Add ostream << for QPDFObjGen. (Don't ask why it took 7.5 years | ||
| 4 | + for me to decide to do this.) | ||
| 5 | + | ||
| 1 | 2020-12-25 Jay Berkenbilt <ejb@ql.org> | 6 | 2020-12-25 Jay Berkenbilt <ejb@ql.org> |
| 2 | 7 | ||
| 3 | * Refactor write code to eliminate an extra full traversal of | 8 | * Refactor write code to eliminate an extra full traversal of |
include/qpdf/QPDFObjGen.hh
| @@ -23,6 +23,7 @@ | @@ -23,6 +23,7 @@ | ||
| 23 | #define QPDFOBJGEN_HH | 23 | #define QPDFOBJGEN_HH |
| 24 | 24 | ||
| 25 | #include <qpdf/DLL.h> | 25 | #include <qpdf/DLL.h> |
| 26 | +#include <iostream> | ||
| 26 | 27 | ||
| 27 | // This class represents an object ID and generation pair. It is | 28 | // This class represents an object ID and generation pair. It is |
| 28 | // suitable to use as a key in a map or set. | 29 | // suitable to use as a key in a map or set. |
| @@ -43,6 +44,9 @@ class QPDFObjGen | @@ -43,6 +44,9 @@ class QPDFObjGen | ||
| 43 | QPDF_DLL | 44 | QPDF_DLL |
| 44 | int getGen() const; | 45 | int getGen() const; |
| 45 | 46 | ||
| 47 | + QPDF_DLL | ||
| 48 | + friend std::ostream& operator<<(std::ostream&, const QPDFObjGen&); | ||
| 49 | + | ||
| 46 | private: | 50 | private: |
| 47 | // This class does not use the Members pattern to avoid a memory | 51 | // This class does not use the Members pattern to avoid a memory |
| 48 | // allocation for every one of these. A lot of these get created | 52 | // allocation for every one of these. A lot of these get created |
libqpdf/QPDFObjGen.cc