diff options
Diffstat (limited to 'libqpdf/qpdf/QPDF_Name.hh')
-rw-r--r-- | libqpdf/qpdf/QPDF_Name.hh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libqpdf/qpdf/QPDF_Name.hh b/libqpdf/qpdf/QPDF_Name.hh index c14d8659..b5d3c318 100644 --- a/libqpdf/qpdf/QPDF_Name.hh +++ b/libqpdf/qpdf/QPDF_Name.hh @@ -10,10 +10,15 @@ class QPDF_Name: public QPDFValue static std::shared_ptr<QPDFObject> create(std::string const& name); std::shared_ptr<QPDFObject> copy(bool shallow = false) override; std::string unparse() override; - JSON getJSON(int json_version) override; + void writeJSON(int json_version, JSON::Writer& p) override; // Put # into strings with characters unsuitable for name token static std::string normalizeName(std::string const& name); + + // Check whether name is valid utf-8 and whether it contains characters that require escaping. + // Return {false, false} if the name is not valid utf-8, otherwise return {true, true} if no + // characters require or {true, false} if escaping is required. + static std::pair<bool, bool> analyzeJSONEncoding(std::string const& name); std::string getStringValue() const override { |