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