| Top |
GMimeMultipartRelated *
g_mime_multipart_related_new (void);
Creates an empty multipart/related container.
GMimeEntity *
g_mime_multipart_related_get_root (GMimeMultipartRelated *related);
Selects the immediate child identified by the Content-Type start parameter. If start is absent, selects the first child matching the type parameter, ignoring ASCII case. An unmatched selector falls back to the first child. This does not modify headers or traverse descendants.
void g_mime_multipart_related_set_root (GMimeMultipartRelated *related,GMimeEntity *root);
Replaces the explicitly selected child, or inserts root
first if
no selector matches. Sets the type parameter to the root's MIME type.
A root at index zero removes start; a later root uses its Content-Id,
generating one if necessary. The container retains root
without
removing other occurrences of that entity from the child list.
int g_mime_multipart_related_index_of_uri (GMimeMultipartRelated *related,const char *uri,GError **error);
Finds the first immediate child matching uri
. CID URIs compare their
escaped path to Content-Id, case-sensitively. Other absolute URIs match
Content-Location, resolving relative locations against the child's
Content-Base, or the container's Content-Base if the child has none.
Relative queries compare literal relative Content-Location strings.
Absolute comparisons use GLib URI normalization, ignore user information and fragments, and compare scheme and host ignoring ASCII case. Paths and queries remain case-sensitive. No network or filesystem access occurs.
gboolean g_mime_multipart_related_contains_uri (GMimeMultipartRelated *related,const char *uri,GError **error);
Tests whether g_mime_multipart_related_index_of_uri() finds a resource.
GMimeStream * g_mime_multipart_related_open (GMimeMultipartRelated *related,const char *uri,char **mime_type,char **charset,GError **error);
Opens a lazy decoded reader for the first matching child. A missing
resource, non-leaf child, or leaf without content reports GMIME_ERROR
with ENOENT. A content object without a backing stream reports
GMIME_ERROR_INVALID_OPERATION. URI parsing/resolution and backing-stream
rewind errors are propagated. Both metadata outputs are NULL on failure.
The stream retains its source, not the multipart or child. Reader state,
backing-stream position, and subsequent read errors follow
g_mime_content_open(). No external URI is fetched.
related |
||
uri |
an absolute or relative UTF-8 URI string |
|
mime_type |
the allocated MIME type. |
[out][optional][nullable][transfer full] |
charset |
the allocated charset, if present. |
[out][optional][nullable][transfer full] |
error |
return location for an error, or |