aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_Real.cc
blob: b28c2f70ae4bd381625c3787c415cdc6e5e07a85 (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
40
41
42
43
44
45
46
47
#include <qpdf/QPDF_Real.hh>

#include <qpdf/QUtil.hh>

QPDF_Real::QPDF_Real(std::string const& val) :
    val(val)
{
}

QPDF_Real::QPDF_Real(double value, int decimal_places) :
    val(QUtil::double_to_string(value, decimal_places))
{
}

QPDF_Real::~QPDF_Real()
{
}

std::string
QPDF_Real::unparse()
{
    return this->val;
}

JSON
QPDF_Real::getJSON()
{
    return JSON::makeNumber(this->val);
}

QPDFObject::object_type_e
QPDF_Real::getTypeCode() const
{
    return QPDFObject::ot_real;
}

char const*
QPDF_Real::getTypeName() const
{
    return "real";
}

std::string
QPDF_Real::getVal()
{
    return this->val;
}