aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjGen.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-07-24 20:41:33 +0200
committerGitHub <noreply@github.com>2022-07-24 20:41:33 +0200
commit5696a507b6dacf34d066810a3f2fca3525eb02f5 (patch)
treeb0009760e0f76c28aa99581e4bc6087adf93749f /libqpdf/QPDFObjGen.cc
parent6f1041afb8e6d1f57169cd4c79f42a7c1ce94da8 (diff)
parent8b4afa428e9caa1a34cad434dfe8a3e01e5a24d3 (diff)
downloadqpdf-5696a507b6dacf34d066810a3f2fca3525eb02f5.tar.zst
Merge pull request #731 from m-holger/og_unparse
Tidy QPDFObjGen related code
Diffstat (limited to 'libqpdf/QPDFObjGen.cc')
-rw-r--r--libqpdf/QPDFObjGen.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/libqpdf/QPDFObjGen.cc b/libqpdf/QPDFObjGen.cc
new file mode 100644
index 00000000..e372555d
--- /dev/null
+++ b/libqpdf/QPDFObjGen.cc
@@ -0,0 +1,17 @@
+#include <qpdf/QPDFObjGen.hh>
+
+#include <qpdf/QUtil.hh>
+
+std::ostream&
+operator<<(std::ostream& os, const QPDFObjGen& og)
+{
+ os << og.obj << "," << og.gen;
+ return os;
+}
+
+std::string
+QPDFObjGen::unparse(char separator) const
+{
+ return QUtil::int_to_string(this->obj) + separator +
+ QUtil::int_to_string(this->gen);
+}