| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
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.
| ~etf_parser ()
| Destroy the etf parser object.
nlohmann::json | parse (const std::string &in)
| Convert ETF binary content to nlohmann::json.

## 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

  in | Raw binary ETF data (generally from a websocket)

Returns
  nlohmann::json JSON data for use in the library

Exceptions

  dpp::exception | Malformed or otherwise invalid ETF content

D++ Library version 9.0.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0