<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1">
  <file original="NoName" source-language="en" datatype="plaintext" target-language="zh_Hans">
    <body>
      <trans-unit xml:space="preserve" approved="no" id="c150176e209aa249" weblate-flags="safe-html, strict-same">
        <source>= Parsing Parsing is the process where a serialized JSON text is validated and decomposed into elements. The library provides these functions and types to assist with parsing:</source>
        <target state="translated">= 解析 解析是将序列化的JSON文本验证并分解为元素的过程。该库提供以下函数和类型来辅助解析：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">12</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b4c4db868dbf643a" weblate-flags="safe-html, strict-same">
        <source>Name</source>
        <target state="translated">一个 SAX 推送式解析器实现，它将序列化的 JSON 文本转换为对用户提供的处理器的一系列成员函数调用，从而允许自定义内存中文档的表示行为。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">18</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f7f5c115cf553484" weblate-flags="safe-html, strict-same">
        <source>Description</source>
        <target state="translated">描述</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">18</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f1c817f70611635f" weblate-flags="safe-html, strict-same">
        <source>&lt;&lt;ref_basic_parser&gt;&gt;</source>
        <target state="translated">&amp;lt;&amp;gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">18</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="774e2727df7835b9" weblate-flags="safe-html, strict-same">
        <source>A SAX push parser implementation which converts a serialized JSON text into</source>
        <target state="translated">一个 SAX 推送式解析器实现，它将序列化的 JSON 文本转换</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">18</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="ab00221753fc5425" weblate-flags="safe-html, strict-same">
        <source>a series of member function calls to a user provided handler. This allows custom behaviors to be implemented for representing the document in memory.</source>
        <target state="translated">为对用户提供的处理器的一系列成员函数调用，从而允许自定义内存中文档的表示行为</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">23</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="fcb5d99e04a6b00b" weblate-flags="safe-html, strict-same">
        <source>&lt;&lt;ref_parse_options&gt;&gt;</source>
        <target state="translated">&amp;lt;&lt;ref_parse_options&gt;&amp;gt;&lt;/ref_parse_options&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">26</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="d3c417b958a37c82" weblate-flags="safe-html, strict-same">
        <source>A structure used to select which extensions are enabled during parsing.</source>
        <target state="translated">一种结构，用于选择在解析期间启用哪些扩展。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">26</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="6eeaba3b72b4a38e" weblate-flags="safe-html, strict-same">
        <source>&lt;&lt;ref_parse&gt;&gt;</source>
        <target state="translated">&amp;lt;&lt;ref_parse&gt;&amp;gt;&lt;/ref_parse&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">26</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="113418f0569f3e33" weblate-flags="safe-html, strict-same">
        <source>Parse a string containing a complete serialized JSON text, and return</source>
        <target state="translated">解析包含完整序列化 JSON 文本的字符串，并返回</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">26</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="6455002c3e8780b4" weblate-flags="safe-html, strict-same">
        <source>a &lt;&lt;ref_value&gt;&gt;.</source>
        <target state="translated">一个 &amp;lt;&amp;gt;。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">31</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a2a6bab6d5aef9d1" weblate-flags="safe-html, strict-same">
        <source>&lt;&lt;ref_parser&gt;&gt;</source>
        <target state="translated">&amp;lt;&lt;ref_parser&gt;&amp;gt;&lt;/ref_parser&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">33</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id=":33" weblate-flags="safe-html, strict-same">
        <source>A stateful DOM parser object which may be used to efficiently parse a series</source>
        <target state="translated">一种有状态的 DOM 解析器对象，可用于高效解析</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">33</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="514684340cc702c9" weblate-flags="safe-html, strict-same">
        <source>of JSON texts each contained in a single contiguous character buffer, returning each result as a &lt;&lt;ref_value&gt;&gt;.</source>
        <target state="translated">一系列 JSON 文本（每个文本均位于单独的连续字符缓冲区中），并将每个结果作为&amp;lt;&lt;ref_value&gt;&amp;gt;返回。&lt;/ref_value&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">35</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="da6282521f1d881b" weblate-flags="safe-html, strict-same">
        <source>&lt;&lt;ref_stream_parser&gt;&gt;</source>
        <target state="translated">&amp;lt;&lt;ref_stream_parser&gt;&amp;gt;&lt;/ref_stream_parser&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">38</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id=":38" weblate-flags="safe-html, strict-same">
        <source>A stateful DOM parser object which may be used to efficiently parse a series</source>
        <target state="translated">一种有状态的DOM解析器对象，可用于高效地增量解析</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">38</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b7bc3bd415dc33f2" weblate-flags="safe-html, strict-same">
        <source>of JSON texts incrementally, returning each result as a &lt;&lt;ref_value&gt;&gt;.</source>
        <target state="translated">一系列JSON文本，并将每个结果作为&amp;lt;&lt;ref_value&gt;&amp;gt;返回&lt;/ref_value&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">40</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="1fa03898151effc6" weblate-flags="safe-html, strict-same">
        <source>&lt;&lt;ref_value_stack&gt;&gt;</source>
        <target state="translated">&amp;lt;&lt;ref_value_stack&gt;&amp;gt;&lt;/ref_value_stack&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">42</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="1bb6b0a9eacf32d8" weblate-flags="safe-html, strict-same">
        <source>A low level building block used for efficiently building a &lt;&lt;ref_value&gt;&gt;. The</source>
        <target state="translated">一种用于高效构建 &amp;lt;&lt;ref_value&gt;&amp;gt; 的低层构建块。&lt;/ref_value&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">42</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="8eec7b277feba93f" weblate-flags="safe-html, strict-same">
        <source>parsers use this internally, and users may use it to adapt foreign parsers to produce this library's containers. |===</source>
        <target state="translated">解析器在内部使用它，用户也可以使用它来适配外部解析器以生成此库的容器。|===</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">44</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="9ba79cc5e74c9889" weblate-flags="safe-html, strict-same">
        <source>The &lt;&lt;ref_parse&gt;&gt; function offers a simple interface for converting a serialized JSON text to a &lt;&lt;ref_value&gt;&gt; in a single function call. This overload uses exceptions to indicate errors:</source>
        <target state="translated">&amp;lt;&lt;ref_parse&gt;&amp;gt; 函数提供了一个简单接口，用于在单个函数调用中将序列化的JSON文本转换为&amp;lt;&lt;ref_value&gt;&amp;gt;。此重载使用异常来指示错误：&lt;/ref_value&gt;&lt;/ref_parse&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">48</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a1ce069d19def6c5" weblate-flags="safe-html, strict-same">
        <source>Alternatively, an {ref_error_code} can be used:</source>
        <target state="translated">或者，可以使用{ref_error_code}：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">57</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="817ad1a80ca936fa" weblate-flags="safe-html, strict-same">
        <source>Even when using error codes, exceptions thrown from the underlying {ref_memory_resource} are still possible:</source>
        <target state="translated">即使使用错误码，底层 {ref_memory_resource} 仍可能抛出异常：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">64</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="79f55af9be183fb0" weblate-flags="safe-html, strict-same">
        <source>The &lt;&lt;ref_value&gt;&gt; returned in the preceding examples use the &lt;&lt;default_memory_resource,default memory resource&gt;&gt;. The following code uses a &lt;&lt;ref_monotonic_resource&gt;&gt;, which results in faster parsing. `jv` is marked `const` to prevent subsequent modification, because containers using a monotonic resource waste memory when mutated.</source>
        <target state="translated">前述示例中返回的 &amp;lt;&lt;ref_value&gt;&amp;gt; 使用了 &amp;lt;&lt;default_memory_resource,default memory="" resource=""&gt;&amp;gt;（默认内存资源）。以下代码使用了 &amp;lt;&lt;ref_monotonic_resource&gt;&amp;gt;，从而实现更快的解析。`jv` 被标记为 `const` 以防止后续修改，因为使用单调内存资源的容器在被修改时会浪费内存。&lt;/ref_monotonic_resource&gt;&lt;/default_memory_resource,default&gt;&lt;/ref_value&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">72</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="fcc2be909ae94e9b" weblate-flags="safe-html, strict-same">
        <source>Non-Standard JSON</source>
        <target state="translated">非标准JSON</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">83</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="ccac0d17ef48cfc0" weblate-flags="safe-html, strict-same">
        <source>Unless otherwise specified, the parser in this library is strict. It recognizes only valid, standard JSON. The parser can be configured to allow certain non-standard extensions by filling in a &lt;&lt;ref_parse_options&gt;&gt; structure and passing it by value. By default all extensions are disabled:</source>
        <target state="translated">除非另有说明，本库中的解析器采用严格模式，仅识别有效的标准 JSON。通过填充一个 &amp;lt;&lt;ref_parse_options&gt;&amp;gt; 结构并按值传递它来配置解析器，以允许某些非标准扩展。默认情况下，所有扩展都被禁用：&lt;/ref_parse_options&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">84</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="3d75cc3b996f733b" weblate-flags="safe-html, strict-same">
        <source>When building with {cpp}20 or later, the use of https://en.cppreference.com/w/cpp/language/aggregate_initialization#Designated_initializers[designated initializers] with &lt;&lt;ref_parse_options&gt;&gt; is possible:</source>
        <target state="translated">当使用 {cpp}20 或更高版本构建时，可以对 &amp;lt;&lt;ref_parse_options&gt;&amp;gt; 使用 https://en.cppreference.com/w/cpp/language/aggregate_initialization#Designated_initializers[指定初始化器]：&lt;/ref_parse_options&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">94</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="abe08839ce016b71" weblate-flags="safe-html, strict-same">
        <source>When `allow_invalid_utf16` is enabled, the parser will not throw an error in the case of illegal leading, trailing, or half a surrogate. Instead, it will replace the invalid UTF-16 code point(s) with the Unicode replacement character.</source>
        <target state="translated">启用 allow_invalid_utf16 后，解析器在遇到非法的前导代理、尾随代理或半个代理时不会抛出错误，而是将无效的 UTF-16 码点替换为 Unicode 替换字符。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">103</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="845744e7da88cece" weblate-flags="safe-html, strict-same">
        <source>When enabling comment support take extra care not to drop whitespace</source>
        <target state="translated">启用注释支持时，需格外注意不要丢失空白字符于</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">113</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="ad7ba2c526153451" weblate-flags="safe-html, strict-same">
        <source>when reading the input. For example, `std::getline` removes the endline characters from the string it produces.</source>
        <target state="translated">读取输入时。 例如，`std::getline`会从它生成的字符串中移除行尾字符</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">114</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="8d530d02d734582a" weblate-flags="safe-html, strict-same">
        <source>Full Precision Number Parsing</source>
        <target state="translated">全精度数字解析</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">117</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b0edb7d31a6f4d04" weblate-flags="safe-html, strict-same">
        <source>The default algorithm that the library uses to parse numbers is fast, but may result in slight precision loss. This may not be suitable for some applications, so there is an option to enable an alternative algorithm that doesn't have that flaw, but is somewhat slower. To do this, you also need to use &lt;&lt;ref_parse_options&gt;&gt; structure.</source>
        <target state="translated">库默认使用的数字解析算法速度较快，但可能导致轻微的精度损失。这在某些应用中可能不可接受，因此可以选择启用一种没有此缺陷但速度稍慢的替代算法。为此，您还需要使用&amp;lt;&lt;ref_parse_options&gt;&amp;gt;结构体。&lt;/ref_parse_options&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">118</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="0b111af1102f4b7c" weblate-flags="safe-html, strict-same">
        <source>Note that full precision number parsing requires the algorithm to see the full number. This means, that when used with &lt;&lt;ref_stream_parser&gt;&gt;, additional memory allocations may be necessary to store the number parts which were so far accepted by the parser. The library does try its best to avoid such allocations.</source>
        <target state="translated">请注意，全精度数字解析要求算法看到完整的数字。这意味着，当与&amp;lt;&lt;ref_stream_parser&gt;&amp;gt;一起使用时，可能需要额外的内存分配来存储解析器迄今为止接受的数字部分。该库尽力避免此类分配。&lt;/ref_stream_parser&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">129</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="701ff1629bc46b4b" weblate-flags="safe-html, strict-same">
        <source>Parser</source>
        <target state="translated">解析器</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">135</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="21e6ec9901f86604" weblate-flags="safe-html, strict-same">
        <source>Instances of &lt;&lt;ref_parser&gt;&gt; and &lt;&lt;ref_stream_parser&gt;&gt; offer functionality beyond what is available when using the &lt;&lt;ref_parse&gt;&gt; free functions:</source>
        <target state="translated">&amp;lt;&lt;ref_parser&gt;&amp;gt; 和 &amp;lt;&lt;ref_stream_parser&gt;&amp;gt; 的实例所提供的功能超出了使用 &amp;lt;&lt;ref_parse&gt;&amp;gt; 自由函数时可用的功能：&lt;/ref_parse&gt;&lt;/ref_stream_parser&gt;&lt;/ref_parser&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">136</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="4139b31f51f74dce" weblate-flags="safe-html, strict-same">
        <source>More control over memory</source>
        <target state="translated">对内存的更精细控制</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">139</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="04c232f63cc2d303" weblate-flags="safe-html, strict-same">
        <source>Streaming API, parse input JSON incrementally</source>
        <target state="translated">流式 API，可增量解析输入的 JSON</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">140</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="802f7d5c43d2d4d0" weblate-flags="safe-html, strict-same">
        <source>Improved performance when parsing multiple JSON texts</source>
        <target state="translated">在解析多个JSON文本时性能更佳</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">141</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="e9707a853155c1de" weblate-flags="safe-html, strict-same">
        <source>Ignore non-JSON content after the end of a JSON text</source>
        <target state="translated">忽略JSON文本末尾之后的非JSON内容</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">142</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="69b1575957f3cb09" weblate-flags="safe-html, strict-same">
        <source>The parser implementation uses temporary storage space to accumulate values during parsing. When using the &lt;&lt;ref_parse&gt;&gt; free functions, this storage is allocated and freed in each call. However, by declaring an instance of &lt;&lt;ref_parser&gt;&gt; or &lt;&lt;ref_stream_parser&gt;&gt;, this temporary storage can be reused when parsing more than one JSON text, reducing the total number of dynamic memory allocations.</source>
        <target state="translated">解析器实现使用临时存储空间在解析过程中累积值。使用 &amp;lt;&lt;ref_parse&gt;&amp;gt; 自由函数时，该存储在每次调用中都会被分配和释放。然而，通过声明一个 &amp;lt;&lt;ref_parser&gt;&amp;gt; 或 &amp;lt;&lt;ref_stream_parser&gt;&amp;gt; 实例，可在解析多个 JSON 文本时重用该临时存储，从而减少动态内存分配的总次数。&lt;/ref_stream_parser&gt;&lt;/ref_parser&gt;&lt;/ref_parse&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">144</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="58d37bc14001be1a" weblate-flags="safe-html, strict-same">
        <source>To use the &lt;&lt;ref_parser&gt;&gt;, declare an instance. Then call &lt;&lt;ref_parser_write&gt;&gt; once with the buffer containing representing the input JSON. Finally, call &lt;&lt;ref_parser_release&gt;&gt; to take ownership of the resulting &lt;&lt;ref_value&gt;&gt; upon success. This example persists the parser instance in a class member to reuse across calls:</source>
        <target state="translated">要使用 &amp;lt;&lt;ref_parser&gt;&amp;gt;，先声明一个实例。然后调用 &amp;lt;&lt;ref_parser_write&gt;&amp;gt; 一次，传入包含输入 JSON 的缓冲区。最后，在成功时调用 &amp;lt;&lt;ref_parser_release&gt;&amp;gt; 以获取生成的 &amp;lt;&lt;ref_value&gt;&amp;gt; 的所有权。以下示例将解析器实例作为类成员保存，以便在多次调用间复用：&lt;/ref_value&gt;&lt;/ref_parser_release&gt;&lt;/ref_parser_write&gt;&lt;/ref_parser&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">151</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="dc41b05f1b18a35c" weblate-flags="safe-html, strict-same">
        <source>Sometimes a protocol may have a JSON text followed by data that is in a different format or specification. The JSON portion can still be parsed by using the function &lt;&lt;ref_parser_write_some&gt;&gt;. Upon success, the return value will indicate the number of characters consumed from the input, which will exclude the non-JSON characters:</source>
        <target state="translated">有时，某个协议可能在 JSON 文本之后跟随采用不同格式或规范的数据。此时仍可使用函数 &amp;lt;&lt;ref_parser_write_some&gt;&amp;gt; 来解析 JSON 部分。成功时，其返回值将指示从输入中消耗的字符数，该数量不包括非 JSON 的字符：&lt;/ref_parser_write_some&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">162</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a920c5b49d1f9f41" weblate-flags="safe-html, strict-same">
        <source>The parser instance may be constructed with parse options which allow some non-standard JSON extensions to be recognized:</source>
        <target state="translated">解析器实例可以使用解析选项构造，这些选项允许识别一些非标准JSON扩展：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">173</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="d24d6f62d6afbd4a" weblate-flags="safe-html, strict-same">
        <source>Streaming Parser</source>
        <target state="translated">流式解析器</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">181</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="aa4cc1ac74e0b961" weblate-flags="safe-html, strict-same">
        <source>The &lt;&lt;ref_stream_parser&gt;&gt; implements a https://en.wikipedia.org/wiki/Online_algorithm[__streaming algorithm__]; it allows incremental processing of large JSON inputs using one or more contiguous character buffers. The entire input JSON does not need to be loaded into memory at once. A network server can use the streaming interface to process incoming JSON in fixed-size amounts, providing these benefits:</source>
        <target state="translated">&amp;lt;&lt;ref_stream_parser&gt;&amp;gt;实现了一种https://en.wikipedia.org/wiki/Online_algorithm[__流式算法__]；它允许使用一个或多个连续字符缓冲区增量处理大型JSON输入。整个输入JSON无需一次性加载到内存中。网络服务器可以使用流式接口以固定大小的量处理传入的JSON，从而提供以下优势：&lt;/ref_stream_parser&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">182</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b69775956b1a6589" weblate-flags="safe-html, strict-same">
        <source>CPU consumption per I/O cycle is bounded</source>
        <target state="translated">每个 I/O 周期的 CPU 消耗是有上限的</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">189</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="ff8e15b3e916c42e" weblate-flags="safe-html, strict-same">
        <source>Memory consumption per I/O cycle is bounded</source>
        <target state="translated">每个 I/O 周期的内存消耗是有上限的</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">190</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="87d0751380bff34d" weblate-flags="safe-html, strict-same">
        <source>Jitter, unfairness, and latency is reduced</source>
        <target state="translated">减少抖动、不公平性和延迟</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">191</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="c953cf45ef99cdf2" weblate-flags="safe-html, strict-same">
        <source>Less total memory is required to process the full input</source>
        <target state="translated">处理完整输入所需的总内存更少</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">192</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="9811db9e611d6add" weblate-flags="safe-html, strict-same">
        <source>To use the &lt;&lt;ref_stream_parser&gt;&gt;, declare an instance. Then call &lt;&lt;ref_stream_parser_write&gt;&gt; zero or more times with successive buffers representing the input JSON. When there are no more buffers, call &lt;&lt;ref_stream_parser_finish&gt;&gt;. The function &lt;&lt;ref_stream_parser_done&gt;&gt; returns `true` after a successful call to `write` or `finish` if parsing is complete.</source>
        <target state="translated">要使用 &amp;lt;&lt;ref_stream_parser&gt;&amp;gt;，请先声明一个实例。然后对表示输入 JSON 的连续缓冲区零次或多次调用 &amp;lt;&lt;ref_stream_parser_write&gt;&amp;gt;。当没有更多缓冲区时，调用 &amp;lt;&lt;ref_stream_parser_finish&gt;&amp;gt;。在成功调用`write`或`finish`后，若解析已完成，函数 &amp;lt;&lt;ref_stream_parser_done&gt;&amp;gt; 将返回`true`。&lt;/ref_stream_parser_done&gt;&lt;/ref_stream_parser_finish&gt;&lt;/ref_stream_parser_write&gt;&lt;/ref_stream_parser&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">194</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="ae5110153370dc2b" weblate-flags="safe-html, strict-same">
        <source>In the following example a JSON text is parsed from standard input a line at a time. Error codes are used instead. The function &lt;&lt;ref_stream_parser_finish&gt;&gt; is used to indicate the end of the input:</source>
        <target state="translated">在以下示例中，JSON文本从标准输入逐行解析。此处使用错误码替代异常。函数&amp;lt;&lt;ref_stream_parser_finish&gt;&amp;gt;用于指示输入结束：&lt;/ref_stream_parser_finish&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">200</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="c085d7d0e31196ba" weblate-flags="safe-html, strict-same">
        <source>This example will break, if comments are enabled, because of</source>
        <target state="translated">如果启用了注释，此示例将失效，原因</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">204</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="6497ed55c77adb29" weblate-flags="safe-html, strict-same">
        <source>`std::getline` use (see the warning in &lt;&lt;non_standard_json&gt;&gt; section).</source>
        <target state="translated">在于使用了 `std::getline`（参见 &amp;lt;&lt;non_standard_json&gt;&amp;gt; 章节中的警告）。&lt;/non_standard_json&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">205</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="075c661ebd1d4c4a" weblate-flags="safe-html, strict-same">
        <source>We can complicate the example further by extracting _several_ JSON values from the sequence of lines.</source>
        <target state="translated">我们可以通过从行序列中提取_多个_JSON值来进一步复杂化此示例。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">212</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="d545c85f1f7d12fb" weblate-flags="safe-html, strict-same">
        <source>Controlling Memory</source>
        <target state="translated">控制内存</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">220</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b42472f563e77e90" weblate-flags="safe-html, strict-same">
        <source>After default construction, or after &lt;&lt;ref_stream_parser_reset&gt;&gt; is called with no arguments, the &lt;&lt;ref_value&gt;&gt; produced after a successful parse operation uses the default memory resource. To use a different memory resource, call `reset` with the resource to use. Here we use a &lt;&lt;ref_monotonic_resource&gt;&gt;, which is optimized for parsing but not subsequent modification:</source>
        <target state="translated">在默认构造之后，或在无参调用 &amp;lt;&lt;ref_stream_parser_reset&gt;&amp;gt; 之后，成功解析操作所生成的 &amp;lt;&lt;ref_value&gt;&amp;gt; 将使用默认内存资源。若要使用不同的内存资源，可调用 `reset`并传入目标资源。以下示例使用了 &amp;lt;&lt;ref_monotonic_resource&gt;&amp;gt;，该资源针对解析进行了优化，但不适合后续修改&lt;/ref_monotonic_resource&gt;&lt;/ref_value&gt;&lt;/ref_stream_parser_reset&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">221</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a02c497fa2bc38f2" weblate-flags="safe-html, strict-same">
        <source>To achieve performance and memory efficiency, the parser uses a temporary storage area to hold intermediate results. This storage is reused when parsing more than one JSON text, reducing the total number of calls to allocate memory and thus improving performance. Upon construction, the memory resource used to perform allocations for this temporary storage area may be specified. Otherwise, the default memory resource is used. In addition to a memory resource, the parser can make use of a caller-owned buffer for temporary storage. This can help avoid dynamic allocations for small inputs. The following example uses a four kilobyte temporary buffer for the parser, and falls back to the default memory resource if needed:</source>
        <target state="translated">为实现性能与内存效率，解析器使用一块临时存储区来保存中间结果。在解析多个 JSON 文本时，该存储区会被复用，从而减少内存分配的总次数，提升性能。构造解析器时，可指定用于此临时存储区分配的内存资源；若未指定，则使用默认内存资源。此外，解析器还可利用调用方提供的缓冲区作为临时存储，有助于避免对小型输入进行动态分配。以下示例为解析器提供了一个 4 KB 的临时缓冲区，并在需要时回退到默认内存资源：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">232</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="5e505f588184ce3b" weblate-flags="safe-html, strict-same">
        <source>Avoiding Dynamic Allocations</source>
        <target state="translated">避免动态分配</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">248</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="4308e0efd6523806" weblate-flags="safe-html, strict-same">
        <source>Through careful specification of buffers and memory resources, it is possible to eliminate all dynamic allocation completely when parsing JSON, for the case where the entire JSON text is available in a single character buffer, as shown here:</source>
        <target state="translated">通过精心指定缓冲区和内存资源，可以在解析 JSON 时完全消除所有动态内存分配，前提是整个JSON文本在单个字符缓冲区中可用，如下所示：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">249</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="3e10e202825b1fc4" weblate-flags="safe-html, strict-same">
        <source>Custom Parsers</source>
        <target state="translated">自定义解析器</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">259</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="cb56a9c2b7611c93" weblate-flags="safe-html, strict-same">
        <source>Users who wish to implement custom parsing strategies may create their own handler to use with an instance of &lt;&lt;ref_basic_parser&gt;&gt;. The handler implements the function signatures required by SAX event interface. In &lt;&lt;examples_validate&gt;&gt; example we define the "null" parser, which throws out the parsed results, to use in the implementation of a function that determines if a JSON text is valid.</source>
        <target state="translated">希望实现自定义解析策略的用户可以创建自己的处理器（handler），并与 &amp;lt;&lt;ref_basic_parser&gt;&amp;gt; 实例配合使用。该处理器需实现 SAX 事件接口所要求的函数签名。在 &amp;lt;&lt;examples_validate&gt;&amp;gt; 示例中，我们定义了一个“空”解析器（null parser），它会丢弃所有解析结果，用于实现一个判断 JSON 文本是否有效的函数。&lt;/examples_validate&gt;&lt;/ref_basic_parser&gt;</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">260</context>
        </context-group>
      </trans-unit>
    </body>
  </file>
</xliff>
