|
SofaBuffers C++ 0.12.0
Pure-C++20 SofaBuffers — API Documentation
|
Chainable result of a write operation. More...
#include <sofab.hpp>
Public Member Functions | |
| template<typename T > | |
| Result | write (sofab::id fieldId, const T &value) noexcept |
| Chain another field write onto the same stream. | |
| template<typename T > | |
| Result | writeIf (sofab::id fieldId, const T &value, bool condition) noexcept |
Chain a field write that only happens when condition holds. | |
| template<typename T > | |
| Result | writeLazy (sofab::id fieldId, const T &value) noexcept |
| Chain a nested-message field write that is omitted when the message is all-default (OStreamImpl::writeLazy). | |
| Result | sequenceEndKeep () noexcept |
| Chain a frame-keeping close (OStreamImpl::sequenceEndKeep). | |
| Result | sequenceBeginLazy (sofab::id fieldId) noexcept |
| Chain the opening of a nested sub-message that is framed only if it turns out to have content (OStreamImpl::sequenceBeginLazy). | |
| Result | sequenceEnd () noexcept |
| Chain the closing of the current nested sub-message. | |
| operator bool () const noexcept | |
| bool | ok () const noexcept |
| Error | code () const noexcept |
| bool | operator== (Error e) const noexcept |
| bool | operator!= (Error e) const noexcept |
Friends | |
| class | OStreamImpl |
Chainable result of a write operation.
Each chained call is a no-op once an error has been latched, so a sequence of writes can be expressed fluently and the first failure inspected at the end via ok / code.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Chain the opening of a nested sub-message that is framed only if it turns out to have content (OStreamImpl::sequenceBeginLazy).
| fieldId | Field identifier of the sub-message. |
*this, for further chaining.
|
inlinenoexcept |
|
inlinenoexcept |
Chain a frame-keeping close (OStreamImpl::sequenceEndKeep).
*this, for further chaining.
|
inlinenoexcept |
Chain another field write onto the same stream.
| T | Value type accepted by OStreamImpl::write. |
| fieldId | Field identifier. |
| value | Value to encode. |
*this, for further chaining.
|
inlinenoexcept |
Chain a field write that only happens when condition holds.
| T | Value type accepted by OStreamImpl::write. |
| fieldId | Field identifier. |
| value | Value to encode when condition is true. |
| condition | Write the field only if this is true. |
*this, for further chaining.
|
inlinenoexcept |
Chain a nested-message field write that is omitted when the message is all-default (OStreamImpl::writeLazy).
| fieldId | Field identifier of the sub-message. |
| value | Nested message to encode. |
*this, for further chaining.
|
friend |