1 #include <qpdf/QPDFObjGen.hh>
2 #include <qpdf/QUtil.hh>
3 
QPDFObjGen()4 QPDFObjGen::QPDFObjGen() :
5     obj(0),
6     gen(0)
7 {
8 }
9 
QPDFObjGen(int o,int g)10 QPDFObjGen::QPDFObjGen(int o, int g) :
11     obj(o),
12     gen(g)
13 {
14 }
15 
16 bool
operator <(QPDFObjGen const & rhs) const17 QPDFObjGen::operator<(QPDFObjGen const& rhs) const
18 {
19     return ((this->obj < rhs.obj) ||
20 	    ((this->obj == rhs.obj) && (this->gen < rhs.gen)));
21 }
22 
23 bool
operator ==(QPDFObjGen const & rhs) const24 QPDFObjGen::operator==(QPDFObjGen const& rhs) const
25 {
26     return ((this->obj == rhs.obj) && (this->gen == rhs.gen));
27 }
28 
29 int
getObj() const30 QPDFObjGen::getObj() const
31 {
32     return this->obj;
33 }
34 
35 int
getGen() const36 QPDFObjGen::getGen() const
37 {
38     return this->gen;
39 }
40 
operator <<(std::ostream & os,const QPDFObjGen & og)41 std::ostream& operator<<(std::ostream& os, const QPDFObjGen& og)
42 {
43     os << og.obj << "," << og.gen;
44     return os;
45 }
46 
47 std::string
unparse() const48 QPDFObjGen::unparse() const
49 {
50     return QUtil::int_to_string(this->obj) + "," +
51         QUtil::int_to_string(this->gen);
52 }
53