2013-06-14 15:22:04 +00:00
|
|
|
#include <qpdf/QPDFObjGen.hh>
|
2022-02-04 21:31:31 +00:00
|
|
|
|
2021-02-21 21:09:16 +00:00
|
|
|
#include <qpdf/QUtil.hh>
|
2013-06-14 15:22:04 +00:00
|
|
|
|
2013-07-07 23:34:44 +00:00
|
|
|
QPDFObjGen::QPDFObjGen() :
|
|
|
|
obj(0),
|
|
|
|
gen(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QPDFObjGen::QPDFObjGen(int o, int g) :
|
2013-06-14 15:22:04 +00:00
|
|
|
obj(o),
|
|
|
|
gen(g)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
QPDFObjGen::operator<(QPDFObjGen const& rhs) const
|
|
|
|
{
|
2022-04-02 21:14:10 +00:00
|
|
|
return (
|
|
|
|
(this->obj < rhs.obj) ||
|
|
|
|
((this->obj == rhs.obj) && (this->gen < rhs.gen)));
|
2013-06-14 15:22:04 +00:00
|
|
|
}
|
|
|
|
|
2013-06-14 15:58:37 +00:00
|
|
|
bool
|
|
|
|
QPDFObjGen::operator==(QPDFObjGen const& rhs) const
|
|
|
|
{
|
|
|
|
return ((this->obj == rhs.obj) && (this->gen == rhs.gen));
|
|
|
|
}
|
|
|
|
|
2013-06-14 15:22:04 +00:00
|
|
|
int
|
|
|
|
QPDFObjGen::getObj() const
|
|
|
|
{
|
|
|
|
return this->obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
QPDFObjGen::getGen() const
|
|
|
|
{
|
|
|
|
return this->gen;
|
|
|
|
}
|
2020-12-26 22:49:04 +00:00
|
|
|
|
2022-04-02 21:14:10 +00:00
|
|
|
std::ostream&
|
|
|
|
operator<<(std::ostream& os, const QPDFObjGen& og)
|
2020-12-26 22:49:04 +00:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|