Commit 3440ea7d3ca0bfb5d6fb4d7392b61017cb36bf0a

Authored by Jay Berkenbilt
1 parent 2e2223ff

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.)
include/qpdf/JSON.hh
@@ -41,7 +41,7 @@ class JSON @@ -41,7 +41,7 @@ class JSON
41 { 41 {
42 public: 42 public:
43 QPDF_DLL 43 QPDF_DLL
44 - std::string serialize() const; 44 + std::string unparse() const;
45 45
46 // The JSON spec calls dictionaries "objects", but that creates 46 // The JSON spec calls dictionaries "objects", but that creates
47 // too much confusion when referring to instances of the JSON 47 // too much confusion when referring to instances of the JSON
libqpdf/JSON.cc
@@ -150,7 +150,7 @@ std::string JSON::JSON_null::unparse(size_t) const @@ -150,7 +150,7 @@ std::string JSON::JSON_null::unparse(size_t) const
150 } 150 }
151 151
152 std::string 152 std::string
153 -JSON::serialize() const 153 +JSON::unparse() const
154 { 154 {
155 if (0 == this->m->value.getPointer()) 155 if (0 == this->m->value.getPointer())
156 { 156 {
libtests/json.cc
@@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
5 5
6 static void check(JSON& j, std::string const& exp) 6 static void check(JSON& j, std::string const& exp)
7 { 7 {
8 - if (exp != j.serialize()) 8 + if (exp != j.unparse())
9 { 9 {
10 - std::cout << "Got " << j.serialize() << "; wanted " << exp << "\n"; 10 + std::cout << "Got " << j.unparse() << "; wanted " << exp << "\n";
11 } 11 }
12 } 12 }
13 13
qpdf/qpdf.cc
@@ -851,7 +851,7 @@ ArgParser::argJsonHelp() @@ -851,7 +851,7 @@ ArgParser::argJsonHelp()
851 << "and \"parameters\" keys will always be present." 851 << "and \"parameters\" keys will always be present."
852 << std::endl 852 << std::endl
853 << std::endl 853 << std::endl
854 - << json_schema().serialize() 854 + << json_schema().unparse()
855 << std::endl; 855 << std::endl;
856 } 856 }
857 857
@@ -3055,7 +3055,7 @@ ideally with the file that caused the error and the output below. Thanks!\n\ @@ -3055,7 +3055,7 @@ ideally with the file that caused the error and the output below. Thanks!\n\
3055 } 3055 }
3056 } 3056 }
3057 3057
3058 - std::cout << j.serialize() << std::endl; 3058 + std::cout << j.unparse() << std::endl;
3059 } 3059 }
3060 3060
3061 static void do_inspection(QPDF& pdf, Options& o) 3061 static void do_inspection(QPDF& pdf, Options& o)