aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/Pl_Buffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/Pl_Buffer.cc')
-rw-r--r--libqpdf/Pl_Buffer.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/libqpdf/Pl_Buffer.cc b/libqpdf/Pl_Buffer.cc
index 072b04d4..05d2ebdb 100644
--- a/libqpdf/Pl_Buffer.cc
+++ b/libqpdf/Pl_Buffer.cc
@@ -53,6 +53,17 @@ Pl_Buffer::getBuffer()
return b;
}
+std::string
+Pl_Buffer::getString()
+{
+ if (!m->ready) {
+ throw std::logic_error("Pl_Buffer::getString() called when not ready");
+ }
+ auto s = std::move(m->data);
+ m->data.clear();
+ return s;
+}
+
std::shared_ptr<Buffer>
Pl_Buffer::getBufferSharedPointer()
{