2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 19:08:59 +00:00
qpdf/libqpdf/Pl_OStream.cc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
605 B
C++
Raw Normal View History

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) :
Pipeline(identifier, nullptr),
2022-05-03 22:40:42 +00:00
m(new Members(os))
{
}
Pl_OStream::~Pl_OStream() // NOLINT (modernize-use-equals-default)
2022-05-03 22:40:42 +00:00
{
// Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
}
void
Pl_OStream::write(unsigned char const* buf, size_t len)
{
m->os.write(reinterpret_cast<char const*>(buf), static_cast<std::streamsize>(len));
}
void
Pl_OStream::finish()
{
m->os.flush();
}