2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-23 03:18:59 +00:00
qpdf/libqpdf/Pipeline.cc
Jay Berkenbilt ba5fb69164 Make popping pipeline stack safer
Use destructors to pop the pipeline stack, and ensure that code that
pops the stack is actually popping the intended thing.
2019-08-27 22:27:47 -04:00

40 lines
621 B
C++

#include <qpdf/Pipeline.hh>
#include <stdexcept>
Pipeline::Members::Members(Pipeline* next) :
next(next)
{
}
Pipeline::Members::~Members()
{
}
Pipeline::Pipeline(char const* identifier, Pipeline* next) :
identifier(identifier),
m(new Members(next))
{
}
Pipeline::~Pipeline()
{
}
Pipeline*
Pipeline::getNext(bool allow_null)
{
if ((this->m->next == 0) && (! allow_null))
{
throw std::logic_error(
this->identifier +
": Pipeline::getNext() called on pipeline with no next");
}
return this->m->next;
}
std::string
Pipeline::getIdentifier() const
{
return this->identifier;
}