#include <protobuf.hpp>
application/x-protobuf codec: Protocol Buffers binary encoding of protoc messages. Invalid messages raise std::invalid_argument ( 400 on server side).
- Author
- Vincent Lachenal
- Since
- 0.2
◆ deserialize()
| void anch::codec::Protobuf::deserialize |
( |
T & | value, |
|
|
std::istream & | input, |
|
|
anch::codec::Side | side ) |
|
static |
Read message (body size is bounded by maxBodySize )
- Parameters
-
| value | the message to fill |
| input | the input stream |
| side | the side |
- Exceptions
-
◆ mediaType()
| std::string_view anch::codec::Protobuf::mediaType |
( |
| ) |
|
|
staticnoexcept |
Media type
- Returns
application/x-protobuf
◆ read() [1/2]
| void anch::codec::Protobuf::read |
( |
google::protobuf::Message & | message, |
|
|
std::istream & | input ) |
|
static |
Read message (any protoc message)
- Parameters
-
| message | the message to fill |
| input | the input stream |
- Exceptions
-
| std::invalid_argument | when message is invalid |
◆ read() [2/2]
| void anch::codec::Protobuf::read |
( |
google::protobuf::Message & | message, |
|
|
std::string_view | data ) |
|
static |
Read message (any protoc message)
- Parameters
-
| message | the message to fill |
| data | the serialized message |
- Exceptions
-
| std::invalid_argument | when message is invalid |
- Since
- 0.3
◆ serialize()
| void anch::codec::Protobuf::serialize |
( |
const T & | value, |
|
|
std::ostream & | out ) |
|
static |
Write message
- Parameters
-
| value | the message |
| out | the output stream |
- Exceptions
-
| std::runtime_error | when message can not be written |
◆ write()
| void anch::codec::Protobuf::write |
( |
const google::protobuf::Message & | message, |
|
|
std::ostream & | out ) |
|
static |
Write message (any protoc message)
- Parameters
-
| message | the message |
| out | the output stream |
- Exceptions
-
| std::runtime_error | when message can not be written |
The documentation for this struct was generated from the following file: