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-25 11:02+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-04-http-05-parser-streams-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
msgctxt "10"
msgid "Parser Stream Operations"
msgstr "解析器流操作"

#. type: paragraph
#: 12
msgid ""
"Non-trivial algorithms need to do more than receive entire messages at once, "
"such as:"
msgstr ""
"非平凡算法需要执行的操作不仅限于一次性接收完整消息，该算法需要做更多事，例如"
"："

#. type: list
#: 16
msgid "* Receive the header first and body later."
msgstr "* 先接收头部，再接收消息体。"

#. type: list
#: 18
msgid "* Receive a large body using a fixed-size buffer."
msgstr "* 使用固定大小缓冲区接收大型消息体。"

#. type: list
#: 20
msgid "* Receive a message incrementally: bounded work in each I/O cycle."
msgstr "* 逐步接收消息：每个 I/O 周期内只处理有限的数据量。"

#. type: list
#: 22
msgid ""
"* Defer the commitment to a __Body__ type until after reading the header."
msgstr "* 在读取头部之后，再确定 __Body__ 类型。"

#. type: paragraph
#: 24
msgid ""
"These types of operations require callers to manage the lifetime of "
"associated state, by constructing a class derived from __basic_parser__. "
"Beast comes with the derived instance __parser__ which creates complete "
"__message__ objects using the __basic_fields__ Fields container."
msgstr ""
"这类操作要求调用方管理相关状态的生命周期，具体方式为构造一个派生自 "
"__basic_parser__ 的类。Beast 提供派生类 __parser__，该类型使用 "
"__basic_fields__ 字段容器来创建完整的 __message__ 对象。"

#. type: table title
#: 29
msgid "Parser"
msgstr "解析器"

#. type: table cell
#: 29
msgctxt "29"
msgid "Name"
msgstr "名称"

#. type: table cell
#: 29
msgctxt "29"
msgid "Description"
msgstr "描述"

#. type: table cell
#: 29
msgid "__parser__"
msgstr "__解析器__"

#. type: table code
#: 29
msgid ""
"/// An HTTP/1 parser for producing a message.\n"
"template<\n"
"bool isRequest,                         // `true` to parse an HTTP request\n"
"class Body,                             // The Body type for the resulting "
"message\n"
"class Allocator = std::allocator<char>> // The type of allocator for the "
"header\n"
"class parser\n"
": public basic_parser<...>;"
msgstr ""
"/// 用于生成消息的 HTTP/1 解析器\n"
"template<\n"
"bool isRequest,                         // 若为 true 则解析 HTTP 请求\n"
"class Body,                             // 结果消息的消息体\n"
"class Allocator = std::allocator<char>> // 头部所使用的分配器\n"
"class parser\n"
": public basic_parser<...>;"

#. type: table cell
#: 29
msgid "[link beast.ref.boost__beast__http__request_parser `request_parser`]"
msgstr "[link beast.ref.boost__beast__http__request_parser `request_parser`]"

#. type: table code
#: 29
msgid ""
"/// An HTTP/1 parser for producing a request message.\n"
"template<class Body, class Allocator = std::allocator<char>>\n"
"using request_parser = parser<true, Body, Allocator>;"
msgstr ""
"/// 用于生成请求消息的 HTTP/1 解析器\n"
"template<class Body, class Allocator = std::allocator<char>>\n"
"using request_parser = parser<true, Body, Allocator>;"

#. type: table cell
#: 29
msgid "[link beast.ref.boost__beast__http__response_parser `response_parser`]"
msgstr "[link beast.ref.boost__beast__http__response_parser `response_parser`]"

#. type: table code
#: 29
msgid ""
"/// An HTTP/1 parser for producing a response message.\n"
"template<class Body, class Allocator = std::allocator<char>>\n"
"using response_parser = parser<false, Body, Allocator>;"
msgstr ""
"/// 用于生成响应消息的 HTTP/1 解析器\n"
"template<class Body, class Allocator = std::allocator<char>>\n"
"using response_parser = parser<false, Body, Allocator>;"

#. type: paragraph
#: 65
msgid "The __basic_parser__ and classes derived from it handle octet streams"
msgstr "__basic_parser__ 及其派生类用于处理八位字节流。"

#. type: paragraph
#: 69
msgid "The stream operations which work on parsers are:"
msgstr "用于操作解析器的流操作如下："

#. type: table title
#: 71
msgctxt "71"
msgid "Parser Stream Operations"
msgstr "解析器流操作"

#. type: table cell
#: 71
msgctxt "71"
msgid "Name"
msgstr "名称"

#. type: table cell
#: 71
msgctxt "71"
msgid "Description"
msgstr "描述"

#. type: table cell
#: 71
msgid "[link beast.ref.boost__beast__http__read.overload1 [*read]]"
msgstr "[link beast.ref.boost__beast__http__read.overload1 [*read]]"

#. type: table cell
#: 71
msgid "Read everything into a parser from a __SyncReadStream__."
msgstr "从 __SyncReadStream__ 读取所有数据到解析器。"

#. type: table cell
#: 71
msgid "[link beast.ref.boost__beast__http__async_read.overload1 [*async_read]]"
msgstr "[link beast.ref.boost__beast__http__async_read.overload1 [*async_read]]"

#. type: table cell
#: 71
msgid ""
"Read everything into a parser asynchronously from an __AsyncReadStream__."
msgstr "从 __AsyncReadStream__ 异步读取所有数据到解析器。"

#. type: table cell
#: 71
msgid ""
"[link beast.ref.boost__beast__http__read_header.overload1 [*read_header]]"
msgstr ""
"[link beast.ref.boost__beast__http__read_header.overload1 [*read_header]]"

#. type: table cell
#: 71
msgid "Read only the header octets into a parser from a __SyncReadStream__."
msgstr "从 __SyncReadStream__ 仅读取头部八位字节到解析器。"

#. type: table cell
#: 71
msgid ""
"[link beast.ref.boost__beast__http__async_read_header [*async_read_header]]"
msgstr ""
"[link beast.ref.boost__beast__http__async_read_header [*async_read_header]]"

#. type: table cell
#: 71
msgid ""
"Read only the header octets into a parser asynchronously from an "
"__AsyncReadStream__."
msgstr "从 __AsyncReadStream__ 异步仅读取头部八位字节到解析器。"

#. type: table cell
#: 71
msgid "[link beast.ref.boost__beast__http__read_some.overload1 [*read_some]]"
msgstr "[link beast.ref.boost__beast__http__read_some.overload1 [*read_some]]"

#. type: table cell
#: 71
msgid "Read some octets into a parser from a __SyncReadStream__."
msgstr "从 __SyncReadStream__ 读取部分八位字节到解析器。"

#. type: table cell
#: 71
msgid "[link beast.ref.boost__beast__http__async_read_some [*async_read_some]]"
msgstr "[link beast.ref.boost__beast__http__async_read_some [*async_read_some]]"

#. type: table cell
#: 71
msgid ""
"Read some octets into a parser asynchronously from an __AsyncReadStream__."
msgstr "从 __AsyncReadStream__ 异步读取部分八位字节到解析器。"

#. type: paragraph
#: 105
msgid ""
"As with message stream operations, parser stream operations require a "
"persisted __DynamicBuffer__  for holding unused octets from the stream. The "
"basic parser implementation is optimized for the case where this dynamic "
"buffer stores its input sequence in a single contiguous memory buffer. It is "
"advised to use an instance of __flat_buffer__, __flat_static_buffer__, or "
"__flat_static_buffer_base__ for this purpose, although a user defined "
"instance of __DynamicBuffer__ which produces input sequences of length one "
"is also suitable."
msgstr ""
"与消息流操作类似，解析器流操作也需要一个持久的 DynamicBuffer 来保存流中未使用"
"的八位字节。当动态缓冲区使用单个连续内存块存储输入序列时，基本解析器实现能达"
"到最优性能。因此，建议使用 flat_buffer、flat_static_buffer 或 "
"flat_static_buffer_base 的实例；当然，用户自定义的 DynamicBuffer 实现，只要它"
"能生成长度为 1 的输入序列，也同样适用。"

#. type: paragraph
#: 114
msgid ""
"The parser contains a message constructed internally. Arguments passed to "
"the parser's constructor are forwarded into the message container. The "
"caller can access the message inside the parser by calling [link "
"beast.ref.boost__beast__http__parser.get `parser::get`]. If the `Fields` and "
"`Body` types are [*MoveConstructible], the caller can take ownership of the "
"message by calling [link beast.ref.boost__beast__http__parser.release "
"`parser::release`]. In this example we read an HTTP response with a string "
"body using a parser, then print the response:"
msgstr ""
"解析器内部包含一个已构造的消息对象。传入解析器构造函数的参数会转发到消息容器"
"中。调用方可通过 [link beast.ref.boost__beast__http__parser.get "
"`parser::get`] 访问该消息。若 `Fields` 和 `Body` 类型支持移动构造，调用方还可"
"通过 [link beast.ref.boost__beast__http__parser.release `parser::release`] 获"
"取消息的所有权。以下示例使用解析器读取一个包含字符串消息体的 HTTP 响应，并将"
"其打印出来："

#. type: section title
#: 128
msgid "Incremental Read __example__"
msgstr "增量读取 __示例__"

#. type: paragraph
#: 130
msgid ""
"This function uses [link beast.ref.boost__beast__http__buffer_body "
"`buffer_body`] and parser stream operations to read a message body "
"progressively using a small, fixed-size buffer:"
msgstr ""
"该函数使用 [link beast.ref.boost__beast__http__buffer_body `buffer_body`] 和"
"解析器流操作，通过一个固定大小的小缓冲区逐步读取消息体："

#. type: section title
#: 141
msgid "Reading large response body __example__"
msgstr "读取大型响应消息体 __示例__"

#. type: paragraph
#: 143
msgid ""
"This example presents how to increase the default limit of the response body "
"size, thus the content larger than the default 8MB can be read."
msgstr "本示例展示如何提高响应消息体大小的默认限制，以便读取超过默认 8MB 大小的内容。"
