mirror of
https://github.com/qpdf/qpdf.git
synced 2024-05-29 00:10:54 +00:00
Add ostream << for QPDFObjGen
This commit is contained in:
parent
858c7b89bc
commit
3f9191a344
|
@ -1,3 +1,8 @@
|
||||||
|
2020-12-26 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
|
* Add ostream << for QPDFObjGen. (Don't ask why it took 7.5 years
|
||||||
|
for me to decide to do this.)
|
||||||
|
|
||||||
2020-12-25 Jay Berkenbilt <ejb@ql.org>
|
2020-12-25 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
* Refactor write code to eliminate an extra full traversal of
|
* Refactor write code to eliminate an extra full traversal of
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#define QPDFOBJGEN_HH
|
#define QPDFOBJGEN_HH
|
||||||
|
|
||||||
#include <qpdf/DLL.h>
|
#include <qpdf/DLL.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
// This class represents an object ID and generation pair. It is
|
// This class represents an object ID and generation pair. It is
|
||||||
// suitable to use as a key in a map or set.
|
// suitable to use as a key in a map or set.
|
||||||
|
@ -43,6 +44,9 @@ class QPDFObjGen
|
||||||
QPDF_DLL
|
QPDF_DLL
|
||||||
int getGen() const;
|
int getGen() const;
|
||||||
|
|
||||||
|
QPDF_DLL
|
||||||
|
friend std::ostream& operator<<(std::ostream&, const QPDFObjGen&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// This class does not use the Members pattern to avoid a memory
|
// This class does not use the Members pattern to avoid a memory
|
||||||
// allocation for every one of these. A lot of these get created
|
// allocation for every one of these. A lot of these get created
|
||||||
|
|
|
@ -36,3 +36,9 @@ QPDFObjGen::getGen() const
|
||||||
{
|
{
|
||||||
return this->gen;
|
return this->gen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::ostream& operator<<(std::ostream& os, const QPDFObjGen& og)
|
||||||
|
{
|
||||||
|
os << og.obj << "," << og.gen;
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user