glibmm r525 - in trunk: . gio/src
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: glibmm r525 - in trunk: . gio/src
- Date: Sun, 20 Jan 2008 02:45:57 +0000 (GMT)
Author: murrayc
Date: Sun Jan 20 02:45:57 2008
New Revision: 525
URL: http://svn.gnome.org/viewvc/glibmm?rev=525&view=rev
Log:
2008-01-20 Murray Cumming <murrayc murrayc com>
* gio/src/fileinfo.hg: FileAttributeMatcher::create(): Add a default
value and documentation.
* gio/src/file.ccg:
* gio/src/file.hg:
* gio/src/mount.ccg:
* gio/src/mount.hg: const corrections for Slot* and Cancellable
parameters.
Modified:
trunk/ChangeLog
trunk/gio/src/file.ccg
trunk/gio/src/file.hg
trunk/gio/src/fileinfo.hg
trunk/gio/src/fileinputstream.hg
trunk/gio/src/fileoutputstream.hg
trunk/gio/src/inputstream.hg
trunk/gio/src/mount.ccg
trunk/gio/src/mount.hg
trunk/gio/src/outputstream.hg
trunk/gio/src/volume.ccg
Modified: trunk/gio/src/file.ccg
==============================================================================
--- trunk/gio/src/file.ccg (original)
+++ trunk/gio/src/file.ccg Sun Jan 20 02:45:57 2008
@@ -183,7 +183,7 @@
}
void
-File::read_async(const SlotAsyncReady& slot, Glib::RefPtr<Cancellable>& cancellable, int io_priority)
+File::read_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
Modified: trunk/gio/src/file.hg
==============================================================================
--- trunk/gio/src/file.hg (original)
+++ trunk/gio/src/file.hg Sun Jan 20 02:45:57 2008
@@ -175,7 +175,7 @@
* @param cancellable A Cancellable object which can be used to cancel the operation.
* @param io_priority The I/O priority of the request.
*/
- void read_async(const SlotAsyncReady& slot, Glib::RefPtr<Cancellable>& cancellable, int io_priority = G_PRIORITY_DEFAULT);
+ void read_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority = G_PRIORITY_DEFAULT);
/** Asynchronously opens the file for reading.
* For more details, see read() which is the synchronous version of this call.
@@ -655,8 +655,6 @@
#endif //GLIBMM_EXCEPTIONS_ENABLED
- //TODO: Use ustring for the display name?
-
/** Asynchronously sets the display name for a given Gio::File. For the synchronous version of this function, see set_display_name().
* When the operation is finished, @a slot will be called. You can then call set_display_name_finish() to get the result of the operation.
*
@@ -975,9 +973,28 @@
g_file_load_contents,
errthrow)
- //TODO: Documentation:
+ /** Starts an asynchronous load of the file's contents.
+ * For more details, see load_contents() which is the synchronous version of this call.
+ *
+ * When the load operation has completed, the @a slot will be called. To finish the operation,
+ * call load_contents_finish() with the AsyncResult provided to the @a slot.
+ *
+ * The operation can be cancelled by triggering the cancellable object from another thread.
+ * If the operation was cancelled, the error IO_ERROR_CANCELLED will be returned.
+ *
+ * @param slot A callback slot which will be called when the request is satisfied.
+ * @param cancellable A Cancellable object.
+ */
void load_contents_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
+ /** Starts an asynchronous load of the file's contents.
+ * For more details, see load_contents() which is the synchronous version of this call.
+ *
+ * When the load operation has completed, the @a slot will be called. To finish the operation,
+ * call load_contents_finish() with the AsyncResult provided to the @a slot.
+ *
+ * @param slot A callback slot which will be called when the request is satisfied.
+ */
void load_contents_async(const SlotAsyncReady& slot);
_IGNORE(g_file_load_contents_async)
@@ -1055,7 +1072,7 @@
_WRAP_VFUNC(std::string get_uri() const, "get_uri")
_WRAP_VFUNC(std::string get_parse_name() const, "get_parse_name")
- _WRAP_VFUNC(Glib::RefPtr<File> get_parent() const, "get_parent")
+ //TODO: Careful of refcounting: _WRAP_VFUNC(Glib::RefPtr<File> get_parent() const, "get_parent")
// TODO: GFileIface does not define get_child(). Perhaps it's not intentional.
// _WRAP_VFUNC(Glib::RefPtr<File> get_child(const std::string& name) const, "get_child")
@@ -1067,26 +1084,16 @@
#m4 _CONVERSION(`GFile*',`const Glib::RefPtr<File>&',`Glib::wrap($3, true)')
- _WRAP_VFUNC(bool contains_file(const Glib::RefPtr<File>& descendant) const,
- "contains_file")
+ _WRAP_VFUNC(bool contains_file(const Glib::RefPtr<File>& descendant) const, "contains_file")
- _WRAP_VFUNC(std::string get_relative_path(const Glib::RefPtr<File>& descendant) const,
- "get_relative_path")
+ _WRAP_VFUNC(std::string get_relative_path(const Glib::RefPtr<File>& descendant) const, "get_relative_path")
- _WRAP_VFUNC(Glib::RefPtr<File> resolve_relative_path(const std::string& relative_path) const,
- "resolve_relative_path")
+ //TODO: Careful of refcounting: _WRAP_VFUNC(Glib::RefPtr<File> resolve_relative_path(const std::string& relative_path) const, "resolve_relative_path")
_WRAP_VFUNC(bool is_native() const, "is_native")
_WRAP_VFUNC(bool has_uri_scheme(const std::string& uri_scheme) const, "has_uri_scheme")
};
-/** @relates Gio::File */
-inline bool operator==(const Glib::RefPtr<File>& lhs, const Glib::RefPtr<File>& rhs)
-{ return lhs->equal(rhs); }
-
-/** @relates Gio::File */
-inline bool operator!=(const Glib::RefPtr<File>& lhs, const Glib::RefPtr<File>& rhs)
-{ return ! lhs->equal(rhs); }
} // namespace Gio
Modified: trunk/gio/src/fileinfo.hg
==============================================================================
--- trunk/gio/src/fileinfo.hg (original)
+++ trunk/gio/src/fileinfo.hg Sun Jan 20 02:45:57 2008
@@ -45,8 +45,15 @@
NONE, g_file_attribute_matcher_ref, g_file_attribute_matcher_unref)
public:
- //TODO: Documentation.
- static Glib::RefPtr<FileAttributeMatcher> create(const std::string& attributes);
+ /** Creates a new file attribute matcher, which matches attributes against a given string.
+ * The attribute string should be formatted with specific keys separated from namespaces with a double colon.
+ * Several "namespace::key" strings may be concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
+ * The wildcard "*" may be used to match all keys and namespaces, or "namespace::*" will match all keys in a given namespace.
+ *
+ * @param attributes The attributes string.
+ * @result a new FileAttributeMatcher.
+ */
+ static Glib::RefPtr<FileAttributeMatcher> create(const std::string& attributes = "*");
_WRAP_METHOD(bool matches(const std::string& full_name) const, g_file_attribute_matcher_matches)
_WRAP_METHOD(bool matches_only(const std::string& full_name) const, g_file_attribute_matcher_matches_only)
Modified: trunk/gio/src/fileinputstream.hg
==============================================================================
--- trunk/gio/src/fileinputstream.hg (original)
+++ trunk/gio/src/fileinputstream.hg Sun Jan 20 02:45:57 2008
@@ -31,6 +31,8 @@
namespace Gio
{
+//TODO: Remove (ignore) functions that just call the base Seekable class? See http://bugzilla.gnome.org/show_bug.cgi?id=509990
+
/** FileInputStream provides input streams that take their content from a file.
*
* FileInputStream implements Seekable, which allows the input stream to jump to arbitrary positions in the file,
Modified: trunk/gio/src/fileoutputstream.hg
==============================================================================
--- trunk/gio/src/fileoutputstream.hg (original)
+++ trunk/gio/src/fileoutputstream.hg Sun Jan 20 02:45:57 2008
@@ -32,6 +32,8 @@
namespace Gio
{
+//TODO: Remove (ignore) functions that just call the base Seekable class? See http://bugzilla.gnome.org/show_bug.cgi?id=509990
+
/** FileOutputStream provides output streams that write their content to a file.
*
* FileOutputStream implements Seekable, which allows the output stream to jump
Modified: trunk/gio/src/inputstream.hg
==============================================================================
--- trunk/gio/src/inputstream.hg (original)
+++ trunk/gio/src/inputstream.hg Sun Jan 20 02:45:57 2008
@@ -39,10 +39,7 @@
_CLASS_GOBJECT(InputStream, GInputStream, G_INPUT_STREAM, Glib::Object, GObject)
public:
- // I think it's ok to pass Cancellables as const as internally they
- // are used only by g_push/pop_current_cancellable (markoa)
- // Btw all cancellable parameters are optional - TODO see how that
- // should translate here (overloads for all?).
+ //TODO: Add overloads with no cancellable.
_WRAP_METHOD(gssize read(void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable),
g_input_stream_read,
errthrow)
Modified: trunk/gio/src/mount.ccg
==============================================================================
--- trunk/gio/src/mount.ccg (original)
+++ trunk/gio/src/mount.ccg Sun Jan 20 02:45:57 2008
@@ -89,7 +89,7 @@
}
-void Mount::remount(const Glib::RefPtr<MountOperation>& operation, SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
+void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
@@ -103,7 +103,7 @@
slot_copy);
}
-void Mount::remount(const Glib::RefPtr<MountOperation>& operation, SlotAsyncReady& slot)
+void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
Modified: trunk/gio/src/mount.hg
==============================================================================
--- trunk/gio/src/mount.hg (original)
+++ trunk/gio/src/mount.hg Sun Jan 20 02:45:57 2008
@@ -100,7 +100,7 @@
* @param slot A callback which will be called when the operation is completed or canceled.
* @param cancellable A cancellable object which can be used to cancel the operation.
*/
- void remount(const Glib::RefPtr<MountOperation>& operation, SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
+ void remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
/** Remounts a mount.
* This is an asynchronous operation, and is finished by calling mount_finish() with the AsyncResult data returned in the callback slot.
@@ -112,7 +112,7 @@
* @param operation A mount operation.
* @param slot A callback which will be called when the operation is completed or canceled.
*/
- void remount(const Glib::RefPtr<MountOperation>& operation, SlotAsyncReady& slot);
+ void remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot);
/** Remounts a mount.
*
Modified: trunk/gio/src/outputstream.hg
==============================================================================
--- trunk/gio/src/outputstream.hg (original)
+++ trunk/gio/src/outputstream.hg Sun Jan 20 02:45:57 2008
@@ -41,7 +41,7 @@
_CLASS_GOBJECT(OutputStream, GOutputStream, G_OUTPUT_STREAM, Glib::Object, GObject)
public:
- //TODO: Can Cancellable be NULL?
+ //TODO: Add overloads with no cancellable.
_WRAP_METHOD(gssize write(const void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable),
g_output_stream_write,
errthrow)
Modified: trunk/gio/src/volume.ccg
==============================================================================
--- trunk/gio/src/volume.ccg (original)
+++ trunk/gio/src/volume.ccg Sun Jan 20 02:45:57 2008
@@ -53,7 +53,7 @@
namespace Gio {
void
-Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,const Glib::RefPtr<Cancellable>& cancellable)
+Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]