pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::MimeBundle Struct Reference

One displayable value in several formats: MIME type to data, richest first. Text formats (text/plain, text/html, image/svg+xml, base64 image/png) are strings; +json formats are JSON objects, as Jupyter's display protocol and nbformat store them. More...

#include <mime_bundle.hpp>

Public Member Functions

void add (std::string mime, JsonValue data)
 
const JsonValue * find (std::string_view mime) const
 The data for mime, or nullptr.
 
JsonValue to_json_value () const
 The bundle as one JSON object, {"text/plain": ..., ...}.
 

Public Attributes

std::vector< std::pair< std::string, JsonValue > > entries
 

Detailed Description

One displayable value in several formats: MIME type to data, richest first. Text formats (text/plain, text/html, image/svg+xml, base64 image/png) are strings; +json formats are JSON objects, as Jupyter's display protocol and nbformat store them.

Member Function Documentation

◆ add()

void pulsatrix::MimeBundle::add ( std::string  mime,
JsonValue  data 
)
Exceptions
std::invalid_argumentif mime is already present.

◆ find()

const JsonValue * pulsatrix::MimeBundle::find ( std::string_view  mime) const

The data for mime, or nullptr.

◆ to_json_value()

JsonValue pulsatrix::MimeBundle::to_json_value ( ) const

The bundle as one JSON object, {"text/plain": ..., ...}.

Member Data Documentation

◆ entries

std::vector<std::pair<std::string, JsonValue> > pulsatrix::MimeBundle::entries

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