AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::codec::FormatPolicy< F > Struct Template Reference

Policy of a format codec: options of each side and errors translation. More...

#include <formatCodec.hpp>

Inheritance diagram for anch::codec::FormatPolicy< F >:
Collaboration diagram for anch::codec::FormatPolicy< F >:

Static Public Member Functions

static void configure (typename F::Options &options, anch::codec::Side side)
static void translate (const std::exception &error)

Detailed Description

template<anch::codec::DataFormat F>
struct anch::codec::FormatPolicy< F >

Policy of a format codec: options of each side and errors translation.

Codec plugins specialize it for their format (a format does not know Side ): anch-codec-json sets the constraints checks and limits of each side and translates payload size errors into ContentTooLarge . The default policy uses the default options for both sides and does not translate errors.

Template Parameters
Fthe format type
Since
0.3

Member Function Documentation

◆ configure()

void anch::codec::FormatPolicy< F >::configure ( typename F::Options & options,
anch::codec::Side side )
inlinestatic

Configure the options of a side (they are copied from the format default options)

Parameters
optionsthe options
sidethe side

◆ translate()

void anch::codec::FormatPolicy< F >::translate ( const std::exception & error)
inlinestatic

Translate a deserialization error: throw another exception, or return to rethrow the error

Parameters
errorthe error

The documentation for this struct was generated from the following file: