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 13:31+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-file-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
#: 8
msgid "File"
msgstr "文件"

#. type: paragraph
#: 10
msgid ""
"The [*File] concept abstracts access to files in the underlying file system. "
"To support other platform interfaces, users may author their own [*File] "
"types which meet these requirements."
msgstr ""
"[*File] 概念抽象了对底层文件系统中文件的访问。为了支持其他平台接口，用户可以"
"编写满足这些要求的自有 [*File] 类型。"

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

#. type: list
#: 16
msgid ""
"* [link beast.ref.boost__beast__file_mode `file_mode`]\n"
"* [link beast.ref.boost__beast__is_file `is_file`]"
msgstr ""
"* [link beast.ref.boost__beast__file_mode `file_mode`]\n"
"* [link beast.ref.boost__beast__is_file `is_file`]"

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

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

#. type: list
#: 23
msgid ""
"* `F` is a [*File] type\n"
"* `f` is an instance of `F`\n"
"* `p` is a value of type `char const*` which points to a null"
msgstr ""
"* `F` 是一个 [*File] 类型。\n"
"* `f` 是 `F` 的一个实例。\n"
"* `p` 是一个 `char const*` 类型的值，指向一个空字符（null）"

#. type: list
#: 27
msgid ""
"* `m` is an instance of [link beast.ref.boost__beast__file_mode "
"`file_mode`]\n"
"* `n` is a number of bytes, convertible to `std::size_t`\n"
"* `o` is a byte offset in the file, convertible to `std::uint64_t`\n"
"* `b` is any non-const pointer to memory\n"
"* `c` is any possibly-const pointer to memory\n"
"* `ec` is a reference of type [link beast.ref.boost__beast__error_code "
"`error_code`]"
msgstr ""
"* `m` 是一个 [link beast.ref.boost__beast__file_mode `file_mode`] 的实例。\n"
"* `n` 是字节数，可转换为 `std::size_t` 类型。\n"
"* `o` 是文件中的字节偏移量，可转换为 `std::uint64_t` 类型。\n"
"* `b` 是指向内存的任意非常量指针。\n"
"* `c` 是指向内存的任意可能为常量的指针。\n"
"* `ec` 是一个 [link beast.ref.boost__beast__error_code `error_code`] 类型的引"
"用。"

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

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

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

#. type: table cell
#.
#: 34
msgctxt "34"
msgid "Semantics, Pre/Post-conditions"
msgstr ""

#. type: table cell
#: 34
msgid "Operation"
msgstr "操作"

#. type: table cell
#: 34
msgid "Return Type"
msgstr "返回类型"

#. type: table cell
#: 34
msgid "`F()`"
msgstr "`F()`"

#. type: table cell
#: 34
msgid "Default constructable"
msgstr "默认构造（Default constructible）"

#. type: table cell
#: 34
msgid "`f.~F()`"
msgstr "`f.~F()`"

#. type: table cell
#: 34
msgid ""
"Destructible. If `f` refers to an open file, it is first closed as if by a "
"call to `close` with the error ignored."
msgstr ""
"可析构。若 `f` 引用一个打开的文件，则先将其关闭，其行为等同于调用 `close`，且"
"忽略可能产生的错误。"

#. type: table cell
#: 34
msgid "`f.is_open()`"
msgstr "`f.is_open()`"

#. type: table cell
#: 34
msgid "`bool`"
msgstr "`bool`"

#. type: table cell
#: 34
msgid "Returns `true` if `f` refers to an open file, `false` otherwise."
msgstr "若 `f` 引用一个打开的文件，则返回 `true`，否则返回 `false`。"

#. type: table cell
#: 34
msgid "`f.close(ec)`"
msgstr "`f.close(ec)`"

#. type: table cell
#: 34
msgid ""
"If `f` refers to an open file, this function attempts to close the file. "
"Regardless of whether an error occurs or not, a subsequent call to `f.is_open"
"()` will return `false`. The function will ensure that `!ec` is `true` if "
"there was no error or set to the appropriate error code if an error occurred."
msgstr ""
"若 `f` 引用一个打开的文件，此函数将尝试将其关闭。无论关闭过程中是否发生错误，"
"后续对 `f.is_open()` 的调用均会返回 `false`。同时，该函数会根据实际执行情况设"
"置错误代码：若未发生错误，则确保 `!ec` 为 `true`；若发生错误，则将其设置为相"
"应的错误代码。"

#. type: table cell
#: 34
msgid "`f.open(p,m,ec)`"
msgstr "`f.open(p,m,ec)`"

#. type: table cell
#: 34
msgid ""
"Attempts to open the file at the path specified by `p` with the mode "
"specified by `m`. Upon success, a subsequent call to `f.is_open()` will "
"return `true`. If `f` refers to an open file, it is first closed as if by a "
"call to `close` with the error ignored. The function will ensure that `!ec` "
"is `true` if there was no error or set to the appropriate error code if an "
"error occurred."
msgstr ""
"该函数尝试以 `m` 指定的模式打开 `p` 指定的路径对应的文件。若 `f` 引用一个打开"
"的文件，则先将其关闭，其行为等同于调用 `close`，且忽略可能产生的错误。若打开"
"成功，后续对 `f.is_open()` 的调用均会返回 `true`。同时，该函数会根据实际执行"
"情况设置错误代码：若未发生错误，则确保 `!ec` 为 `true`；若发生错误，则将其设"
"置为相应的错误代码。"

#. type: table cell
#: 34
msgid "`f.size(ec)`"
msgstr "`f.size(ec)`"

#. type: table cell
#.
#: 34
msgctxt "34"
msgid "`std::uint64_t`"
msgstr ""

#. type: table cell
#: 34
msgid ""
"If `f` refers to an open file, this function attempts to determine the file "
"size and return its value. If `f` does not refer to an open file, the "
"function will set `ec` to `errc::invalid_argument` and return 0. The "
"function will ensure that `!ec` is `true` if there was no error or set to "
"the appropriate error code if an error occurred."
msgstr ""
"若 `f` 引用一个打开的文件，该函数将尝试获取并返回其文件大小。若 `f` 未引用一"
"个打开的文件，该函数会将 `ec` 设置为 `errc::invalid_argument` 并返回 0。同时"
"，该函数会根据实际执行情况设置错误代码：若未发生错误，则确保 `!ec` 为 "
"`true`；若发生错误，则将其设置为相应的错误代码。"

#. type: table cell
#: 34
msgid "`f.pos(ec)`"
msgstr "`f.pos(ec)`"

#. type: table cell
#: 34
msgid ""
"If `f` refers to an open file, this function attempts to determine the "
"current file offset and return it. If `f` does not refer to an open file, "
"the function will set `ec` to `errc::invalid_argument` and return 0. The "
"function will ensure that `!ec` is `true` if there was no error or set to "
"the appropriate error code if an error occurred."
msgstr ""
"若 `f` 引用一个打开的文件，该函数将尝试获取并返回当前文件偏移量。若 `f` 未引"
"用一个打开的文件，该函数会将 `ec` 设置为 `errc::invalid_argument` 并返回 0。"
"同时，该函数会根据实际执行情况设置错误代码：若未发生错误，则确保 `!ec` 为 "
"`true`；若发生错误，则将其设置为相应的错误代码。"

#. type: table cell
#: 34
msgid "`f.seek(o,ec)`"
msgstr "`f.seek(o,ec)`"

#. type: table cell
#: 34
msgid ""
"Attempts to reposition the current file offset to the value `o`, which "
"represents a byte offset relative to the beginning of the file. If `f` does "
"not refer to an open file, the function will set `ec` to "
"`errc::invalid_argument` and return immediately. The function will ensure "
"that `!ec` is `true` if there was no error or set to the appropriate error "
"code if an error occurred."
msgstr ""
"该函数尝试将当前文件偏移量重新定位到 `o`，该值表示相对于文件起始位置的字节偏"
"移量。若 `f` 未引用一个打开的文件，该函数会将 `ec` 设置为 "
"`errc::invalid_argument` 并立即返回。同时，该函数会根据实际执行情况设置错误代"
"码：若未发生错误，则确保 `!ec` 为 `true`；若发生错误，则将其设置为相应的错误"
"代码。"

#. type: table cell
#: 34
msgid "`f.read(b,n,ec)`"
msgstr "`f.read(b,n,ec)`"

#. type: table cell
#.
#: 34
msgctxt "34"
msgid "`std::size_t`"
msgstr ""

#. type: table cell
#: 34
msgid ""
"Attempts to read `n` bytes starting at the current file offset from the open "
"file referred to by `f`. Bytes read are stored in the memory buffer at "
"address `b` which must be at least `n` bytes in size. The function advances "
"the file offset by the amount read, and returns the number of bytes actually "
"read, which may be less than `n`. If `f` does not refer to an open file, the "
"function will set `ec` to `errc::invalid_argument` and return immediately. "
"The function will ensure that `!ec` is `true` if there was no error or set "
"to the appropriate error code if an error occurred. If an end-of-file "
"condition is detected prior to reading any bytes, the function will ensure "
"that `!ec` is `true` and the return value shall be 0."
msgstr ""
"该函数尝试从 `f` 引用的打开文件中，自当前文件偏移量处读取 `n` 个字节。读取的"
"字节将存储到地址 `b` 处的内存缓冲区中，该缓冲区的大小必须至少为 `n` 个字节。"
"该函数会将文件偏移量推进已读取的字节数，并返回实际读取的字节数，该值可能小于 "
"`n`。若 `f` 未引用一个打开的文件，该函数会将 `ec` 设置为 "
"`errc::invalid_argument` 并立即返回。同时，该函数会根据实际执行情况设置错误代"
"码：若未发生错误，则确保 `!ec` 为 `true`；若发生错误，则将其设置为相应的错误"
"代码。若在读取任何字节之前检测到文件结束条件，该函数将确保 `!ec` 为 `true`，"
"且返回值为 0。"

#. type: table cell
#: 34
msgid "`f.write(c,n,ec)`"
msgstr "`f.write(c,n,ec)`"

#. type: table cell
#: 34
msgid ""
"Attempts to write `n` bytes from the buffer pointed to by `c` to the current "
"file offset of the open file referred to by `f`. The memory buffer at `c` "
"must point to storage of at least `n` bytes meant to be copied to the file. "
"The function advances the file offset by the amount written, and returns the "
"number of bytes actually written, which may be less than `n`. If `f` does "
"not refer to an open file, the function will set `ec` to "
"`errc::invalid_argument` and return immediately. The function will ensure "
"that `!ec` is `true` if there was no error or set to the appropriate error "
"code if an error occurred."
msgstr ""
"该函数尝试将 `c` 指向的缓冲区中的 `n` 个字节写入 `f` 引用的打开文件的当前文件"
"偏移量处。`c` 处的内存缓冲区必须指向大小至少为 `n` 个字节的存储，用于复制到文"
"件。该函数会将文件偏移量推进已写入的字节数，并返回实际写入的字节数，该值可能"
"小于 `n`。若 `f` 未引用一个打开的文件，该函数会将 `ec` 设置为 "
"`errc::invalid_argument` 并立即返回。同时，该函数会根据实际执行情况设置错误代"
"码：若未发生错误，则确保 `!ec` 为 `true`；若发生错误，则将其设置为相应的错误"
"代码。"

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

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

#. type: list
#: 176
msgid ""
"* [link beast.ref.boost__beast__file_posix `file_posix`]\n"
"* [link beast.ref.boost__beast__file_stdio `file_stdio`]\n"
"* [link beast.ref.boost__beast__file_win32 `file_win32`]"
msgstr ""
"* [link beast.ref.boost__beast__file_posix `file_posix`]\n"
"* [link beast.ref.boost__beast__file_stdio `file_stdio`]\n"
"* [link beast.ref.boost__beast__file_win32 `file_win32`]"
