|
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.
|
|
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.
|
|
String | mimeFromDataUrl (const String &data_url) |
| Best-effort parse of a Data URL to extract MIME type (empty if not parsable)
|
|
std::optional< JsonObject > | tryParseEnvelopeFromString (const String &content) |
| Parse a string into a media envelope if possible; returns nullopt if not media.
|
|
JsonObject | text (const String &s) |
| Create a text media envelope.
|
|
JsonObject | imageUri (const String &uri, const String &mime, JsonObject meta={}) |
| Create an image media envelope.
|
|
JsonObject | imageData (const String &base64, const String &mime, JsonObject meta={}) |
| Create an image media envelope with base64 data.
|
|
JsonObject | audioUri (const String &uri, const String &mime, JsonObject meta={}) |
| Create an audio media envelope.
|
|
JsonObject | audioData (const String &base64, const String &mime, JsonObject meta={}) |
| Create an audio media envelope with base64 data.
|
|
JsonObject | videoUri (const String &uri, const String &mime, JsonObject meta={}) |
| Create a video media envelope.
|
|
JsonObject | videoData (const String &base64, const String &mime, JsonObject meta={}) |
| Create a video media envelope with base64 data.
|
|
Media envelope namespace.