|
SofaBuffers C/C++ 0.12.0
API Documentation
|
Outcome of an encode operation, supporting fluent chaining. More...
#include <sofab.hpp>
Public Member Functions | |
| template<typename T > | |
| Result | write (sofab_id_t id, const T &value) noexcept |
| Chained write of a field (no-op if a prior call failed). | |
| template<typename T > | |
| Result | writeIf (sofab_id_t id, const T &value, bool condition) noexcept |
| Chained conditional write (no-op if a prior call failed). | |
| template<typename T > | |
| Result | writeLazy (sofab_id_t id, const T &value) noexcept |
| Chained nested-message field write that is omitted when the message is all-default (no-op if a prior call failed). | |
| Result | sequenceEndKeep () noexcept |
| Chained frame-keeping sequence-end (no-op if a prior call failed). | |
| Result | sequenceBeginLazy (sofab_id_t id) noexcept |
| Chained lazy sequence-begin (no-op if a prior call failed). | |
| Result | sequenceEnd () noexcept |
| Chained sequence-end marker (no-op if a prior call failed). | |
| operator bool () const noexcept | |
| True if no error occurred (same as ok()). | |
| bool | operator== (Error e) const noexcept |
Compare the held error code to e. | |
| bool | operator!= (Error e) const noexcept |
| Negated operator==(). | |
| bool | ok () const noexcept |
| True if the operation (and the chain so far) succeeded. | |
| Error | code () const noexcept |
| The first Error encountered in the chain. | |
Friends | |
| class | OStreamImpl |
Outcome of an encode operation, supporting fluent chaining.
Returned by every OStreamImpl write/sequence call. The first error is sticky: once set, subsequent chained calls become no-ops and the original error is preserved, so a chain can be checked once at the end. Convertible to bool (true on success).
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineexplicitnoexcept |
Negated operator==().
Definition at line 1117 of file sofab.hpp.
|
inlinenoexcept |
Chained lazy sequence-begin (no-op if a prior call failed).
| id | Field identifier of the nested sequence. |
Definition at line 1068 of file sofab.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
Chained frame-keeping sequence-end (no-op if a prior call failed).
Definition at line 1046 of file sofab.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
Chained conditional write (no-op if a prior call failed).
| id | Field identifier. |
| value | Value to encode; the wire type is deduced from T. |
| condition | Write the field only when true. |
Definition at line 1000 of file sofab.hpp.
|
inlinenoexcept |
Chained nested-message field write that is omitted when the message is all-default (no-op if a prior call failed).
| id | Field identifier. |
| value | Nested message to encode. |
Definition at line 1025 of file sofab.hpp.
|
friend |