aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2018-12-25 14:29:07 +0100
committerJay Berkenbilt <ejb@ql.org>2018-12-25 17:52:21 +0100
commit3440ea7d3ca0bfb5d6fb4d7392b61017cb36bf0a (patch)
treebd82c363917769cc5a4ce14f4687889a03b2e9b1
parent2e2223ffe15d0f5b1d26e38c75df28c499fcc3e4 (diff)
downloadqpdf-3440ea7d3ca0bfb5d6fb4d7392b61017cb36bf0a.tar.zst
JSON::serialize -> unparse
Unparse is admittedly strange, but I'd rather be strange and consistent, and everything else in the qpdf library uses unparse to serialize. (If you're reading this, the convention of using "unparse" comes from the "clu" programming language.)
-rw-r--r--include/qpdf/JSON.hh2
-rw-r--r--libqpdf/JSON.cc2
-rw-r--r--libtests/json.cc4
-rw-r--r--qpdf/qpdf.cc4
4 files changed, 6 insertions, 6 deletions
diff --git a/include/qpdf/JSON.hh b/include/qpdf/JSON.hh
index f5dd57d5..78f5cc05 100644
--- a/include/qpdf/JSON.hh
+++ b/include/qpdf/JSON.hh
@@ -41,7 +41,7 @@ class JSON
{
public:
QPDF_DLL
- std::string serialize() const;
+ std::string unparse() const;
// The JSON spec calls dictionaries "objects", but that creates
// too much confusion when referring to instances of the JSON
diff --git a/libqpdf/JSON.cc b/libqpdf/JSON.cc
index def439cf..df753b69 100644
--- a/libqpdf/JSON.cc
+++ b/libqpdf/JSON.cc
@@ -150,7 +150,7 @@ std::string JSON::JSON_null::unparse(size_t) const
}
std::string
-JSON::serialize() const
+JSON::unparse() const
{
if (0 == this->m->value.getPointer())
{
diff --git a/libtests/json.cc b/libtests/json.cc
index fb902c62..1a9123ad 100644
--- a/libtests/json.cc
+++ b/libtests/json.cc
@@ -5,9 +5,9 @@
static void check(JSON& j, std::string const& exp)
{
- if (exp != j.serialize())
+ if (exp != j.unparse())
{
- std::cout << "Got " << j.serialize() << "; wanted " << exp << "\n";
+ std::cout << "Got " << j.unparse() << "; wanted " << exp << "\n";
}
}
diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc
index 1a45180c..2eb75af5 100644
--- a/qpdf/qpdf.cc
+++ b/qpdf/qpdf.cc
@@ -851,7 +851,7 @@ ArgParser::argJsonHelp()
<< "and \"parameters\" keys will always be present."
<< std::endl
<< std::endl
- << json_schema().serialize()
+ << json_schema().unparse()
<< std::endl;
}
@@ -3055,7 +3055,7 @@ ideally with the file that caused the error and the output below. Thanks!\n\
}
}
- std::cout << j.serialize() << std::endl;
+ std::cout << j.unparse() << std::endl;
}
static void do_inspection(QPDF& pdf, Options& o)