2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 03:40:53 +00:00
qpdf/libqpdf/QPDF_Integer.cc

40 lines
601 B
C++
Raw Normal View History

#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);
}
2018-12-17 22:40:29 +00:00
JSON
QPDF_Integer::getJSON(int json_version)
2018-12-17 22:40:29 +00:00
{
return JSON::makeInt(this->val);
}
long long
QPDF_Integer::getVal() const
{
return this->val;
}