2022-05-03 22:40:42 +00:00
|
|
|
#include <qpdf/Pl_OStream.hh>
|
|
|
|
|
|
|
|
#include <stdexcept>
|
|
|
|
|
|
|
|
Pl_OStream::Members::Members(std::ostream& os) :
|
|
|
|
os(os)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Pl_OStream::Pl_OStream(char const* identifier, std::ostream& os) :
|
2022-07-26 11:37:50 +00:00
|
|
|
Pipeline(identifier, nullptr),
|
2022-05-03 22:40:42 +00:00
|
|
|
m(new Members(os))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-06-01 13:47:36 +00:00
|
|
|
Pl_OStream::~Pl_OStream() // NOLINT (modernize-use-equals-default)
|
2022-05-03 22:40:42 +00:00
|
|
|
{
|
2023-05-27 17:19:52 +00:00
|
|
|
// Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
|
2022-05-03 22:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Pl_OStream::write(unsigned char const* buf, size_t len)
|
|
|
|
{
|
2023-05-21 17:35:09 +00:00
|
|
|
m->os.write(reinterpret_cast<char const*>(buf), static_cast<std::streamsize>(len));
|
2022-05-03 22:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Pl_OStream::finish()
|
|
|
|
{
|
2023-05-21 13:42:34 +00:00
|
|
|
m->os.flush();
|
2022-05-03 22:40:42 +00:00
|
|
|
}
|