msgid ""
msgstr ""
"Project-Id-Version: English (Boost Beast Translation (zh_Hans))\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-06 20:44+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: English <https://insights.cppalliance.org/weblate/projects/"
"boost-beast-documentation-zh_Hans/doc-qbk-04-http-09-custom-body-qbk/en/>\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2026.5\n"

#. type: section title
#: 10
#, read-only
msgid "Custom Body Types"
msgstr "Custom Body Types"

#. type: paragraph
#: 13
#, read-only
msgid ""
"User-defined types are possible for the message body, where the type meets "
"the __Body__ requirements. This simplified class declaration shows the "
"customization points available to user-defined body types: ``` /// Defines a "
"Body type struct body {"
msgstr ""
"User-defined types are possible for the message body, where the type meets "
"the __Body__ requirements. This simplified class declaration shows the "
"customization points available to user-defined body types: ``` /// Defines a "
"Body type struct body {"

#. type: paragraph
#: 33
#, read-only
msgid "} ```"
msgstr "} ```"

#. type: paragraph
#: 36
#, read-only
msgid "The meaning of the nested types is as follows"
msgstr "The meaning of the nested types is as follows"

#. type: table title
#: 38
#, read-only
msgid "Body Type Members"
msgstr "Body Type Members"

#. type: table cell
#: 38
#, read-only
msgid "Name"
msgstr "Name"

#. type: table cell
#: 38
#, read-only
msgid "Description"
msgstr "Description"

#. type: table cell
#: 38
#, read-only
msgid "`value_type`"
msgstr "`value_type`"

#. type: table cell
#: 38
#, read-only
msgid ""
"Determines the type of the [link beast.ref.boost__beast__http__message.body "
"`message::body`] member."
msgstr ""
"Determines the type of the [link beast.ref.boost__beast__http__message.body "
"`message::body`] member."

#. type: table cell
#: 38
#, read-only
msgid "`reader`"
msgstr "`reader`"

#. type: table cell
#: 38
#, read-only
msgid ""
"An optional nested type meeting the requirements of __BodyReader__, which "
"provides the algorithm for storing a forward range of buffer sequences in "
"the body representation. If present, this body type may be used with a "
"__parser__."
msgstr ""
"An optional nested type meeting the requirements of __BodyReader__, which "
"provides the algorithm for storing a forward range of buffer sequences in "
"the body representation. If present, this body type may be used with a "
"__parser__."

#. type: table cell
#: 38
#, read-only
msgid "`writer`"
msgstr "`writer`"

#. type: table cell
#: 38
#, read-only
msgid ""
"An optional nested type meeting the requirements of __BodyWriter__, which "
"provides the algorithm for converting the body representation to a forward "
"range of buffer sequences. If present this body type may be used with a "
"__serializer__."
msgstr ""
"An optional nested type meeting the requirements of __BodyWriter__, which "
"provides the algorithm for converting the body representation to a forward "
"range of buffer sequences. If present this body type may be used with a "
"__serializer__."

#. type: heading
#: 66
#, read-only
msgid "Value Type"
msgstr "Value Type"

#. type: paragraph
#: 68
#, read-only
msgid ""
"The `value_type` nested type allows the body to define the declaration of "
"the body type as it appears in the message. This can be any type. For "
"example, a body's value type may specify `std::vector<char>` or "
"`std::list<std::string>`. A custom body may even set the value type to "
"something that is not a container for body octets, such as a [@boost:/libs/"
"filesystem/doc/reference.html#class-path `boost::filesystem::path`]. Or, a "
"more structured container may be chosen. This declares a body's value type "
"as a JSON tree structure produced from a [@boost:/doc/html/json/"
"input_output.html#json.input_output.parsing.streaming_parser "
"`boost::json::stream_parser`]: ``` #include <boost/json/stream_parser.hpp>"
msgstr ""
"The `value_type` nested type allows the body to define the declaration of "
"the body type as it appears in the message. This can be any type. For "
"example, a body's value type may specify `std::vector<char>` or "
"`std::list<std::string>`. A custom body may even set the value type to "
"something that is not a container for body octets, such as a [@boost:/libs/"
"filesystem/doc/reference.html#class-path `boost::filesystem::path`]. Or, a "
"more structured container may be chosen. This declares a body's value type "
"as a JSON tree structure produced from a [@boost:/doc/html/json/"
"input_output.html#json.input_output.parsing.streaming_parser "
"`boost::json::stream_parser`]: ``` #include <boost/json/stream_parser.hpp>"

#. type: paragraph
#: 80
#, read-only
msgid "struct Body {"
msgstr "struct Body {"

#. type: paragraph
#: 86
#, read-only
msgid "}; ```"
msgstr "}; ```"

#. type: paragraph
#: 89
#, read-only
msgid ""
"As long as a suitable reader or writer is available to provide the algorithm "
"for transferring buffers in and out of the value type, those bodies may be "
"parsed or serialized."
msgstr ""
"As long as a suitable reader or writer is available to provide the algorithm "
"for transferring buffers in and out of the value type, those bodies may be "
"parsed or serialized."

#. type: section title
#: 95
#, read-only
msgid "File Body __example__"
msgstr "File Body __example__"

#. type: paragraph
#: 97
#, read-only
msgid ""
"Use of the flexible __Body__ concept customization point enables authors to "
"preserve the self-contained nature of the __message__ object while allowing "
"domain specific behaviors. Common operations for HTTP servers include "
"sending responses which deliver file contents, and allowing for file "
"uploads. In this example we build the [link "
"beast.ref.boost__beast__http__basic_file_body `basic_file_body`] type which "
"supports both reading and writing to a file on the file system. The "
"interface is a class templated on the type of file used to access the file "
"system, which must meet the requirements of __File__."
msgstr ""
"Use of the flexible __Body__ concept customization point enables authors to "
"preserve the self-contained nature of the __message__ object while allowing "
"domain specific behaviors. Common operations for HTTP servers include "
"sending responses which deliver file contents, and allowing for file "
"uploads. In this example we build the [link "
"beast.ref.boost__beast__http__basic_file_body `basic_file_body`] type which "
"supports both reading and writing to a file on the file system. The "
"interface is a class templated on the type of file used to access the file "
"system, which must meet the requirements of __File__."

#. type: paragraph
#: 108
#, read-only
msgid "First we declare the type with its nested types:"
msgstr "First we declare the type with its nested types:"

#. type: paragraph
#: 112
#, read-only
msgid ""
"We will start with the definition of the `value_type`. Our strategy will be "
"to store the file object directly in the message container through the "
"`value_type` field. To use this body it will be necessary to call "
"`msg.body.file().open()` first with the required information such as the "
"path and open mode. This ensures that the file exists throughout the "
"operation and prevent the race condition where the file is removed from the "
"file system in between calls."
msgstr ""
"We will start with the definition of the `value_type`. Our strategy will be "
"to store the file object directly in the message container through the "
"`value_type` field. To use this body it will be necessary to call "
"`msg.body.file().open()` first with the required information such as the "
"path and open mode. This ensures that the file exists throughout the "
"operation and prevent the race condition where the file is removed from the "
"file system in between calls."

#. type: paragraph
#: 122
#, read-only
msgid ""
"Our implementation of __BodyWriter__ will contain a small buffer from which "
"the file contents are read. The buffer is provided to the implementation on "
"each call until everything has been read in."
msgstr ""
"Our implementation of __BodyWriter__ will contain a small buffer from which "
"the file contents are read. The buffer is provided to the implementation on "
"each call until everything has been read in."

#. type: paragraph
#: 128
#, read-only
msgid "And here are the definitions for the functions we have declared:"
msgstr "And here are the definitions for the functions we have declared:"

#. type: paragraph
#: 132
#, read-only
msgid ""
"Files can be read now, and the next step is to allow writing to files by "
"implementing the __BodyReader__. The style is similar to the writer, except "
"that buffers are incoming instead of outgoing. Here's the declaration:"
msgstr ""
"Files can be read now, and the next step is to allow writing to files by "
"implementing the __BodyReader__. The style is similar to the writer, except "
"that buffers are incoming instead of outgoing. Here's the declaration:"

#. type: paragraph
#: 139
#, read-only
msgid "Finally, here is the implementation of the reader member functions:"
msgstr "Finally, here is the implementation of the reader member functions:"

#. type: paragraph
#: 143
#, read-only
msgid ""
"We have created a full featured body type capable of reading and writing "
"files on the filesystem, integrating seamlessly with the HTTP algorithms and "
"message container. The body type works with any file implementation meeting "
"the requirements of __File__ so it may be transparently used with solutions "
"optimized for particular platforms. Example HTTP servers which use file "
"bodies are available in the example directory."
msgstr ""
"We have created a full featured body type capable of reading and writing "
"files on the filesystem, integrating seamlessly with the HTTP algorithms and "
"message container. The body type works with any file implementation meeting "
"the requirements of __File__ so it may be transparently used with solutions "
"optimized for particular platforms. Example HTTP servers which use file "
"bodies are available in the example directory."
