Commit a76decd2d59f8d23791013d822e65b4363d450cd
1 parent
7540d208
Add QPDFObjGen::unparse
Showing
3 changed files
with
12 additions
and
0 deletions
ChangeLog
| 1 | 2021-02-21 Jay Berkenbilt <ejb@ql.org> | 1 | 2021-02-21 Jay Berkenbilt <ejb@ql.org> |
| 2 | 2 | ||
| 3 | + * Add QPDFObjGen::unparse() | ||
| 4 | + | ||
| 3 | * Add QPDFObjectHandle::copyStream() for making a copy of a stream | 5 | * Add QPDFObjectHandle::copyStream() for making a copy of a stream |
| 4 | within the same QPDF instance. | 6 | within the same QPDF instance. |
| 5 | 7 |
include/qpdf/QPDFObjGen.hh
| @@ -43,6 +43,8 @@ class QPDFObjGen | @@ -43,6 +43,8 @@ class QPDFObjGen | ||
| 43 | int getObj() const; | 43 | int getObj() const; |
| 44 | QPDF_DLL | 44 | QPDF_DLL |
| 45 | int getGen() const; | 45 | int getGen() const; |
| 46 | + QPDF_DLL | ||
| 47 | + std::string unparse() const; | ||
| 46 | 48 | ||
| 47 | QPDF_DLL | 49 | QPDF_DLL |
| 48 | friend std::ostream& operator<<(std::ostream&, const QPDFObjGen&); | 50 | friend std::ostream& operator<<(std::ostream&, const QPDFObjGen&); |
libqpdf/QPDFObjGen.cc
| 1 | #include <qpdf/QPDFObjGen.hh> | 1 | #include <qpdf/QPDFObjGen.hh> |
| 2 | +#include <qpdf/QUtil.hh> | ||
| 2 | 3 | ||
| 3 | QPDFObjGen::QPDFObjGen() : | 4 | QPDFObjGen::QPDFObjGen() : |
| 4 | obj(0), | 5 | obj(0), |
| @@ -42,3 +43,10 @@ std::ostream& operator<<(std::ostream& os, const QPDFObjGen& og) | @@ -42,3 +43,10 @@ std::ostream& operator<<(std::ostream& os, const QPDFObjGen& og) | ||
| 42 | os << og.obj << "," << og.gen; | 43 | os << og.obj << "," << og.gen; |
| 43 | return os; | 44 | return os; |
| 44 | } | 45 | } |
| 46 | + | ||
| 47 | +std::string | ||
| 48 | +QPDFObjGen::unparse() const | ||
| 49 | +{ | ||
| 50 | + return QUtil::int_to_string(this->obj) + "," + | ||
| 51 | + QUtil::int_to_string(this->gen); | ||
| 52 | +} |