2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-03 15:17:29 +00:00

Change Pl_Buffer to use std::string for storage

This commit is contained in:
m-holger 2023-11-16 15:06:19 +00:00
parent 81823f4032
commit d11622b6fd
2 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@
#include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)
#include <memory> #include <memory>
#include <vector> #include <string>
class QPDF_DLL_CLASS Pl_Buffer: public Pipeline class QPDF_DLL_CLASS Pl_Buffer: public Pipeline
{ {
@ -78,7 +78,7 @@ class QPDF_DLL_CLASS Pl_Buffer: public Pipeline
Members(Members const&) = delete; Members(Members const&) = delete;
bool ready{true}; bool ready{true};
std::vector<unsigned char> data; std::string data;
}; };
std::shared_ptr<Members> m; std::shared_ptr<Members> m;

View File

@ -19,7 +19,7 @@ Pl_Buffer::~Pl_Buffer() // NOLINT (modernize-use-equals-default)
void void
Pl_Buffer::write(unsigned char const* buf, size_t len) Pl_Buffer::write(unsigned char const* buf, size_t len)
{ {
m->data.insert(m->data.end(), buf, buf + len); m->data.append(reinterpret_cast<char const*>(buf), len);
m->ready = false; m->ready = false;
if (getNext(true)) { if (getNext(true)) {