2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-05-28 16:00:53 +00:00
qpdf/libqpdf/QPDF_Operator.cc
m-holger e2737ab646 Add new writeJSON methods
Create an alternative to getJSON to allow an object handle to be written as JSON without the overhead of creating a JSON object.
2024-02-16 10:51:25 +00:00

40 lines
621 B
C++

#include <qpdf/QPDF_Operator.hh>
#include <qpdf/JSON_writer.hh>
QPDF_Operator::QPDF_Operator(std::string const& val) :
QPDFValue(::ot_operator, "operator"),
val(val)
{
}
std::shared_ptr<QPDFObject>
QPDF_Operator::create(std::string const& val)
{
return do_create(new QPDF_Operator(val));
}
std::shared_ptr<QPDFObject>
QPDF_Operator::copy(bool shallow)
{
return create(val);
}
std::string
QPDF_Operator::unparse()
{
return val;
}
JSON
QPDF_Operator::getJSON(int json_version)
{
return JSON::makeNull();
}
void
QPDF_Operator::writeJSON(int json_version, JSON::Writer& p)
{
p << "null";
}