glibmm r574 - in trunk: . gio/src



Author: jaalburqu
Date: Mon Feb  4 00:05:18 2008
New Revision: 574
URL: http://svn.gnome.org/viewvc/glibmm?rev=574&view=rev

Log:
2008-02-03  Josà Alburquerque  <jaalburqu svn gnome org>

	* gio/src/bufferedoutputstream.ccg: changed size param of
	create_sized() to type guint (in agreement with declaration)
	* gio/src/file.ccg:
	* gio/src/file.hg: added non-cancellable set_attribute_string(),
	set_attribute_byte_string(), set_attribute_{uint32, int32, uint64,
	int64}


Modified:
   trunk/ChangeLog
   trunk/gio/src/bufferedoutputstream.ccg
   trunk/gio/src/file.ccg
   trunk/gio/src/file.hg

Modified: trunk/gio/src/bufferedoutputstream.ccg
==============================================================================
--- trunk/gio/src/bufferedoutputstream.ccg	(original)
+++ trunk/gio/src/bufferedoutputstream.ccg	Mon Feb  4 00:05:18 2008
@@ -22,7 +22,7 @@
 
 namespace Gio
 {
-Glib::RefPtr<BufferedOutputStream> BufferedOutputStream::create_sized(const Glib::RefPtr<OutputStream>& base_stream, gsize size)
+Glib::RefPtr<BufferedOutputStream> BufferedOutputStream::create_sized(const Glib::RefPtr<OutputStream>& base_stream, guint size)
 {
     return Glib::RefPtr<Gio::BufferedOutputStream>(new BufferedOutputStream(base_stream, size));
 }

Modified: trunk/gio/src/file.ccg
==============================================================================
--- trunk/gio/src/file.ccg	(original)
+++ trunk/gio/src/file.ccg	Mon Feb  4 00:05:18 2008
@@ -784,6 +784,126 @@
   return res;
 }
 
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool File::set_attribute_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags)
+#else
+bool File::set_attribute_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  bool retvalue = g_file_set_attribute_string(gobj(), attribute.c_str(), value.c_str(), ((GFileQueryInfoFlags)(flags)), NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return retvalue;
+
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool File::set_attribute_byte_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags)
+#else
+bool File::set_attribute_byte_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  bool retvalue = g_file_set_attribute_byte_string(gobj(), attribute.c_str(), value.c_str(), ((GFileQueryInfoFlags)(flags)), NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return retvalue;
+
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool File::set_attribute_uint32(const std::string& attribute, guint32 value, FileQueryInfoFlags flags)
+#else
+bool File::set_attribute_uint32(const std::string& attribute, guint32 value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  bool retvalue = g_file_set_attribute_uint32(gobj(), attribute.c_str(), value, ((GFileQueryInfoFlags)(flags)), NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return retvalue;
+
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool File::set_attribute_int32(const std::string& attribute, gint32 value, FileQueryInfoFlags flags)
+#else
+bool File::set_attribute_int32(const std::string& attribute, gint32 value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  bool retvalue = g_file_set_attribute_int32(gobj(), attribute.c_str(), value, ((GFileQueryInfoFlags)(flags)), NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return retvalue;
+
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool File::set_attribute_uint64(const std::string& attribute, guint64 value, FileQueryInfoFlags flags)
+#else
+bool File::set_attribute_uint64(const std::string& attribute, guint64 value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  bool retvalue = g_file_set_attribute_uint64(gobj(), attribute.c_str(), value, ((GFileQueryInfoFlags)(flags)), NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return retvalue;
+
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool File::set_attribute_int64(const std::string& attribute, gint64 value, FileQueryInfoFlags flags)
+#else
+bool File::set_attribute_int64(const std::string& attribute, gint64 value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  bool retvalue = g_file_set_attribute_int64(gobj(), attribute.c_str(), value, ((GFileQueryInfoFlags)(flags)), NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return retvalue;
+
+}
+
 void File::mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
 {
   // Create a copy of the slot.

Modified: trunk/gio/src/file.hg
==============================================================================
--- trunk/gio/src/file.hg	(original)
+++ trunk/gio/src/file.hg	Mon Feb  4 00:05:18 2008
@@ -1156,26 +1156,115 @@
                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.
+   */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  bool set_attribute_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags);
+#else
+  bool set_attribute_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
   _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.
+   */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  bool set_attribute_byte_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags);
+#else
+  bool set_attribute_byte_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
   _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.
+   */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  bool set_attribute_uint32(const std::string& attribute, guint32 value, FileQueryInfoFlags flags);
+#else
+  bool set_attribute_uint32(const std::string& attribute, guint32 value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
   _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.
+   */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  bool set_attribute_int32(const std::string& attribute, gint32 value, FileQueryInfoFlags flags);
+#else
+  bool set_attribute_int32(const std::string& attribute, gint32 value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
   _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.
+   */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  bool set_attribute_uint64(const std::string& attribute, guint64 value, FileQueryInfoFlags flags);
+#else
+  bool set_attribute_uint64(const std::string& attribute, guint64 value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
   _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.
+   */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  bool set_attribute_int64(const std::string& attribute, gint64 value, FileQueryInfoFlags flags);
+#else
+  bool set_attribute_int64(const std::string& attribute, gint64 value, FileQueryInfoFlags flags, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
   /** Starts a @mount_operation, mounting the volume that contains the file. 
    * 
    * When this operation has completed, @a slot will be called with, 



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