en	= Serializing
zh-hans	= 序列化

en	Serialization is the process where a JSON document represented in memory by a <<ref_value>> is turned into a sequence of characters. The library provides the following free functions and types for serialization:
zh-hans	序列化是指将内存中由&lt;<ref_value>&gt;表示的JSON文档转换为字符序列的过程。该库提供以下用于序列化的自由函数和类型：</ref_value>

en	Name
zh-hans	名称

en	Description
zh-hans	描述

en	<<ref_operator_lt_lt>>
zh-hans	&lt;<ref_operator_lt_lt>&gt;</ref_operator_lt_lt>

en	Serialize a <<ref_value>>, <<ref_array>>, <<ref_object>>, or <<ref_string>>
zh-hans	将 &lt;<ref_value>&gt;、&lt;<ref_array>&gt;、&lt;<ref_object>&gt; 或 &lt;<ref_string>&gt; 序列化</ref_string></ref_object></ref_array></ref_value>

en	to a {std_ostream}.
zh-hans	到 {std_ostream}

en	<<ref_serialize>>
zh-hans	&lt;<ref_serialize>&gt;</ref_serialize>

en	Return a {std_string} representing a serialized <<ref_value>>, <<ref_array>>,
zh-hans	返回一个 {std_string}，表示序列化后的 &lt;<ref_value>&gt;、&lt;<ref_array>&gt;、</ref_array></ref_value>

en	<<ref_object>>, or <<ref_string>>.
zh-hans	&lt;<ref_object>&gt; 或 &lt;<ref_string>&gt;。</ref_string></ref_object>

en	<<ref_serializer>>
zh-hans	&lt;<ref_serializer>&gt;</ref_serializer>

en	A stateful object which may be used to efficiently serialize one or more
zh-hans	一个有状态的对象，可用于高效地序列化一个或多个

en	instances of <<ref_value>>, <<ref_array>>, <<ref_object>>, or <<ref_string>>. |===
zh-hans	&lt;<ref_value>&gt;、&lt;<ref_array>&gt;、&lt;<ref_object>&gt; 或 &lt;<ref_string>&gt; 的实例。 |===</ref_string></ref_object></ref_array></ref_value>

en	To facilitate debugging and ease of output, library container types may be written to standard output streams using the stream operator:
zh-hans	为便于调试和输出，库中的容器类型可通过流操作符写入标准输出流：

en	The <<ref_serialize>> function converts a <<ref_value>> into a {std_string}:
zh-hans	&lt;<ref_serialize>&gt; 函数将一个 &lt;<ref_value>&gt; 转换为 {std_string}:</ref_value></ref_serialize>

en	In situations where serializing a <<ref_value>> in its entirety is inefficient or even impossible, <<ref_serializer>> can be used to serialize a <<ref_value>> incrementally. This may be done for a variety of reasons, such as to avoid buffering the entire output, or to ensure that a fixed amount of work is performed in each cycle. Instances of <<ref_serializer>> maintain an output state using internal dynamically allocated structures, with an interface to retrieve successive buffers of the serialized output into a caller provided buffer. Here is an example, demonstrating how <<ref_operator_lt_lt>> may be implemented using a <<ref_serializer>>:
zh-hans	在完整序列化一个 &lt;<ref_value>&gt; 效率低下甚至不可行的情况下，可使用 &lt;<ref_serializer>&gt; 对其进行逐步序列化。这样做有多种原因，例如避免缓冲整个输出，或确保每个周期执行固定量的工作。&lt;<ref_serializer>&gt; 的实例通过内部动态分配的结构维护输出状态，并提供接口，将序列化输出的连续缓冲区写入调用方提供的缓冲区中。以下示例展示了如何使用 &lt;<ref_serializer>&gt; 来实现 &lt;<ref_operator_lt_lt>&gt;：</ref_operator_lt_lt></ref_serializer></ref_serializer></ref_serializer></ref_value>

en	As with the parser, the serializer may be reused by calling <<ref_serializer_reset>>. This sets up the object to serialize a new instance and retains previously allocated memory. This can result in performance improvements when multiple variables are serialized.
zh-hans	与解析器类似，序列化器可通过调用 &lt;<ref_serializer_reset>&gt; 重复使用。这会将对象重置为序列化新实例的状态，并保留先前分配的内存，从而在序列化多个变量时提升性能。</ref_serializer_reset>