msgid ""
msgstr ""
"Project-Id-Version: English (Boost Beast Translation (zh_Hans))\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-07 12:21+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-06-websocket-03-decorator-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
#: 12
#, read-only
msgid "Decorator"
msgstr "Decorator"

#. type: paragraph
#: 14
#, read-only
msgid ""
"For programs which need to modify either the outgoing WebSocket HTTP Upgrade "
"request, the outgoing WebSocket HTTP Upgrade response, or both, the stream "
"supports an optional property called a ['decorator]. This is a function "
"pointer or callable object which is invoked before the implementation sends "
"an HTTP message. The decorator receives a modifiable reference to the "
"message, allowing for modifications. The interface to this system uses:"
msgstr ""
"For programs which need to modify either the outgoing WebSocket HTTP Upgrade "
"request, the outgoing WebSocket HTTP Upgrade response, or both, the stream "
"supports an optional property called a ['decorator]. This is a function "
"pointer or callable object which is invoked before the implementation sends "
"an HTTP message. The decorator receives a modifiable reference to the "
"message, allowing for modifications. The interface to this system uses:"

#. type: table title
#: 22
#, read-only
msgid "WebSocket Decorator Interface"
msgstr "WebSocket Decorator Interface"

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

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

#. type: table cell
#: 22
#, read-only
msgid "[link beast.ref.boost__beast__websocket__request_type `request_type`]"
msgstr "[link beast.ref.boost__beast__websocket__request_type `request_type`]"

#. type: table cell
#: 22
#, read-only
msgid ""
"This is the type of the object passed to the decorator to represent HTTP "
"Upgrade requests."
msgstr ""
"This is the type of the object passed to the decorator to represent HTTP "
"Upgrade requests."

#. type: table cell
#: 22
#, read-only
msgid "[link beast.ref.boost__beast__websocket__response_type `response_type`]"
msgstr "[link beast.ref.boost__beast__websocket__response_type `response_type`]"

#. type: table cell
#: 22
#, read-only
msgid ""
"This is the type of the object passed to the decorator to represent HTTP "
"Upgrade response."
msgstr ""
"This is the type of the object passed to the decorator to represent HTTP "
"Upgrade response."

#. type: table cell
#: 22
#, read-only
msgid ""
"[link beast.ref.boost__beast__websocket__stream_base__decorator "
"`stream_base::decorator`]"
msgstr ""
"[link beast.ref.boost__beast__websocket__stream_base__decorator "
"`stream_base::decorator`]"

#. type: table cell
#: 22
#, read-only
msgid ""
"Objects of this type are used to hold a decorator to be set on the stream "
"using `set_option`."
msgstr ""
"Objects of this type are used to hold a decorator to be set on the stream "
"using `set_option`."

#. type: table cell
#: 22
#, read-only
msgid ""
"[link beast.ref.boost__beast__websocket__stream.set_option "
"`stream::set_option`]"
msgstr ""
"[link beast.ref.boost__beast__websocket__stream.set_option "
"`stream::set_option`]"

#. type: table cell
#: 22
#, read-only
msgid "This function is used to set a `stream_base::decorator` on the stream."
msgstr "This function is used to set a `stream_base::decorator` on the stream."

#. type: paragraph
#: 49
#, read-only
msgid "This declares a normal function which decorates outgoing HTTP requests:"
msgstr "This declares a normal function which decorates outgoing HTTP requests:"

#. type: paragraph
#: 53
#, read-only
msgid ""
"When using a decorator, it must be set on the stream before any handshaking "
"takes place. This sets the decorator on the stream, to be used for all "
"subsequent calls to accept or handshake:"
msgstr ""
"When using a decorator, it must be set on the stream before any handshaking "
"takes place. This sets the decorator on the stream, to be used for all "
"subsequent calls to accept or handshake:"

#. type: paragraph
#: 59
#, read-only
msgid ""
"Alternatively, a function object may be used. Small function objects will "
"not incur a memory allocation. The follow code declares and sets a function "
"object as a decorator:"
msgstr ""
"Alternatively, a function object may be used. Small function objects will "
"not incur a memory allocation. The follow code declares and sets a function "
"object as a decorator:"

#. type: paragraph
#: 65
#, read-only
msgid "A lambda may be used in place of a named function object:"
msgstr "A lambda may be used in place of a named function object:"

#. type: paragraph
#: 69
#, read-only
msgid ""
"It also possible for a single decorator to handle both requests and "
"responses, if it is overloaded for both types either as a generic lambda "
"(C++14 and later) or as a class as shown here:"
msgstr ""
"It also possible for a single decorator to handle both requests and "
"responses, if it is overloaded for both types either as a generic lambda "
"(C++14 and later) or as a class as shown here:"

#. type: paragraph
#: 75
#, read-only
msgid ""
"The implementation takes ownership by decay-copy of the invocable object "
"used as the decorator. Move-only types are possible:"
msgstr ""
"The implementation takes ownership by decay-copy of the invocable object "
"used as the decorator. Move-only types are possible:"

#. type: paragraph
#: 81
#, read-only
msgid "Undefined behavior results if the decorator modifies the fields"
msgstr "Undefined behavior results if the decorator modifies the fields"
