D++ (DPP)
C++ Discord API Bot Library
dpp::etf_parser Class Reference

The etf_parser class can serialise and deserialise ETF (Erlang Term Format) into and out of an nlohmann::json object, so that layers above the websocket don't have to be any different for handling ETF. More...

Public Member Functions

 etf_parser ()
 Construct a new etf parser object. More...
 
 ~etf_parser ()
 Destroy the etf parser object. More...
 
nlohmann::json parse (const std::string &in)
 Convert ETF binary content to nlohmann::json. More...
 

Detailed Description

The etf_parser class can serialise and deserialise ETF (Erlang Term Format) into and out of an nlohmann::json object, so that layers above the websocket don't have to be any different for handling ETF.

Constructor & Destructor Documentation

◆ etf_parser()

dpp::etf_parser::etf_parser ( )

Construct a new etf parser object.

◆ ~etf_parser()

dpp::etf_parser::~etf_parser ( )

Destroy the etf parser object.

Member Function Documentation

◆ parse()

nlohmann::json dpp::etf_parser::parse ( const std::string &  in)

Convert ETF binary content to nlohmann::json.

Parameters
inRaw binary ETF data (generally from a websocket)
Returns
nlohmann::json JSON data for use in the library
Exceptions
dpp::exceptionMalformed or otherwise invalid ETF content
D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0