2008-04-29 12:55:25 +00:00
|
|
|
#include <qpdf/QPDF_Bool.hh>
|
|
|
|
|
|
|
|
QPDF_Bool::QPDF_Bool(bool val) :
|
2022-08-02 21:57:33 +00:00
|
|
|
QPDFValue(::ot_boolean, "boolean"),
|
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_Bool::create(bool value)
|
|
|
|
{
|
|
|
|
return do_create(new QPDF_Bool(value));
|
|
|
|
}
|
|
|
|
|
2022-09-08 15:29:23 +00:00
|
|
|
std::shared_ptr<QPDFObject>
|
2022-06-16 16:45:04 +00:00
|
|
|
QPDF_Bool::shallowCopy()
|
|
|
|
{
|
|
|
|
return create(val);
|
|
|
|
}
|
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
std::string
|
|
|
|
QPDF_Bool::unparse()
|
|
|
|
{
|
|
|
|
return (val ? "true" : "false");
|
|
|
|
}
|
|
|
|
|
2018-12-17 22:40:29 +00:00
|
|
|
JSON
|
2022-05-07 11:53:45 +00:00
|
|
|
QPDF_Bool::getJSON(int json_version)
|
2018-12-17 22:40:29 +00:00
|
|
|
{
|
|
|
|
return JSON::makeBool(this->val);
|
|
|
|
}
|
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
bool
|
|
|
|
QPDF_Bool::getVal() const
|
|
|
|
{
|
|
|
|
return this->val;
|
|
|
|
}
|