|
| bool | hasString (const JsonObject &j, const char *key) |
| | Check if a key exists and is a string.
|
| bool | hasObject (const JsonObject &j, const char *key) |
| | Check if a key exists and is an object.
|
| bool | eqType (const JsonObject &j, const char *value) |
| | Check if a key exists and is a specific type.
|
| bool | isKnownType (const std::string &v) |
| | Check if the media type is known.
|
| bool | hasKnownType (const JsonObject &j) |
| | Check if the media type is known.
|
|
bool | isMediaPart (const JsonObject &j) |
| | Quick probe to see if JSONObject looks like a media envelope (canonical or compatible).
|
| JsonObject | normalizeMediaPart (JsonObject j) |
| | Normalize various accepted shapes into the canonical envelope, validating constraints.
|
|
std::string | getMime (const JsonObject &j) |
| | Extract MIME type (returns empty string if not present).
|
|
bool | hasUri (const JsonObject &j) |
| | Returns true if the envelope carries a URI reference.
|
|
bool | hasData (const JsonObject &j) |
| | Returns true if the envelope carries inline base64 data.
|
|
std::string | mimeFromDataUrl (const std::string &data_url) |
| | Best-effort parse of a Data URL to extract MIME type (empty if not parsable).
|
|
std::optional< JsonObject > | tryParseEnvelopeFromString (const std::string &content) |
| | Parse a string into a media envelope if possible; returns nullopt if not media.
|
| JsonObject | text (const std::string &s) |
| | Create a text media envelope.
|
| JsonObject | imageUri (const std::string &uri, const std::string &mime, JsonObject meta={}) |
| | Create an image media envelope.
|
| JsonObject | imageData (const std::string &base64, const std::string &mime, JsonObject meta={}) |
| | Create an image media envelope with base64 data.
|
| JsonObject | audioUri (const std::string &uri, const std::string &mime, JsonObject meta={}) |
| | Create an audio media envelope.
|
| JsonObject | audioData (const std::string &base64, const std::string &mime, JsonObject meta={}) |
| | Create an audio media envelope with base64 data.
|
| JsonObject | videoUri (const std::string &uri, const std::string &mime, JsonObject meta={}) |
| | Create a video media envelope.
|
| JsonObject | videoData (const std::string &base64, const std::string &mime, JsonObject meta={}) |
| | Create a video media envelope with base64 data.
|
| JsonObject | documentUri (const std::string &uri, const std::string &mime, JsonObject meta={}) |
| | Create a document media envelope.
|
| JsonObject | documentData (const std::string &base64, const std::string &mime, JsonObject meta={}) |
| | Create a document media envelope with base64 data.
|
Media envelope namespace.