HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
hi::v1::pickle< T > Struct Template Reference

#include <hikogui/codec/pickle.hpp>

Public Member Functions

datum encode (T const &rhs) const noexcept
 Encode the value of a type into a UTF-8 string.
 
datum encode (T const &rhs) const noexcept
 
decode (datum rhs) const
 Decode a UTF-8 string into a value of a given type.
 
decode (datum rhs) const
 

Detailed Description

template<typename T>
struct hi::v1::pickle< T >

Encode and decode a type to and from a UTF-8 string.

This codec is used to serialize data into strings, for example in JSON configuration files.

Member Function Documentation

◆ decode()

template<typename T >
T hi::v1::pickle< T >::decode ( datum rhs) const
inline

Decode a UTF-8 string into a value of a given type.

Parameters
rhsThe string to decode
Returns
The decoded value.
Exceptions
parse_errorWhen the decoded value is incorrect.

◆ encode()

template<typename T >
datum hi::v1::pickle< T >::encode ( T const & rhs) const
inlinenoexcept

Encode the value of a type into a UTF-8 string.

Parameters
rhsThe value to encode
Returns
The encoded value as a string.

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