2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-08 13:20:53 +00:00
qpdf/libqpdf/QPDF_Bool.cc
Jay Berkenbilt 18a583e8d9 Rename QPDFValueProxy back to QPDFObject
QPDFValueProxy wasn't a good name for it. We decided the evil of
having the header file be named QPDFObject_private.hh was less than
the evil of having the class be named something other than what it
should have been named.
2022-09-08 11:29:23 -04:00

38 lines
527 B
C++

#include <qpdf/QPDF_Bool.hh>
QPDF_Bool::QPDF_Bool(bool val) :
QPDFValue(::ot_boolean, "boolean"),
val(val)
{
}
std::shared_ptr<QPDFObject>
QPDF_Bool::create(bool value)
{
return do_create(new QPDF_Bool(value));
}
std::shared_ptr<QPDFObject>
QPDF_Bool::shallowCopy()
{
return create(val);
}
std::string
QPDF_Bool::unparse()
{
return (val ? "true" : "false");
}
JSON
QPDF_Bool::getJSON(int json_version)
{
return JSON::makeBool(this->val);
}
bool
QPDF_Bool::getVal() const
{
return this->val;
}