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