2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-15 17:17:08 +00:00
qpdf/libqpdf/QPDF_Integer.cc
m-holger dbc5f07b90 Rename QPDFObject::shallowCopy to copy
Add optional parameter shallow. Change logic errors to runtime errors.
2022-11-20 12:07:22 -05:00

40 lines
600 B
C++

#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::copy(bool shallow)
{
return create(val);
}
std::string
QPDF_Integer::unparse()
{
return std::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;
}