D++ (DPP)  10.0.30
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...

#include "etf.h"

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 ( )
default

Destroy the etf parser object.

Member Function Documentation

◆ parse()

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

Referenced by dpp::discord_client::handle_frame().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: