mirror of
https://github.com/qpdf/qpdf.git
synced 2024-11-13 16:26:28 +00:00
ba5fb69164
Use destructors to pop the pipeline stack, and ensure that code that pops the stack is actually popping the intended thing.
40 lines
621 B
C++
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;
|
|
}
|