Commit a76decd2d59f8d23791013d822e65b4363d450cd

Authored by Jay Berkenbilt
1 parent 7540d208

Add QPDFObjGen::unparse

ChangeLog
1 1 2021-02-21 Jay Berkenbilt <ejb@ql.org>
2 2  
  3 + * Add QPDFObjGen::unparse()
  4 +
3 5 * Add QPDFObjectHandle::copyStream() for making a copy of a stream
4 6 within the same QPDF instance.
5 7  
... ...
include/qpdf/QPDFObjGen.hh
... ... @@ -43,6 +43,8 @@ class QPDFObjGen
43 43 int getObj() const;
44 44 QPDF_DLL
45 45 int getGen() const;
  46 + QPDF_DLL
  47 + std::string unparse() const;
46 48  
47 49 QPDF_DLL
48 50 friend std::ostream& operator<<(std::ostream&, const QPDFObjGen&);
... ...
libqpdf/QPDFObjGen.cc
1 1 #include <qpdf/QPDFObjGen.hh>
  2 +#include <qpdf/QUtil.hh>
2 3  
3 4 QPDFObjGen::QPDFObjGen() :
4 5 obj(0),
... ... @@ -42,3 +43,10 @@ std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, const QPDFObjGen&amp; og)
42 43 os << og.obj << "," << og.gen;
43 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 +}
... ...