msgid ""
msgstr ""
"Project-Id-Version: Chinese (Simplified Han script) (Boost Beast Translation "
"(zh_Hans))\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-07-24 19:06+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-beast-documentation-zh_Hans/"
"doc-qbk-07-concepts-bodywriter-qbk/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"

#. type: section title
#: 10
msgid "BodyWriter"
msgstr "消息体写入器"

#. type: paragraph
#: 12
msgid ""
"A [*BodyWriter] provides an [@https://en.wikipedia.org/wiki/Online_algorithm "
"online algorithm] to obtain a sequence of zero or more buffers from a body "
"during serialization. The implementation creates an instance of this type "
"when needed, and calls into it one or more times to retrieve buffers holding "
"body octets. The interface of [*BodyWriter] is intended to obtain buffers "
"for these scenarios:"
msgstr ""
"[*BodyWriter] 提供一种 [@https://en.wikipedia.org/wiki/Online_algorithm 在线"
"算法]，用于在序列化过程中从消息体获取零个或多个缓冲区序列。实现会在需要时创建"
"该类型的实例，并调用一次或多次以检索包含消息体八位字节的缓冲区。[BodyWriter] "
"的接口设计用于获取以下场景的缓冲区："

#. type: list
#: 20
msgid ""
"* A body that does not entirely fit in memory.\n"
"* A body produced incrementally from coroutine output.\n"
"* A body represented by zero or more buffers already in memory.\n"
"* A body whose size is not known ahead of time.\n"
"* Body data generated dynamically from other threads.\n"
"* Body data computed algorithmically."
msgstr ""
"* 无法完整存入内存的消息体。\n"
"* 由协程输出逐步生成的消息体。\n"
"* 由已在内存中的零个或多个缓冲区表示的消息体。\n"
"* 大小无法预先确定的消息体。\n"
"* 由其他线程动态生成的消息体数据。\n"
"* 通过算法计算得到的消息体数据。"

#. type: heading
#: 27
msgid "Associated Types"
msgstr "关联类型"

#. type: list
#: 29
msgid ""
"* [link beast.ref.boost__beast__http__is_body_writer `is_body_writer`]\n"
"* __Body__"
msgstr ""
"* [link beast.ref.boost__beast__http__is_body_writer `is_body_writer`]\n"
"* __Body__"

#. type: heading
#: 32
msgid "Requirements"
msgstr "要求"

#. type: paragraph
#: 35
msgid "These requirements may undergo non-backward compatible"
msgstr "这些要求可能发生不向后兼容的变更"

#. type: paragraph
#: 39
msgid "In this table:"
msgstr "在下表中："

#. type: list
#: 41
msgid ""
"* `W` denotes a type meeting the requirements of [*BodyWriter].\n"
"* `B` denotes a __Body__ where"
msgstr ""
"W 表示满足 [*BodyWriter] 要求的类型。\n"
"\n"
"B 表示一个 Body 类型，其中"

#. type: list
#: 44
msgid ""
"* `a` denotes a value of type `W`.\n"
"* `h` denotes a const value of type `header<isRequest, Fields> const&`.\n"
"* `v` denotes a possibly const value of type `Body::value_type&`.\n"
"* `ec` is a value of type [link beast.ref.boost__beast__error_code "
"`error_code&`].\n"
"* `W<T>` is the type `boost::optional<std::pair<T, bool>>`."
msgstr ""
"* `a` 表示类型为 `W` 的值。  \n"
"* `h` 表示类型为 `header<isRequest, Fields> const&` 的常量值。  \n"
"* `v` 表示类型可能为常量的 `Body::value_type&` 值。  \n"
"* `ec` 表示类型为 [link beast.ref.boost__beast__error_code `error_code&`] 的"
"值。  \n"
"* `W<T>` 表示类型 `boost::optional<std::pair<T, bool>>`。"

#. type: table title
#: 50
msgid "Valid expressions"
msgstr "有效表达式"

#. type: table cell
#: 50
msgid "Expression"
msgstr "表达式"

#. type: table cell
#: 50
msgid "Type"
msgstr "类型"

#. type: table cell
#: 50
msgid "Semantics, Pre/Post-conditions"
msgstr "语义、前置条件与后置条件"

#. type: table cell
#: 50
msgid "`W::const_buffers_type`"
msgstr "`W::const_buffers_type`"

#. type: table cell
#: 50
msgid ""
"A type which meets the requirements of __ConstBufferSequence__. This is the "
"type of buffer returned by `W::get`."
msgstr "该类型满足 ConstBufferSequence 的要求，为 W::get 返回的缓冲区类型。"

#. type: table cell
#: 50
msgid "`W{h,v};`"
msgstr "`W{h,v};`"

#. type: table cell
#: 50
msgid ""
"Constructible from `h` and `v`. The lifetime of `h` and `v` are guaranteed "
"to end no earlier than after the `W` is destroyed. The writer shall not "
"access the contents of `h` or `v` before the first call to `init`, "
"permitting lazy construction of the message.\n"
"\n"
"The constructor may optionally require that `h` and `v` are `const` "
"references, with these consequences:\n"
"\n"
"* If `W` requires that `h` and `v` are const references, then the "
"corresponding serializer constructors for messages with this body type will "
"will accept a const reference to a message, otherwise:\n"
"\n"
"* If `W` requires that `h` and `v` are non-const references, then the "
"corresponding serializer constructors for messages with this body type will "
"require a non-const reference to a message."
msgstr ""
"可从 `h` 和 `v` 构造。`h` 和 `v` 的生命周期保证不早于 `W` 销毁前结束。写入器"
"在首次调用 `init` 之前不应访问 `h` 或 `v` 的内容，以支持消息的延迟构造。\n"
"\n"
"构造函数可选择要求 `h` 和 `v` 为 const 引用，其影响如下：\n"
"\n"
"* 若 `W` 要求 `h` 和 `v` 为 const 引用，则对应消息体类型的序列化器构造函数将"
"接受对消息的 const 引用。\n"
"* 否则，若 `W` 要求 `h` 和 `v` 为非 const 引用，则对应消息体类型的序列化器构"
"造函数将要求对消息的非 const 引用。"

#. type: table cell
#: 50
msgid "`a.init(ec)`"
msgstr "`a.init(ec)`"

#. type: table cell
#: 50
msgid ""
"Called once to fully initialize the object before any calls to `get`. The "
"message body becomes valid before entering this function, and remains valid "
"until the writer is destroyed. The function will ensure that `!ec` is `true` "
"if there was no error or set to the appropriate error code if there was one."
msgstr ""
"最终译文：在调用 get 之前调用一次，以完全初始化对象。消息体在进入该函数前有效"
"，并持续有效直到写入器销毁。该函数在无错误时确保 !ec 为 true，否则将 ec 设置"
"为对应的错误码。"

#. type: table cell
#: 50
msgid "`a.get(ec)`"
msgstr "`a.get(ec)`"

#. type: table cell
#: 50
msgid "`W<W::const_buffers_type>`"
msgstr "`W<W::const_buffers_type>`"

#. type: table cell
#: 50
msgid ""
"Called one or more times after `init` succeeds. This function returns "
"`boost::none` if all buffers representing the body have been returned in "
"previous calls or if it sets `ec` to indicate an error. Otherwise, if there "
"are buffers remaining the function should return a pair with the first "
"element containing a non-zero length buffer sequence representing the next "
"set of octets in the body, while the second element is a `bool` meaning "
"`true` if there may be additional buffers returned on a subsequent call, or "
"`false` if the buffer returned on this call is the last buffer representing "
"the body. The function will ensure that `!ec` is `true` if there was no "
"error or set to the appropriate error code if there was one."
msgstr ""
"`init` 成功后，该函数被调用一次或多次。若之前调用已返回代表该主体的所有缓冲区"
"，或该函数设置 `ec` 用于指示错误，则该函数返回 `boost::none`。若仍存在剩余缓"
"冲区，则该函数应返回一个 pair，其第一元素包含一个长度非零的缓冲区序列，用于表"
"示该主体中下一组八位字节；其第二元素为 `bool` 类型，`true` 用于表示后续调用可"
"能返回更多缓冲区，`false` 用于表示本次调用所返回的缓冲区为该主体最后一部分。"
"该函数确保：若无错误，则 `!ec` 为 `true`；若存在错误，则将 `ec` 设为对应的错"
"误码。"

#. type: heading
#: 110
msgid "Exemplar"
msgstr "示例"

#. type: heading
#: 114
msgid "Models"
msgstr "模型"

#. type: list
#: 116
msgid ""
"* [link beast.ref.boost__beast__http__basic_dynamic_body.writer "
"`basic_dynamic_body::writer`]\n"
"* [link beast.ref.boost__beast__http__basic_file_body__writer "
"`basic_file_body::writer`]\n"
"* [link beast.ref.boost__beast__http__basic_string_body.writer "
"`basic_string_body::writer`]\n"
"* [link beast.ref.boost__beast__http__buffer_body.writer "
"`buffer_body::writer`]\n"
"* [link beast.ref.boost__beast__http__empty_body.writer "
"`empty_body::writer`]\n"
"* [link beast.ref.boost__beast__http__span_body.writer `span_body::writer`]\n"
"* [link beast.ref.boost__beast__http__vector_body.writer "
"`vector_body::writer`]"
msgstr ""
"* [link beast.ref.boost__beast__http__basic_dynamic_body.writer "
"`basic_dynamic_body::writer`]\n"
"* [link beast.ref.boost__beast__http__basic_file_body__writer "
"`basic_file_body::writer`]\n"
"* [link beast.ref.boost__beast__http__basic_string_body.writer "
"`basic_string_body::writer`]\n"
"* [link beast.ref.boost__beast__http__buffer_body.writer "
"`buffer_body::writer`]\n"
"* [link beast.ref.boost__beast__http__empty_body.writer "
"`empty_body::writer`]\n"
"* [link beast.ref.boost__beast__http__span_body.writer `span_body::writer`]\n"
"* [link beast.ref.boost__beast__http__vector_body.writer "
"`vector_body::writer`]"
