logo top
Main Page   Widgets   glibmm Namespaces   Book  

Gio::FileOutputStream Class Reference

FileOutputStream provides output streams that write their content to a file. More...

Inheritance diagram for Gio::FileOutputStream:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~FileOutputStream ()
GFileOutputStream* gobj ()
 Provides access to the underlying C GObject.
const GFileOutputStream* gobj () const
 Provides access to the underlying C GObject.
GFileOutputStream* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::RefPtr<FileInfoquery_info (const std::string& attributes, const Glib::RefPtr<Cancellable>& cancellable)
 Queries a file output stream for the given attributes .
void query_info_async (const std::string& attributes, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority=G_PRIORITY_DEFAULT)
void query_info_async (const std::string& attributes, const SlotAsyncReady& slot, int io_priority=G_PRIORITY_DEFAULT)
Glib::RefPtr<FileInfoquery_info_finish (const Glib::RefPtr<AsyncResult>& result)
 Finalizes the asynchronous query started by g_file_output_stream_query_info_async().
std::string get_etag () const
 Gets the entity tag for the file when its been written.

Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Gio::FileOutputStreamwrap (GFileOutputStream* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

FileOutputStream provides output streams that write their content to a file.

FileOutputStream implements Seekable, which allows the output stream to jump to arbitrary positions in the file and to truncate the file, provided the file system of the file supports these operations. Use the methods of the Seekable base class for seeking and positioning.

Since glibmm 2.16:


Constructor & Destructor Documentation

virtual Gio::FileOutputStream::~FileOutputStream (  )  [virtual]


Member Function Documentation

GFileOutputStream* Gio::FileOutputStream::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Gio::OutputStream.

const GFileOutputStream* Gio::FileOutputStream::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Gio::OutputStream.

GFileOutputStream* Gio::FileOutputStream::gobj_copy (  ) 

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented from Gio::OutputStream.

Glib::RefPtr<FileInfo> Gio::FileOutputStream::query_info ( const std::string attributes,
const Glib::RefPtr<Cancellable>&  cancellable 
)

Queries a file output stream for the given attributes .

This function blocks while querying the stream. For the asynchronous version of this function, see g_file_output_stream_query_info_async(). While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail with G::IO_ERROR_PENDING.

Can fail if the stream was already closed (with error being set to G::IO_ERROR_CLOSED), the stream has pending operations (with error being set to G::IO_ERROR_PENDING), or if querying info is not supported for the stream's interface (with error being set to G::IO_ERROR_NOT_SUPPORTED). In all cases of failure, 0 will be returned.

If cancellable is not 0, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G::IO_ERROR_CANCELLED will be set, and 0 will be returned.

Parameters:
attributes A file attribute query string.
cancellable Optional G::Cancellable object, 0 to ignore.
error A G::Error, 0 to ignore.
Returns:
A G::FileInfo for the stream , or 0 on error.

void Gio::FileOutputStream::query_info_async ( const std::string attributes,
const SlotAsyncReady slot,
const Glib::RefPtr<Cancellable>&  cancellable,
int  io_priority = G_PRIORITY_DEFAULT 
)

void Gio::FileOutputStream::query_info_async ( const std::string attributes,
const SlotAsyncReady slot,
int  io_priority = G_PRIORITY_DEFAULT 
)

Glib::RefPtr<FileInfo> Gio::FileOutputStream::query_info_finish ( const Glib::RefPtr<AsyncResult>&  result  ) 

Finalizes the asynchronous query started by g_file_output_stream_query_info_async().

Parameters:
result A G::AsyncResult.
error A G::Error, 0 to ignore.
Returns:
A G::FileInfo for the finished query.

std::string Gio::FileOutputStream::get_etag (  )  const

Gets the entity tag for the file when its been written.

This must be called after the stream has been written and closed. As the etag can change while writing.

Returns:
The entity tag for the stream.


Friends And Related Function Documentation

Glib::RefPtr<Gio::FileOutputStream> wrap ( GFileOutputStream *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
object The C instance.
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.


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

Generated for glibmm 2.4 by Doxygen 1.5.1 © 1997-2001