2008-04-29 12:55:25 +00:00
|
|
|
#include <qpdf/QPDF_Integer.hh>
|
|
|
|
|
|
|
|
#include <qpdf/QUtil.hh>
|
|
|
|
|
2012-06-23 15:08:21 -04:00
|
|
|
QPDF_Integer::QPDF_Integer(long long val) :
|
2022-08-02 22:57:33 +01:00
|
|
|
QPDFValue(::ot_integer, "integer"),
|
2008-04-29 12:55:25 +00:00
|
|
|
val(val)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-09-08 11:29:23 -04:00
|
|
|
std::shared_ptr<QPDFObject>
|
2022-06-16 17:45:04 +01:00
|
|
|
QPDF_Integer::create(long long value)
|
|
|
|
{
|
|
|
|
return do_create(new QPDF_Integer(value));
|
|
|
|
}
|
|
|
|
|
2022-09-08 11:29:23 -04:00
|
|
|
std::shared_ptr<QPDFObject>
|
2022-11-14 17:54:12 +00:00
|
|
|
QPDF_Integer::copy(bool shallow)
|
2022-06-16 17:45:04 +01:00
|
|
|
{
|
|
|
|
return create(val);
|
|
|
|
}
|
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
std::string
|
|
|
|
QPDF_Integer::unparse()
|
|
|
|
{
|
2022-09-21 17:49:21 +01:00
|
|
|
return std::to_string(this->val);
|
2008-04-29 12:55:25 +00:00
|
|
|
}
|
|
|
|
|
2018-12-17 17:40:29 -05:00
|
|
|
JSON
|
2022-05-07 07:53:45 -04:00
|
|
|
QPDF_Integer::getJSON(int json_version)
|
2018-12-17 17:40:29 -05:00
|
|
|
{
|
|
|
|
return JSON::makeInt(this->val);
|
|
|
|
}
|
|
|
|
|
2012-06-23 15:08:21 -04:00
|
|
|
long long
|
2008-04-29 12:55:25 +00:00
|
|
|
QPDF_Integer::getVal() const
|
|
|
|
{
|
|
|
|
return this->val;
|
|
|
|
}
|