Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
To obtain the serialized next buffer sequence, call要获取序列化后的下一个缓冲区序列,可调用 [link beast.ref.boost__beast__http__serializer.next `serializer::next`]. Then, call。随后调用 [link beast.ref.boost__beast__http__serializer.consume `serializer::consume`]to indicate the number of bytes consumed. This updates the next set of buffers to be returned, if any. `serializer::next` takes an error code parameter and invokes a visitor argument with the error code and buffer of unspecified type. In C++14 this is easily expressed with a generic lambda. The function [link beast.ref.boost__beast__http__serializer.is_done `serializer::is_done`] will return `true` when all the buffers have been produced. This C++14 example prints the buffers to standard output:来告知已消耗的字节数,该操作会更新后续需要返回的缓冲区集(如果有的话)。`serializer::next` 接受一个错误码参数,并通过一个访问器参数返回错误码和缓冲区(缓冲区类型未指定)。在 C++14 中,可以通过泛型 lambda 表达式轻松实现。当所有缓冲区都已生成后,[link beast.ref.boost__beast__http__serializer.is_done `serializer::is_done`] 会返回 `true`。以下 C++14 示例将缓冲区内容输出到标准输出: