msgid ""
msgstr ""
"Project-Id-Version: Chinese (Simplified Han script) (Boost Json Translation "
"(zh_Hans))\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-06 13:37+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Chinese (Simplified Han script) <https://"
"insights.cppalliance.org/weblate/projects/boost-json-documentation-zh_Hans/"
"doc-pages-quick-look-adoc/zh_Hans/>\n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 2026.5\n"

#: :12
#, safe-html, strict-same
msgid ""
"= Quick Look Here we highlight important features through example code to "
"help convey the style of the interface. We begin by including the library "
"header file which brings all the symbols into scope. Alternatively, "
"individual headers may be included to obtain the declarations for specific "
"types:"
msgstr ""
"= 快速浏览 这里我们通过示例代码重点介绍重要特性，以帮助理解接口风格。首先包含"
"库头文件，该文件将所有符号引入作用域；或者，也可以包含单独的头文件以获取特定"
"类型的声明："

#: :23
#, safe-html, strict-same
msgid ""
"In order to link your program you will need to link with a built library. "
"Alternatively you can use the header-only configuration simply by including "
"this header file in any __one__ of your new or existing source files:"
msgstr ""
"为链接程序，您需要链接已构建的库。或者，您可以使用仅需头文件（header-only）的"
"配置，只需在任意__一个__新建或现有源文件中包含此头文件："

#: :45
#, safe-html, strict-same
msgid "Values"
msgstr "值"

#: :46
#, safe-html, strict-same
msgid "Say you want to recreate this JSON object in a container:"
msgstr "假设您要在容器中重建一下 JSON 对象："

#: :66
#, safe-html, strict-same
msgid ""
"In this library the types <<ref_array>>, <<ref_object>>, and <<ref_string>> "
"hold JSON arrays, objects, and strings respectively while the type "
"<<ref_value>> is a special variant which can hold any JSON element. Here we "
"construct an empty object and then insert the elements above:"
msgstr ""
"在本库中，类型 &lt;<ref_array>&gt;、&lt;<ref_object>&gt; 和 &lt;<ref_string>"
"&gt; 分别用于表示 JSON 数组、对象和字符串，而类型 &lt;<ref_value>&gt; 是一种"
"特殊的变体（variant），可容纳任意 JSON 元素。以下示例首先构造一个空对象，然后"
"插入上述元素：</ref_value></ref_string></ref_object></ref_array>"

#: :76
#, safe-html, strict-same
msgid ""
"While keys are strings, the mapped type of objects and the element type of "
"arrays is the aforementioned type <<ref_value>> which can hold any JSON "
"element, as seen in the previous assignments. Instead of building the JSON "
"document using a series of function calls, we can build it in one statement "
"using an initializer list:"
msgstr ""
"尽管键是字符串，但对象的映射类型和数组的元素类型均为前述的 &lt;<ref_value>"
"&gt; 类型，它可以保存任意 JSON 元素，如前文赋值所示。除了通过一系列函数调用构"
"建 JSON 文档外，我们还可以使用初始化列表在一条语句中完成构建：</ref_value>"

#: :87
#, safe-html, strict-same
msgid ""
"When a <<ref_value>>, <<ref_array>>, or <<ref_object>> is assigned or "
"constructed from an initializer list, the creation of the new value happens "
"only once. This makes initializer lists equally efficient as using the other "
"ways to create a value. The types in this library are first-class, "
"supporting copy and move construction and assignment:"
msgstr ""
"当 &lt;<ref_value>&gt;, &lt;<ref_array>&gt;, 或 &lt;<ref_object>&gt; 通过初始"
"化列表进行赋值或构造时，新值的创建仅发生一次。这使得初始化列表在效率上与其他"
"创建值的方式相当。本库中的类型均为一等类型，支持复制和移动构造及赋值：</"
"ref_object></ref_array></ref_value>"

#: :99
#, safe-html, strict-same
msgid "Allocators"
msgstr "分配器"

#: :100
#, safe-html, strict-same
msgid ""
"To permit custom memory allocation strategies, these containers all allow "
"construction with a <<ref_storage_ptr>> which is a smart pointer to a "
"{ref_memory_resource}. The constructor signatures have the same ordering as "
"their `std` equivalents which use {req_Allocator} parameters. Once a "
"container is constructed its memory resource can never change. Here we "
"create an array without performing any dynamic allocations:"
msgstr ""
"为支持自定义内存分配策略，这些容器均允许通过一个 &lt;<ref_storage_ptr>&gt;（"
"指向 {ref_memory_resource} 的智能指针）进行构造。其构造函数签名的参数顺序与使"
"用 {req_Allocator} 参数的标准库等价类型一致。容器一旦构造完成，其内存资源便不"
"可更改。以下代码创建了一个未执行任何动态分配的数组：</ref_storage_ptr>"

#: :112
#, safe-html, strict-same
msgid ""
"The containers in this library enforce the invariant that every element of "
"the container will use the same memory resource:"
msgstr "本库中的容器强制保持一个不变式：容器的每个元素都使用相同的内存资源："

#: :120
#, safe-html, strict-same
msgid ""
"When a library type is used as the element type of a PMR container; that is, "
"a container which uses a {ref_polymorphic_allocator}, the memory resource "
"will automatically propagate to the type and all of its children:"
msgstr ""
"当库类型用作 PMR 容器（即使用 {ref_polymorphic_allocator} 的容器）的元素类型"
"时，内存资源将自动传播至该类型及其所有子元素："

#: :129
#, safe-html, strict-same
msgid ""
"Up until now we have shown how values may be constructed from a memory "
"resource pointer, where ownership is not transferred. In this case the "
"caller is responsible for ensuring that the lifetime of the resource is "
"extended for the life of the container. Sometimes you want the container to "
"acquire shared ownership of the resource. This is accomplished with "
"<<ref_make_shared_resource>>:"
msgstr ""
"截至目前，我们已展示如何通过内存资源指针（不转移所有权）构造值。此时调用方需"
"确保资源生命周期覆盖容器的生命周期。有时您希望容器获取资源的共享所有权。这可"
"通过 &lt;<ref_make_shared_resource>&gt; 实现：</ref_make_shared_resource>"

#: :141
#, safe-html, strict-same
msgid ""
"A counted memory resource will not be destroyed until every container with "
"shared ownership of the resource is destroyed."
msgstr "计数内存资源在拥有其共享所有权的每个容器均被销毁之前，是不会被销毁的。"

#: :145
#, safe-html, strict-same
msgid "Parsing"
msgstr "解析"

#: :146
#, safe-html, strict-same
msgid ""
"JSON can be parsed into the value container in one step using a free "
"function. In the following snippet, a parse error is indicated by a thrown "
"exception:"
msgstr ""
"可使用自由函数将 JSON 一步解析至值容器。在以下代码片段中，解析错误通过抛出异"
"常指示："

#: :154
#, safe-html, strict-same
msgid "Error codes are also possible:"
msgstr "也支持错误码："

#: :161
#, safe-html, strict-same
msgid ""
"By default, the parser is strict and only accepts JSON compliant with the "
"standard. However this behavior can be relaxed by filling out an options "
"structure enabling one or more extensions. Here we use a static buffer and "
"enable two non-standard extensions:"
msgstr ""
"默认情况下，解析器采用严格模式，仅接受符合标准的 JSON。但可通过填充一个选项结"
"构体来启用一个或多个扩展，从而放宽此行为。以下示例使用静态缓冲区并启用了两个"
"非标准扩展："

#: :171
#, safe-html, strict-same
msgid ""
"The parser in this library implements a https://en.wikipedia.org/wiki/"
"Online_algorithm[__streaming algorithm__]; it can process JSON piece-by-"
"piece, without the requirement that the entire input is available from the "
"start. The parser uses a temporary memory allocation to do its work. If you "
"plan on parsing multiple JSONs, for example in a network server, keeping the "
"same parser instance will allow re-use of this temporary storage, improving "
"performance."
msgstr ""
"本库中的解析器实现了一种 https://en.wikipedia.org/wiki/"
"Online_algorithm[__streaming algorithm__]（流式算法）；它可逐段处理 JSON，无"
"需从一开始就提供完整输入。解析器在工作时会使用临时内存分配。如果计划解析多个 "
"JSON（例如在网络服务器中），复用同一个解析器实例可以重用该临时存储，从而提升"
"性能。"

#: :184
#, safe-html, strict-same
msgid ""
"With strategic use of the right memory resources, parser instance, and "
"calculated upper limits on buffer sizes, it is possible to parse and examine "
"JSON without __any__ dynamic memory allocations. This is explored in more "
"detail in a later section."
msgstr ""
"通过合理使用适当的内存资源、解析器实例及缓冲区大小的计算上限，可在不进行__任"
"何__动态内存分配的情况下解析和检查 JSON。后续章节将对此进行更详细探讨。"

#: :190
#, safe-html, strict-same
msgid "Serializing"
msgstr "序列化"

#: :191
#, safe-html, strict-same
msgid ""
"Simple free functions are provided for serializing a <<ref_value>> to a "
"{std_string} containing JSON:"
msgstr ""
"提供了简单的自由函数，用于将 &lt;<ref_value>&gt; 序列化为包含 JSON 的 "
"{std_string}：</ref_value>"

#: :199
#, safe-html, strict-same
msgid ""
"The serializer in this library implements a https://en.wikipedia.org/wiki/"
"Online_algorithm[__streaming algorithm__]; it can output JSON a piece at a "
"time, without the requirement that the entire output area is allocated at "
"once:"
msgstr ""
"本库中的序列化器实现了 https://en.wikipedia.org/wiki/"
"Online_algorithm[__streaming algorithm__]（流式算法）；它可逐段输出 JSON，无"
"需一次性分配整个输出空间："

#: :210
#, safe-html, strict-same
msgid "Value Conversion"
msgstr "值转换"

#: :211
#, safe-html, strict-same
msgid "Given a user-defined type:"
msgstr "给定一个用户定义的类型："

#: :218
#, safe-html, strict-same
msgid ""
"We can define a conversion from the user-defined type to a <<ref_value>> by "
"defining an overload of `tag_invoke` in the same namespace. This maps "
"`customer` to a JSON object:"
msgstr ""
"我们可在同一命名空间中定义 `tag_invoke` 的重载，来实现从用户定义类型到 "
"&lt;<ref_value>&gt; 的转换。此操作将 `customer` 映射为 JSON 对象：</"
"ref_value>"

#: :227
#, safe-html, strict-same
msgid ""
"This allows us to use the library function <<ref_value_from>> to produce a "
"<<ref_value>> from our type:"
msgstr ""
"这允许我们可以使用库函数 &lt;<ref_value_from>&gt; 从我们的类型生成一个 "
"&lt;<ref_value>&gt;：</ref_value></ref_value_from>"

#: :235
#, safe-html, strict-same
msgid ""
"The library knows what to do with standard containers. Here we convert an "
"array of customers to a value:"
msgstr "该库能够自动处理标准容器。以下我们将一个客户数组转换为一个值："

#: :243
#, safe-html, strict-same
msgid ""
"To go from JSON to a user-defined type we use <<ref_value_to>>, which uses "
"another overload of `tag_invoke`. This converts a JSON value to a "
"`customer`. It throws an exception if the contents of the value do not match "
"what is expected:"
msgstr ""
"为将 JSON 转换为用户定义类型，我们使用 &lt;<ref_value_to>&gt;（它会调用 "
"`tag_invoke` 的另一个重载）。此操作将 JSON 值转换为 `customer`。若值内容不符"
"合预期，则抛出异常：</ref_value_to>"

#: :253
#, safe-html, strict-same
msgid ""
"The code above defines the convenience function `extract`, which deduces the "
"types of the struct members. This works, but requires that the struct is "
"{req_DefaultConstructible}. An alternative is to construct the object "
"directly, which is a little more verbose but doesn't require default "
"construction:"
msgstr ""
"上述代码定义了便捷函数 `extract`，它能推导结构体成员的类型。这种方式可行，但"
"要求该结构体是 {req_DefaultConstructible}。另一种方法是直接构造对象，虽然略显"
"冗长，但无需默认构造："

#: :263
#, safe-html, strict-same
msgid "Now we can construct customers from JSON:"
msgstr "现在我们可以从 JSON 构造客户对象（customer）："

#: :270
#, safe-html, strict-same
msgid ""
"The library's generic algorithms recognize when you are converting a "
"<<ref_value>> to a container which resembles an array or object, so if you "
"wanted to turn a JSON array into a vector of customers you might write:"
msgstr ""
"当将 &lt;<ref_value>&gt; 转换为类似数组或对象的容器时，库的通用算法可自动识别"
"。因此若要将 JSON 数组转换为客户向量，可编写如下代码：</ref_value>"
