[wpiutil] Move json_serializer.h to public headers (#3646)

This makes it possible to do "manual" JSON-compliant serialization more efficiently
(e.g. without needing to construct a full json object).
This commit is contained in:
Peter Johnson
2021-10-20 11:18:13 -07:00
committed by GitHub
parent 4ec58724d7
commit e94397a97d
3 changed files with 6 additions and 5 deletions

View File

@@ -38,7 +38,7 @@ SOFTWARE.
#include "wpi/SmallString.h"
#include "wpi/raw_os_ostream.h"
#include "json_serializer.h"
#include "wpi/json_serializer.h"
namespace wpi {

View File

@@ -2678,9 +2678,10 @@ class json
class binary_writer;
class lexer;
class parser;
class serializer;
public:
class serializer;
using value_t = detail::value_t;
/// @copydoc wpi::json_pointer
using json_pointer = ::wpi::json_pointer;

View File

@@ -75,6 +75,7 @@ class json::serializer
@param[in] val value to serialize
@param[in] pretty_print whether the output shall be pretty-printed
@param[in] ensure_ascii whether the output shall only use ASCII chars
@param[in] indent_step the indent level
@param[in] current_indent the current indent level (only used internally)
*/
@@ -83,7 +84,6 @@ class json::serializer
const unsigned int indent_step,
const unsigned int current_indent = 0);
private:
/*!
@brief dump escaped string
@@ -94,9 +94,9 @@ class json::serializer
@param[in] s the string to escape
@param[in] ensure_ascii whether to escape non-ASCII characters with
\uXXXX sequences
"\uXXXX" sequences
@complexity Linear in the length of string @a s.
Complexity: Linear in the length of string @a s.
*/
void dump_escaped(std::string_view s, const bool ensure_ascii);