[glibmm] Gio::File: Simplify the code by using {?} in _WRAP_METHOD()



commit 101aeceee2c691155a7b71eb014b9ba051029f32
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Sep 15 15:18:33 2012 +0200

    Gio::File: Simplify the code by using {?} in _WRAP_METHOD()
    
            * gio/src/file.[hg|ccg]: This relatively new gmmproc syntax lets
    us avoid the manual implementations and declarations just to have
    overloads without the Cancellable parameters.

 ChangeLog        |    8 ++
 gio/src/file.ccg |  187 ---------------------------------------
 gio/src/file.hg  |  256 ++++--------------------------------------------------
 3 files changed, 27 insertions(+), 424 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 93daeef..d87c525 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2012-09-15  Murray Cumming  <murrayc murrayc com>
 
+        Gio::File: Simplify the code by using {?} in _WRAP_METHOD()
+
+        * gio/src/file.[hg|ccg]: This relatively new gmmproc syntax lets 
+	us avoid the manual implementations and declarations just to have
+	overloads without the Cancellable parameters.
+
+2012-09-15  Murray Cumming  <murrayc murrayc com>
+
 	AppLaunchContext: Add setenv(), unsetenv() and get_environment().
 
         * gio/src/applaunchcontext.hg: Wrap these C functions.
diff --git a/gio/src/file.ccg b/gio/src/file.ccg
index c5ade79..4958e2d 100644
--- a/gio/src/file.ccg
+++ b/gio/src/file.ccg
@@ -403,16 +403,6 @@ Glib::RefPtr<FileInfo> File::query_info(const std::string& attributes, FileQuery
   return retvalue;
 }
 
-bool File::query_exists() const
-{
-  return g_file_query_exists(const_cast<GFile*>(gobj()), 0);
-}
-
-FileType File::query_file_type(FileQueryInfoFlags flags) const
-{
-  return (FileType)g_file_query_file_type(const_cast<GFile*>(gobj()), (GFileQueryInfoFlags)flags, 0);
-}
-
 void
 File::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, FileQueryInfoFlags flags, int io_priority) const
 {
@@ -554,17 +544,6 @@ File::enumerate_children_async(const SlotAsyncReady& slot, const std::string& at
                                   slot_copy);
 }
 
-Glib::RefPtr<File> File::set_display_name(const Glib::ustring& display_name)
-{
-  GError* gerror = 0;
-  Glib::RefPtr<File> retvalue = Glib::wrap(g_file_set_display_name(gobj(), display_name.c_str(), 0, &(gerror)));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-
-}
-
 void
 File::set_display_name_async(const Glib::ustring& display_name, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority)
 {
@@ -896,71 +875,6 @@ File::set_attributes_finish(const Glib::RefPtr<AsyncResult>& result,
   return res;
 }
 
-bool File::set_attribute_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags)
-{
-  GError* gerror = 0;
-  bool retvalue = g_file_set_attribute_string(gobj(), attribute.c_str(), value.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-
-}
-
-bool File::set_attribute_byte_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags)
-{
-  GError* gerror = 0;
-  bool retvalue = g_file_set_attribute_byte_string(gobj(), attribute.c_str(), value.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-
-}
-
-bool File::set_attribute_uint32(const std::string& attribute, guint32 value, FileQueryInfoFlags flags)
-{
-  GError* gerror = 0;
-  bool retvalue = g_file_set_attribute_uint32(gobj(), attribute.c_str(), value, ((GFileQueryInfoFlags)(flags)), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-
-}
-
-bool File::set_attribute_int32(const std::string& attribute, gint32 value, FileQueryInfoFlags flags)
-{
-  GError* gerror = 0;
-  bool retvalue = g_file_set_attribute_int32(gobj(), attribute.c_str(), value, ((GFileQueryInfoFlags)(flags)), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-
-}
-
-bool File::set_attribute_uint64(const std::string& attribute, guint64 value, FileQueryInfoFlags flags)
-{
-  GError* gerror = 0;
-  bool retvalue = g_file_set_attribute_uint64(gobj(), attribute.c_str(), value, ((GFileQueryInfoFlags)(flags)), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-
-}
-
-bool File::set_attribute_int64(const std::string& attribute, gint64 value, FileQueryInfoFlags flags)
-{
-  GError* gerror = 0;
-  bool retvalue = g_file_set_attribute_int64(gobj(), attribute.c_str(), value, ((GFileQueryInfoFlags)(flags)), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-
-}
 
 void File::mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags)
 {
@@ -1678,16 +1592,6 @@ void File::poll_mountable(const SlotAsyncReady& slot)
     slot_copy);
 }
 
-Glib::RefPtr<FileInputStream> File::read()
-{
-  GError* gerror = 0;
-  Glib::RefPtr<FileInputStream> retvalue = Glib::wrap(g_file_read(gobj(), 0, &(gerror)));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-}
-
 void File::find_enclosing_mount_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority)
 {
   // Create a copy of the slot.
@@ -1812,77 +1716,6 @@ Glib::RefPtr<FileIOStream> File::create_file_readwrite(FileCreateFlags flags)
   return retvalue;
 }
 
-bool File::remove()
-{
-  GError* gerror = 0;
-  bool retvalue = g_file_delete(gobj(), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-}
-
-bool File::trash()
-{
-  GError* gerror = 0;
-  bool retvalue = g_file_trash(gobj(), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-}
-
-bool File::make_directory()
-{
-  GError* gerror = 0;
-  bool retvalue = g_file_make_directory(gobj(), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-}
-
-bool File::make_directory_with_parents()
-{
-  GError* gerror = 0;
-  const bool retvalue = g_file_make_directory_with_parents(gobj(), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-}
-
-bool File::make_symbolic_link(const std::string& symlink_value)
-{
-  GError* gerror = 0;
-  bool retvalue = g_file_make_symbolic_link(gobj(), symlink_value.c_str(), 0, &(gerror));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-}
-
-Glib::RefPtr<FileAttributeInfoList> File::query_settable_attributes()
-{
-  GError* gerror = 0;
-  Glib::RefPtr<FileAttributeInfoList> retvalue = Glib::wrap(g_file_query_settable_attributes(gobj(), 0, &(gerror)));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-}
-
-Glib::RefPtr<FileAttributeInfoList> File::query_writable_namespaces()
-{
-  GError* gerror = 0;
-  Glib::RefPtr<FileAttributeInfoList> retvalue = Glib::wrap(g_file_query_writable_namespaces(gobj(), 0, &(gerror)));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-}
-
-
 Glib::RefPtr<FileOutputStream> File::append_to(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags)
 {
   GError* gerror = 0;
@@ -1903,26 +1736,6 @@ Glib::RefPtr<FileOutputStream> File::append_to(FileCreateFlags flags)
   return retvalue;
 }
 
-Glib::RefPtr<Mount> File::find_enclosing_mount()
-{
-  GError* gerror = 0;
-  Glib::RefPtr<Mount> retvalue = Glib::wrap(g_file_find_enclosing_mount(gobj(), 0, &(gerror)));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-}
-
-Glib::RefPtr<AppInfo> File::query_default_handler()
-{
-  GError* gerror = 0;
-  Glib::RefPtr<AppInfo> retvalue = Glib::wrap(g_file_query_default_handler(gobj(), 0, &(gerror)));
-  if(gerror)
-    ::Glib::Error::throw_exception(gerror);
-
-  return retvalue;
-}
-
 bool File::load_contents(const Glib::RefPtr<Cancellable>& cancellable, char*& contents, gsize& length, std::string& etag_out)
 {
   GError* gerror = 0;
diff --git a/gio/src/file.hg b/gio/src/file.hg
index 9256739..8878e41 100644
--- a/gio/src/file.hg
+++ b/gio/src/file.hg
@@ -187,20 +187,10 @@ public:
   _WRAP_METHOD(std::string get_uri_scheme() const, g_file_get_uri_scheme)
 
   //TODO: We don't have both const and unconst versions because a FileInputStream can't really change the File.
-  _WRAP_METHOD(Glib::RefPtr<FileInputStream> read(const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(Glib::RefPtr<FileInputStream> read(const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_read,
                refreturn, errthrow)
 
-  /** Opens a file for reading. The result is a FileInputStream that
-   * can be used to read the contents of the file.
-   * 
-   * If the file does not exist, a Gio::Error with NOT_FOUND will be thrown.
-   * If the file is a directory, a Gio::Error with IS_DIRECTORY will be thrown.
-   * Other errors are possible too, and depend on what kind of filesystem the file is on.
-   * @return FileInputStream or an empty RefPtr on error.
-   */
-  Glib::RefPtr<FileInputStream> read();
-
   /** Asynchronously opens the file for reading.
    * For more details, see read() which is the synchronous version of this call.
    * When the operation is finished, @a slot will be called. You can then call read_finish() to get the result of the operation.
@@ -581,7 +571,7 @@ public:
                refreturn, errthrow)
 
 
-  _WRAP_METHOD(Glib::RefPtr<FileIOStream> open_readwrite(const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(Glib::RefPtr<FileIOStream> open_readwrite(const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_open_readwrite,
                refreturn, errthrow)
 
@@ -779,50 +769,9 @@ public:
 
   _IGNORE(g_file_query_info)
 
-  _WRAP_METHOD(bool query_exists(const Glib::RefPtr<Cancellable>& cancellable) const, g_file_query_exists)
+  _WRAP_METHOD(bool query_exists(const Glib::RefPtr<Cancellable>& cancellable{?}) const, g_file_query_exists)
 
-  /** Utility function to check if a particular file exists. This is
-   * implemented using query_info() and as such does blocking I/O.
-   *
-   * Note that in many cases it is racy to first check for file existance
-   * and then execute something based on the outcome of that, because the
-   * file might have been created or removed inbetween the operations. The
-   * general approach to handling that is to not check, but just do the
-   * operation and handle the errors as they come.
-   *
-   * As an example of race-free checking, take the case of reading a file, and
-   * if it doesn't exist, creating it. There are two racy versions: read it, and
-   * on error create it; and: check if it exists, if not create it. These
-   * can both result in two processes creating the file (with perhaps a partially
-   * written file as the result). The correct approach is to always try to create
-   * the file with g_file_create() which will either atomically create the file
-   * or throw a Gio::Error with EXISTS.
-   *
-   * However, in many cases an existance check is useful in a user
-   * interface, for instance to make a menu item sensitive/insensitive, so that
-   * you don't have to fool users that something is possible and then just show
-   * and error dialog. If you do this, you should make sure to also handle the
-   * errors that can happen due to races when you execute the operation.
-   * 
-   * @result true if the file exists (and can be detected without error), false otherwise (or if cancelled).
-   */
-  bool query_exists() const;
-
-
-  _WRAP_METHOD(FileType query_file_type(FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable) const, g_file_query_file_type)
-
-  /** Utility function to inspect the #GFileType of a file. This is
-   * implemented using query_info() and as such does blocking I/O.
-   *
-   * The primary use case of this method is to check if a file is a regular file,
-   * directory, or symlink.
-   * 
-   * @param flags: a set of FileQueryInfoFlags passed to query_info().
-   * @results The FileType of the file, or FILE_TYPE_UNKNOWN if the file does not exist.
-   *
-   * @newin{2,18}
-   */
-   FileType query_file_type(FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE) const;
+  _WRAP_METHOD(FileType query_file_type(FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}) const, g_file_query_file_type)
 
   /** Asynchronously gets the requested information about specified file. The result is a FileInfo object that contains key-value attributes (such as type or size for the file).
    *
@@ -906,7 +855,7 @@ public:
   Glib::RefPtr<FileInfo> query_filesystem_info(const std::string& attributes = "*");
   _IGNORE(g_file_query_filesystem_info)
 
-  _WRAP_METHOD(Glib::RefPtr<Mount> find_enclosing_mount(const Glib::RefPtr<Cancellable>& cancellable), 
+  _WRAP_METHOD(Glib::RefPtr<Mount> find_enclosing_mount(const Glib::RefPtr<Cancellable>& cancellable{?}), 
                g_file_find_enclosing_mount, retreturn, errthrow)
 
 
@@ -947,19 +896,6 @@ public:
                g_file_query_filesystem_info_finish,
                refreturn, errthrow)
 
-
-  /** Gets a Mount for the File. 
-   * 
-   * If the FileIface for the file does not have a mount (e.g. possibly a 
-   * remote share), an Gio::Error wtih NOT_FOUND will be thrown and an empty RefPtr 
-   * will be returned.
-   *
-   * @param cancellable Cancellable object.
-   * @return A Mount where the file is located.
-   */
-  Glib::RefPtr<Mount> find_enclosing_mount();
-
-
   /** Asynchronously gets the mount for the file.
    *
    * For more details, see find_enclosing_mount() which is
@@ -1075,30 +1011,10 @@ public:
                g_file_enumerate_children_finish,
                errthrow)
 
-  _WRAP_METHOD(Glib::RefPtr<File> set_display_name(const Glib::ustring& display_name, const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(Glib::RefPtr<File> set_display_name(const Glib::ustring& display_name, const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_set_display_name,
                refreturn, errthrow)
 
-  /** Renames the file to the specified display name.
-   * 
-   * The display name is converted from UTF8 to the correct encoding for the target
-   * filesystem if possible and the file is renamed to this.
-   * 
-   * If you want to implement a rename operation in the user interface the edit name
-   * (G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the initial value in the rename
-   * widget, and then the result after editing should be passed to set_display_name().
-   * 
-   * On success the resulting converted filename is returned.
-   * 
-   * The operation can be cancelled by triggering the cancellable object from another thread. If the operation
-   * was cancelled, a Gio::Error with CANCELLED will be thrown.
-   *
-   * @param display_name A string.
-   * @return A Glib::File specifying what the file was renamed to, or an empty RefPtr if there was an error.
-   */
-  Glib::RefPtr<File> set_display_name(const Glib::ustring& 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.
    *
@@ -1131,30 +1047,14 @@ public:
    * @param cancellable A Cancellable object which can be used to cancel the operation.
    * @return <tt>true</tt> if the file was deleted. <tt>false</tt> otherwise.
    */
-   _WRAP_METHOD(bool remove(const Glib::RefPtr<Cancellable>& cancellable),
+   _WRAP_METHOD(bool remove(const Glib::RefPtr<Cancellable>& cancellable{?}),
                 g_file_delete,
                 errthrow)
 
-  /** Deletes a file.
-   * If the file is a directory, it will only be deleted if it is empty.
-   * 
-   * @return <tt>true</tt> if the file was deleted. <tt>false</tt> otherwise.
-   */
-  bool remove();
-
-  _WRAP_METHOD(bool trash(const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(bool trash(const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_trash,
                errthrow)
 
-  /** Sends the file to the "Trashcan", if possible. This is similar to
-   * deleting it, but the user can recover it before emptying the trashcan.
-   * Not all filesystems support trashing, so this call can throw a Gio::Error
-   * with NOT_SUPPORTED.
-   *
-   * @return <tt>true</tt> on successful trash, <tt>false</tt> otherwise.
-   */
-  bool trash();
-
 
   /** A signal handler would be, for instance:
    * void on_file_progress(goffset current_num_bytes, goffset total_num_bytes);
@@ -1322,68 +1222,22 @@ public:
                g_file_make_directory,
                errthrow)
 
-  /** Creates a directory. 
-   * Note that this will only create a child directory of the immediate parent 
-   * directory of the path or URI given by the File. To recursively create 
-   * directories, see make_directory_with_parents(). This function will fail if 
-   * the parent directory does not exist, throwing an exception with 
-   * IO_ERROR_NOT_FOUND. If the file system doesn't support creating directories, 
-   * this function will fail, throwing an exception with IO_ERROR_NOT_SUPPORTED. 
-   * 
-   * @return <tt>true</tt> on successful creation, <tt>false</tt> otherwise.
-   */
-  bool make_directory();
-
-
-  _WRAP_METHOD(bool make_directory_with_parents(const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(bool make_directory_with_parents(const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_make_directory_with_parents,
                errthrow)
 
-  /** Creates a directory and any parent directories that may not exist, similar to 'mkdir -p'. 
-   * If the file system does not support creating directories, this function will fail, 
-   * throwing an exception with IO_ERROR_NOT_SUPPORTED.
-   * 
-   * @return <tt>true</tt> on successful creation, <tt>false</tt> otherwise.
-   *
-   * @newin{2,18}
-   */
-  bool make_directory_with_parents();
-
-  _WRAP_METHOD(bool make_symbolic_link(const std::string& symlink_value, const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(bool make_symbolic_link(const std::string& symlink_value, const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_make_symbolic_link,
                errthrow)
 
-  /** Creates a symbolic link.
-   * 
-   * @param symlink_value A string with the value of the new symlink.
-   * @return <tt>true</tt> on the creation of a new symlink, <tt>false</tt> otherwise.
-   */
-  bool make_symbolic_link(const std::string& symlink_value);
-
-  _WRAP_METHOD(Glib::RefPtr<FileAttributeInfoList> query_settable_attributes(const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(Glib::RefPtr<FileAttributeInfoList> query_settable_attributes(const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_query_settable_attributes,
                errthrow)
 
-  /** Obtain the list of settable attributes for the file.
-   * 
-   * Returns: a FileAttributeInfoList describing the settable attributes.
-   * @return A FileAttributeInfoList describing the settable attributes.
-   */
-  Glib::RefPtr<FileAttributeInfoList> query_settable_attributes();
-
-  _WRAP_METHOD(Glib::RefPtr<FileAttributeInfoList> query_writable_namespaces(const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(Glib::RefPtr<FileAttributeInfoList> query_writable_namespaces(const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_query_writable_namespaces,
                errthrow)
 
-  /** Obtain the list of attribute namespaces where new attributes 
-   * can be created by a user. An example of this is extended
-   * attributes (in the "xattr" namespace).
-   * 
-   * @return A FileAttributeInfoList describing the writable namespaces.
-   */
-  Glib::RefPtr<FileAttributeInfoList> query_writable_namespaces();
-
-
   /* This seems to be very generic (see the gpointer parameter),
      in a C kind of way. Hopefully we don't need it. murrayc
      gboolean                g_file_set_attribute              (GFile                      *file,
@@ -1463,95 +1317,30 @@ public:
 
   bool set_attributes_finish(const Glib::RefPtr<AsyncResult>& result, const Glib::RefPtr<FileInfo>& info);
 
-  _WRAP_METHOD(bool set_attribute_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(bool set_attribute_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_set_attribute_string,
                errthrow)
 
-  /** Sets @a attribute of type FILE_ATTRIBUTE_TYPE_STRING to @a value. 
-   * If @a attribute is of a different type, this operation will fail.
-   * 
-   * @param attribute A string containing the attribute's name.
-   * @param value A string containing the attribute's value.
-   * @param flags FileQueryInfoFlags.
-   * @return <tt>true</tt> if the @a attribute was successfully set, <tt>false</tt> otherwise.
-   */
-  bool set_attribute_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags);
-
-  _WRAP_METHOD(bool set_attribute_byte_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(bool set_attribute_byte_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_set_attribute_byte_string,
                errthrow)
 
-  /** Sets @a attribute of type FILE_ATTRIBUTE_TYPE_BYTE_STRING to @a value. 
-   * If @a attribute is of a different type, this operation will fail, 
-   * returning <tt>false</tt>. 
-   * 
-   * @param attribute A string containing the attribute's name.
-   * @param value A string containing the attribute's new value.
-   * @param flags A FileQueryInfoFlags.
-   * @return <tt>true</tt> if the @a attribute was successfully set to @a value 
-   * in the @a file, <tt>false</tt> otherwise.
-   */
-  bool set_attribute_byte_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags);
-
-  _WRAP_METHOD(bool set_attribute_uint32(const std::string& attribute, guint32 value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(bool set_attribute_uint32(const std::string& attribute, guint32 value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_set_attribute_uint32,
                errthrow)
 
-  /** Sets @a attribute of type FILE_ATTRIBUTE_TYPE_UINT32 to @a value. 
-   * If @a attribute is of a different type, this operation will fail.
-   * 
-   * @param attribute A string containing the attribute's name.
-   * @param value A #guint32 containing the attribute's new value.
-   * @param flags A FileQueryInfoFlags.
-   * @return <tt>true</tt> if the @a attribute was successfully set to @a value 
-   * in the @a file, <tt>false</tt> otherwise.
-   */
-  bool set_attribute_uint32(const std::string& attribute, guint32 value, FileQueryInfoFlags flags);
-
-  _WRAP_METHOD(bool set_attribute_int32(const std::string& attribute, gint32 value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(bool set_attribute_int32(const std::string& attribute, gint32 value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_set_attribute_int32,
                errthrow)
 
-  /** Sets @a attribute of type FILE_ATTRIBUTE_TYPE_INT32 to @a value. 
-   * If @a attribute is of a different type, this operation will fail.
-   * 
-   * @param attribute A string containing the attribute's name.
-   * @param value A #gint32 containing the attribute's new value.
-   * @param flags A FileQueryInfoFlags.
-   * @return <tt>true</tt> if the @a attribute was successfully set to @a value 
-   * in the @a file, <tt>false</tt> otherwise.
-   */
-  bool set_attribute_int32(const std::string& attribute, gint32 value, FileQueryInfoFlags flags);
-
-  _WRAP_METHOD(bool set_attribute_uint64(const std::string& attribute, guint64 value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(bool set_attribute_uint64(const std::string& attribute, guint64 value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_set_attribute_uint64,
                errthrow)
 
-  /** Sets @a attribute of type FILE_ATTRIBUTE_TYPE_UINT64 to @a value. 
-   * If @a attribute is of a different type, this operation will fail.
-   * 
-   * @param attribute A string containing the attribute's name.
-   * @param value A #guint64 containing the attribute's new value.
-   * @param flags A FileQueryInfoFlags.
-   * @return <tt>true</tt> if the @a attribute was successfully set to @a value 
-   * in the @a file, <tt>false</tt> otherwise.
-   */
-  bool set_attribute_uint64(const std::string& attribute, guint64 value, FileQueryInfoFlags flags);
-
-  _WRAP_METHOD(bool set_attribute_int64(const std::string& attribute, gint64 value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(bool set_attribute_int64(const std::string& attribute, gint64 value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_set_attribute_int64,
                errthrow)
 
-  /** Sets @a attribute of type FILE_ATTRIBUTE_TYPE_INT64 to @a value. 
-   * If @a attribute is of a different type, this operation will fail.
-   * 
-   * @param attribute A string containing the attribute's name.
-   * @param value A #guint64 containing the attribute's new value.
-   * @param flags A FileQueryInfoFlags.
-   * @return <tt>true</tt> if the @a attribute was successfully set, <tt>false</tt> otherwise.
-   */
-  bool set_attribute_int64(const std::string& attribute, gint64 value, FileQueryInfoFlags flags);
-
   /** Starts a @a mount_operation, mounting the volume that contains the file. 
    * 
    * When this operation has completed, @a slot will be called with, 
@@ -2015,17 +1804,10 @@ public:
   _WRAP_METHOD(bool poll_mountable_finish(const Glib::RefPtr<AsyncResult>& result),
                g_file_poll_mountable_finish, errthrow)
 
-  _WRAP_METHOD(Glib::RefPtr<AppInfo> query_default_handler(const Glib::RefPtr<Cancellable>& cancellable),
+  _WRAP_METHOD(Glib::RefPtr<AppInfo> query_default_handler(const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_query_default_handler,
                errthrow)
 
-/** Returns the AppInfo that is registered as the default
- * application to handle the file specified by the file.
- *
- * @result A AppInfo if the handle was found, or an empty RefPtr if there were errors.
- **/
-  Glib::RefPtr<AppInfo> query_default_handler();
-
   //TODO: Something better than char*& for contents?
   /** Loads the content of the file into memory, returning the size of the data. 
    * The data is always zero terminated, but this is not included in the resultant @a length.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]