| Top |
| GMimeStream * | g_mime_stream_file_new () |
| GMimeStream * | g_mime_stream_file_open () |
| GMimeStream * | g_mime_stream_file_new_with_bounds () |
| gboolean | g_mime_stream_file_get_owner () |
| void | g_mime_stream_file_set_owner () |
A simple GMimeStream implementation that sits on top of the Standard C FILE pointer based I/O layer. Unlike GMimeStreamFs, a GMimeStreamFile will typically buffer read and write operations at the FILE level and so it may be wasteful to wrap one in a GMimeStreamBuffer stream.
Substreams share the FILE pointer, not their logical positions or EOF state. Reads stop at finite bounds and retry the underlying file after observed EOF, so another writer can extend it. Native absolute SEEK_SET coordinates, partial writes and seek-without-growth behavior remain.
Views borrow the FILE pointer. Finish using them before explicitly closing an owning parent, even though they retain the parent object.
GMimeStream *
g_mime_stream_file_new (FILE *fp);
Creates a new GMimeStreamFile object around fp
.
Note: The created GMimeStreamFile object will own the FILE pointer passed in.
GMimeStream * g_mime_stream_file_open (const char *path,const char *mode,GError **err);
Creates a new GMimeStreamFile object for the specified path
.
GMimeStream * g_mime_stream_file_new_with_bounds (FILE *fp,gint64 start,gint64 end);
Creates a new GMimeStreamFile object around fp
with bounds start
and end
.
Note: The created GMimeStreamFile object will own the FILE pointer passed in.
gboolean
g_mime_stream_file_get_owner (GMimeStreamFile *stream);
Gets whether or not stream
owns the backend FILE pointer.
void g_mime_stream_file_set_owner (GMimeStreamFile *stream,gboolean owner);
Sets whether or not stream
owns the backend FILE pointer.
Note: owner
should be TRUE if the stream should fclose() the
backend FILE pointer when destroyed or FALSE otherwise.
typedef struct _GMimeStreamFile GMimeStreamFile;
A GMimeStream wrapper around standard-c FILE pointers.