aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_Integer.cc
blob: 24812573e128fa66bc7be771cb59102265661e10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <qpdf/QPDF_Integer.hh>

#include <qpdf/QUtil.hh>

QPDF_Integer::QPDF_Integer(long long val) :
    QPDFValue(::ot_integer, "integer"),
    val(val)
{
}

std::shared_ptr<QPDFObject>
QPDF_Integer::create(long long value)
{
    return do_create(new QPDF_Integer(value));
}

std::shared_ptr<QPDFObject>
QPDF_Integer::shallowCopy()
{
    return create(val);
}

std::string
QPDF_Integer::unparse()
{
    return QUtil::int_to_string(this->val);
}

JSON
QPDF_Integer::getJSON(int json_version)
{
    return JSON::makeInt(this->val);
}

long long
QPDF_Integer::getVal() const
{
    return this->val;
}