2008-04-29 12:55:25 +00:00
|
|
|
#include <qpdf/QPDF_Bool.hh>
|
|
|
|
|
2024-02-09 13:09:08 +00:00
|
|
|
#include <qpdf/JSON_writer.hh>
|
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
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-11-14 17:54:12 +00:00
|
|
|
QPDF_Bool::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_Bool::unparse()
|
|
|
|
{
|
|
|
|
return (val ? "true" : "false");
|
|
|
|
}
|
|
|
|
|
2024-02-09 13:09:08 +00:00
|
|
|
void
|
|
|
|
QPDF_Bool::writeJSON(int json_version, JSON::Writer& p)
|
|
|
|
{
|
|
|
|
p << val;
|
|
|
|
}
|
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
bool
|
|
|
|
QPDF_Bool::getVal() const
|
|
|
|
{
|
|
|
|
return this->val;
|
|
|
|
}
|