2008-04-29 12:55:25 +00:00
|
|
|
#include <qpdf/Pl_Count.hh>
|
|
|
|
|
2009-08-06 19:00:25 +00:00
|
|
|
DLL_EXPORT
|
2008-04-29 12:55:25 +00:00
|
|
|
Pl_Count::Pl_Count(char const* identifier, Pipeline* next) :
|
|
|
|
Pipeline(identifier, next),
|
|
|
|
count(0),
|
|
|
|
last_char('\0')
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-08-06 19:00:25 +00:00
|
|
|
DLL_EXPORT
|
2008-04-29 12:55:25 +00:00
|
|
|
Pl_Count::~Pl_Count()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-08-06 19:00:25 +00:00
|
|
|
DLL_EXPORT
|
2008-04-29 12:55:25 +00:00
|
|
|
void
|
|
|
|
Pl_Count::write(unsigned char* buf, int len)
|
|
|
|
{
|
|
|
|
if (len)
|
|
|
|
{
|
|
|
|
this->count += len;
|
|
|
|
getNext()->write(buf, len);
|
|
|
|
this->last_char = buf[len - 1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-08-06 19:00:25 +00:00
|
|
|
DLL_EXPORT
|
2008-04-29 12:55:25 +00:00
|
|
|
void
|
|
|
|
Pl_Count::finish()
|
|
|
|
{
|
|
|
|
getNext()->finish();
|
|
|
|
}
|
|
|
|
|
2009-08-06 19:00:25 +00:00
|
|
|
DLL_EXPORT
|
2008-04-29 12:55:25 +00:00
|
|
|
int
|
|
|
|
Pl_Count::getCount() const
|
|
|
|
{
|
|
|
|
return this->count;
|
|
|
|
}
|
|
|
|
|
2009-08-06 19:00:25 +00:00
|
|
|
DLL_EXPORT
|
2008-04-29 12:55:25 +00:00
|
|
|
unsigned char
|
|
|
|
Pl_Count::getLastChar() const
|
|
|
|
{
|
|
|
|
return this->last_char;
|
|
|
|
}
|