2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-18 10:25:12 +00:00
qpdf/libqpdf/QPDFObjGen.cc

53 lines
830 B
C++
Raw Normal View History

#include <qpdf/QPDFObjGen.hh>
2021-02-21 21:09:16 +00:00
#include <qpdf/QUtil.hh>
QPDFObjGen::QPDFObjGen() :
obj(0),
gen(0)
{
}
QPDFObjGen::QPDFObjGen(int o, int g) :
obj(o),
gen(g)
{
}
bool
QPDFObjGen::operator<(QPDFObjGen const& rhs) const
{
return ((this->obj < rhs.obj) ||
((this->obj == rhs.obj) && (this->gen < rhs.gen)));
}
bool
QPDFObjGen::operator==(QPDFObjGen const& rhs) const
{
return ((this->obj == rhs.obj) && (this->gen == rhs.gen));
}
int
QPDFObjGen::getObj() const
{
return this->obj;
}
int
QPDFObjGen::getGen() const
{
return this->gen;
}
2020-12-26 22:49:04 +00:00
std::ostream& operator<<(std::ostream& os, const QPDFObjGen& og)
{
os << og.obj << "," << og.gen;
return os;
}
2021-02-21 21:09:16 +00:00
std::string
QPDFObjGen::unparse() const
{
return QUtil::int_to_string(this->obj) + "," +
QUtil::int_to_string(this->gen);
}