2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-16 17:45:09 +00:00
qpdf/libqpdf/QPDF_Bool.cc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
532 B
C++
Raw Normal View History

#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::copy(bool shallow)
{
return create(val);
}
std::string
QPDF_Bool::unparse()
{
return (val ? "true" : "false");
}
2018-12-17 22:40:29 +00:00
JSON
QPDF_Bool::getJSON(int json_version)
2018-12-17 22:40:29 +00:00
{
return JSON::makeBool(this->val);
}
bool
QPDF_Bool::getVal() const
{
return this->val;
}