glibmm r545 - in trunk: . gio gio/src glib/src tools/pm
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: glibmm r545 - in trunk: . gio gio/src glib/src tools/pm
- Date: Sun, 27 Jan 2008 18:26:24 +0000 (GMT)
Author: murrayc
Date: Sun Jan 27 18:26:24 2008
New Revision: 545
URL: http://svn.gnome.org/viewvc/glibmm?rev=545&view=rev
Log:
2008-01-27 Murray Cumming <murrayc murrayc com>
* gio/src/fileattribute.ccg:
* gio/src/fileattribute.hg: Split into
* gio/src/fileattributeinfo.ccg:
* gio/src/fileattributeinfo.hg: and
* gio/src/fileattributeinfolist.ccg:
* gio/src/fileattributeinfolist.hg
* gio/giomm.h:
* gio/src/Makefile_list_of_hg.am_fragment:
* gio/src/file.hg:
* gio/src/fileinfo.hg:
* gio/src/outputstream.hg:
* gio/src/seekable.hg:
* glib/src/optionentry.hg: Adapted.
* tools/pm/DocsParser.pm: substitute_identifiers():
Tried (unsuccessfully) to remove G:: prefixes in generated documentation.
Added:
trunk/gio/src/fileattributeinfo.ccg
- copied, changed from r544, /trunk/gio/src/fileattribute.ccg
trunk/gio/src/fileattributeinfo.hg
- copied, changed from r544, /trunk/gio/src/fileattribute.hg
trunk/gio/src/fileattributeinfolist.ccg
- copied, changed from r544, /trunk/gio/src/fileattribute.ccg
trunk/gio/src/fileattributeinfolist.hg
- copied, changed from r544, /trunk/gio/src/fileattribute.hg
Removed:
trunk/gio/src/fileattribute.ccg
trunk/gio/src/fileattribute.hg
Modified:
trunk/ChangeLog
trunk/gio/giomm.h
trunk/gio/src/Makefile_list_of_hg.am_fragment
trunk/gio/src/file.hg
trunk/gio/src/fileinfo.hg
trunk/gio/src/outputstream.hg
trunk/gio/src/seekable.hg
trunk/glib/src/optionentry.hg
trunk/tools/pm/DocsParser.pm
Modified: trunk/gio/giomm.h
==============================================================================
--- trunk/gio/giomm.h (original)
+++ trunk/gio/giomm.h Sun Jan 27 18:26:24 2008
@@ -25,7 +25,7 @@
#include <giomm/cancellable.h>
#include <giomm/drive.h>
#include <giomm/error.h>
-#include <giomm/fileattribute.h>
+#include <giomm/fileattributeinfolist.h>
#include <giomm/fileenumerator.h>
#include <giomm/file.h>
#include <giomm/fileicon.h>
Modified: trunk/gio/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- trunk/gio/src/Makefile_list_of_hg.am_fragment (original)
+++ trunk/gio/src/Makefile_list_of_hg.am_fragment Sun Jan 27 18:26:24 2008
@@ -5,8 +5,8 @@
files_posix_hg =
files_win32_hg =
-files_general_hg = appinfo.hg asyncresult.hg cancellable.hg drive.hg error.hg file.hg fileattribute.hg \
- fileenumerator.hg fileicon.hg fileinfo.hg fileinputstream.hg fileoutputstream.hg \
+files_general_hg = appinfo.hg asyncresult.hg cancellable.hg drive.hg error.hg file.hg fileattributeinfo.hg \
+ fileattributeinfolist.hg fileenumerator.hg fileicon.hg fileinfo.hg fileinputstream.hg fileoutputstream.hg \
filemonitor.hg filterinputstream.hg \
icon.hg inputstream.hg loadableicon.hg mount.hg mountoperation.hg outputstream.hg \
seekable.hg simpleasyncresult.hg volume.hg volumemonitor.hg
Modified: trunk/gio/src/file.hg
==============================================================================
--- trunk/gio/src/file.hg (original)
+++ trunk/gio/src/file.hg Sun Jan 27 18:26:24 2008
@@ -20,7 +20,7 @@
#include <glibmm/error.h>
#include <glibmm/interface.h>
#include <giomm/asyncresult.h>
-#include <giomm/fileattribute.h>
+#include <giomm/fileattributeinfolist.h>
#include <giomm/fileenumerator.h>
#include <giomm/fileinfo.h>
#include <giomm/fileinputstream.h>
Copied: trunk/gio/src/fileattributeinfo.ccg (from r544, /trunk/gio/src/fileattribute.ccg)
==============================================================================
--- /trunk/gio/src/fileattribute.ccg (original)
+++ trunk/gio/src/fileattributeinfo.ccg Sun Jan 27 18:26:24 2008
@@ -19,13 +19,12 @@
#include <gio/gio.h>
-namespace Gio {
-
-// FileAttributeInfo
+namespace Gio
+{
FileAttributeInfo::FileAttributeInfo(const GFileAttributeInfo* ginfo)
:
- m_name(ginfo->name),
+ m_name(ginfo->name ? ginfo->name : ""),
m_type(static_cast<FileAttributeType>(ginfo->type)),
m_flags(static_cast<FileAttributeInfoFlags>(ginfo->flags))
{
@@ -67,22 +66,5 @@
return m_flags;
}
-// FileAttributeInfoList
-
-bool FileAttributeInfoList::empty() const
-{
- return gobj() == 0;
-}
-
-FileAttributeInfo
-FileAttributeInfoList::lookup(const std::string& name) const
-{
- GFileAttributeInfoList* cobject = const_cast<GFileAttributeInfoList*>(gobj());
- const GFileAttributeInfo* cinfo =
- g_file_attribute_info_list_lookup (cobject, name.c_str());
-
- FileAttributeInfo info(cinfo);
- return info;
-}
-
} // namespace Gio
+
Copied: trunk/gio/src/fileattributeinfo.hg (from r544, /trunk/gio/src/fileattribute.hg)
==============================================================================
--- /trunk/gio/src/fileattribute.hg (original)
+++ trunk/gio/src/fileattributeinfo.hg Sun Jan 27 18:26:24 2008
@@ -31,8 +31,6 @@
_WRAP_ENUM(FileAttributeInfoFlags, GFileAttributeInfoFlags, NO_GTYPE)
_WRAP_ENUM(FileAttributeStatus, GFileAttributeStatus, NO_GTYPE)
-// GFileAttributeInfo struct hand-wrapped
-// TODO: Use _CLASS_GENERIC?
/** Information about a specific attribute - see FileAttributeInfoList.
*
@@ -40,6 +38,7 @@
*/
class FileAttributeInfo
{
+ _CLASS_GENERIC(FileAttributeInfo, GFileAttributeInfo)
public:
explicit FileAttributeInfo(const GFileAttributeInfo* ginfo);
@@ -58,51 +57,5 @@
FileAttributeInfoFlags m_flags;
};
-
-/** Key-Value paired file attributes.
- * File attributes in GIO consist of a list of key-value pairs.
- *
- * Keys are strings that contain a key namespace and a key name, separated by a colon, e.g. "namespace:keyname".
- * Namespaces are included to sort key-value pairs by namespaces for relevance. Keys can be retreived using wildcards,
- * e.g. "standard::*" will return all of the keys in the "standard" namespace.
- *
- * Values are stored within the list in Gio::FileAttributeValue structures. Values can store different types, listed in the enum
- * Gio::FileAttributeType. Upon creation of a Gio::FileAttributeValue, the type will be set to Gio::FILE_ATTRIBUTE_TYPE_INVALID.
- *
- * The list of possible attributes for a filesystem (pointed to by a Gio::File) is availible as a Gio::FileAttributeInfoList.
- * This list is queryable by key names as indicated earlier.
- *
- * Classes that implement Gio::FileIface will create a Gio::FileAttributeInfoList and install default keys and values for their given file
- * system, architecture, and other possible implementation details (e.g., on a UNIX system, a file attribute key will be registered for
- * the user id for a given file).
- *
- * See http://library.gnome.org/devel/gio/unstable/gio-GFileAttribute.html for the list of default namespaces and the list of default keys.
- *
- * @newin2p16
- */
-class FileAttributeInfoList
-{
- _CLASS_OPAQUE_REFCOUNTED(FileAttributeInfoList, GFileAttributeInfoList,
- g_file_attribute_info_list_new,
- g_file_attribute_info_list_ref,
- g_file_attribute_info_list_unref)
- _IGNORE(g_file_attribute_info_list_new, g_file_attribute_info_list_ref, g_file_attribute_info_list_unref)
-public:
-
- /** Whether the FileAttributeInfoList is empty or invalid.
- * @result true if this FileAttributeInfoList is empty.
- */
- bool empty() const;
-
- /** Gets the file attribute with the name name from list.
- * @param name The name of the attribute to lookup.
- * @result A FileAttributeInfo for the name.
- */
- FileAttributeInfo lookup(const std::string& name) const;
- _IGNORE(g_file_attribute_info_list_lookup)
-
- _WRAP_METHOD(void add(const std::string& name, FileAttributeType type, FileAttributeInfoFlags flags = FILE_ATTRIBUTE_INFO_NONE), g_file_attribute_info_list_add)
-};
-
} // namespace Gio
Copied: trunk/gio/src/fileattributeinfolist.ccg (from r544, /trunk/gio/src/fileattribute.ccg)
==============================================================================
--- /trunk/gio/src/fileattribute.ccg (original)
+++ trunk/gio/src/fileattributeinfolist.ccg Sun Jan 27 18:26:24 2008
@@ -19,56 +19,14 @@
#include <gio/gio.h>
-namespace Gio {
-
-// FileAttributeInfo
-
-FileAttributeInfo::FileAttributeInfo(const GFileAttributeInfo* ginfo)
- :
- m_name(ginfo->name),
- m_type(static_cast<FileAttributeType>(ginfo->type)),
- m_flags(static_cast<FileAttributeInfoFlags>(ginfo->flags))
-{
-}
-
-FileAttributeInfo::FileAttributeInfo(const FileAttributeInfo& other)
+namespace Gio
{
- *this = other;
-}
-FileAttributeInfo&
-FileAttributeInfo::operator=(const FileAttributeInfo& other)
+FileAttributeInfoList::operator bool() const
{
- m_name = other.m_name;
- m_type = other.m_type;
- m_flags = other.m_flags;
- return *this;
+ return !empty();
}
-FileAttributeInfo::~FileAttributeInfo()
-{
-}
-
-std::string
-FileAttributeInfo::get_name() const
-{
- return m_name;
-}
-
-FileAttributeType
-FileAttributeInfo::get_type() const
-{
- return m_type;
-}
-
-FileAttributeInfoFlags
-FileAttributeInfo::get_flags() const
-{
- return m_flags;
-}
-
-// FileAttributeInfoList
-
bool FileAttributeInfoList::empty() const
{
return gobj() == 0;
Copied: trunk/gio/src/fileattributeinfolist.hg (from r544, /trunk/gio/src/fileattribute.hg)
==============================================================================
--- /trunk/gio/src/fileattribute.hg (original)
+++ trunk/gio/src/fileattributeinfolist.hg Sun Jan 27 18:26:24 2008
@@ -17,48 +17,13 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <string>
-#include <gio/gio.h> //TODO: avoid this include
-#include <glibmm/object.h>
+#include <giomm/fileattributeinfo.h>
_DEFS(giomm,gio)
namespace Gio
{
-//TODO: Fix the need for NO_GTYPE.
-_WRAP_ENUM(FileAttributeType, GFileAttributeType, NO_GTYPE)
-_WRAP_ENUM(FileAttributeInfoFlags, GFileAttributeInfoFlags, NO_GTYPE)
-_WRAP_ENUM(FileAttributeStatus, GFileAttributeStatus, NO_GTYPE)
-
-// GFileAttributeInfo struct hand-wrapped
-// TODO: Use _CLASS_GENERIC?
-
-/** Information about a specific attribute - see FileAttributeInfoList.
- *
- * @newin2p16
- */
-class FileAttributeInfo
-{
-public:
- explicit FileAttributeInfo(const GFileAttributeInfo* ginfo);
-
- FileAttributeInfo(const FileAttributeInfo& other);
- FileAttributeInfo& operator=(const FileAttributeInfo& other);
-
- ~FileAttributeInfo();
-
- std::string get_name() const;
- FileAttributeType get_type() const;
- FileAttributeInfoFlags get_flags() const;
-
-protected:
- std::string m_name;
- FileAttributeType m_type;
- FileAttributeInfoFlags m_flags;
-};
-
-
/** Key-Value paired file attributes.
* File attributes in GIO consist of a list of key-value pairs.
*
@@ -89,6 +54,11 @@
_IGNORE(g_file_attribute_info_list_new, g_file_attribute_info_list_ref, g_file_attribute_info_list_unref)
public:
+ /** Whether the FileAttributeInfoList is valid and non empty.
+ * @result true if this FileAttributeInfoList is not empty.
+ */
+ operator bool() const;
+
/** Whether the FileAttributeInfoList is empty or invalid.
* @result true if this FileAttributeInfoList is empty.
*/
Modified: trunk/gio/src/fileinfo.hg
==============================================================================
--- trunk/gio/src/fileinfo.hg (original)
+++ trunk/gio/src/fileinfo.hg Sun Jan 27 18:26:24 2008
@@ -20,7 +20,7 @@
#include <glibmm/arrayhandle.h>
#include <glibmm/object.h>
#include <glibmm/timeval.h>
-#include <giomm/fileattribute.h>
+#include <giomm/fileattributeinfolist.h>
#include <giomm/icon.h>
_DEFS(giomm,gio)
Modified: trunk/gio/src/outputstream.hg
==============================================================================
--- trunk/gio/src/outputstream.hg (original)
+++ trunk/gio/src/outputstream.hg Sun Jan 27 18:26:24 2008
@@ -48,7 +48,7 @@
* during the operation.
*
* If count is zero returns zero and does nothing. A value of @a count
- * larger than G::MAXSSIZE will cause a G::IO_ERROR_INVALID_ARGUMENT error.
+ * larger than MAXSSIZE will cause a IO_ERROR_INVALID_ARGUMENT error.
*
* On success, the number of bytes written to the stream is returned.
* It is not an error if this is not the same as the requested size, as it
@@ -71,7 +71,7 @@
* during the operation.
*
* If count is zero returns zero and does nothing. A value of @a count
- * larger than G::MAXSSIZE will cause a G::IO_ERROR_INVALID_ARGUMENT error.
+ * larger than MAXSSIZE will cause a IO_ERROR_INVALID_ARGUMENT error.
*
* On success, the number of bytes written to the stream is returned.
* It is not an error if this is not the same as the requested size, as it
@@ -226,7 +226,7 @@
*
* If @a cancellable is not <tt>0</tt>, 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 returned.
+ * was cancelled, the error IO_ERROR_CANCELLED will be returned.
* @param cancellable Optional cancellable object.
* @param error Location to store the error occuring, or <tt>0</tt> to ignore.
* @return <tt>true</tt> on success, <tt>false</tt> on error.
@@ -243,7 +243,7 @@
/** Closes the stream, releasing resources related to it.
*
- * Once the stream is closed, all other operations will return G::IO_ERROR_CLOSED.
+ * Once the stream is closed, all other operations will return IO_ERROR_CLOSED.
* Closing a stream multiple times will not return an error.
*
* Closing a stream will automatically flush any outstanding buffers in the
@@ -259,13 +259,13 @@
*
* On failure the first error that happened will be reported, but the close
* operation will finish as much as possible. A stream that failed to
- * close will still return G::IO_ERROR_CLOSED all operations. Still, it
+ * close will still return IO_ERROR_CLOSED all operations. Still, it
* is important to check and report the error to the user, otherwise
* there might be a loss of data as all data might not be written.
*
* If @a cancellable is not <tt>0</tt>, 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 returned.
+ * was cancelled, the error IO_ERROR_CANCELLED will be returned.
* Cancelling a close will still leave the stream closed, but there some streams
* can use a faster close that doesn't block to e.g. check errors. On
* cancellation (as with any error) there is no guarantee that all written
Modified: trunk/gio/src/seekable.hg
==============================================================================
--- trunk/gio/src/seekable.hg (original)
+++ trunk/gio/src/seekable.hg Sun Jan 27 18:26:24 2008
@@ -55,7 +55,7 @@
/** Seeks in the stream by the given @a offset, modified by @a type .
*
* @param offset A #goffset.
- * @param type A G::SeekType.
+ * @param type A Glib::SeekType.
* @return <tt>true</tt> if successful. If an error
* has occurred, this function will return <tt>false</tt>.
*/
Modified: trunk/glib/src/optionentry.hg
==============================================================================
--- trunk/glib/src/optionentry.hg (original)
+++ trunk/glib/src/optionentry.hg Sun Jan 27 18:26:24 2008
@@ -65,7 +65,7 @@
OptionEntry& operator=(const OptionEntry& src);
-#m4 _CONVERSION(`Glib::ustring',`const gchar*',`g_strdup(($3).c_str())')
+#m4 _CONVERSION(`Glib::ustring',`const gchar*',`($3).empty() ? NULL : g_strdup(($3).c_str())')
_MEMBER_GET(long_name, long_name, Glib::ustring, const char*)
_MEMBER_SET(long_name, long_name, Glib::ustring, const char*)
Modified: trunk/tools/pm/DocsParser.pm
==============================================================================
--- trunk/tools/pm/DocsParser.pm (original)
+++ trunk/tools/pm/DocsParser.pm Sun Jan 27 18:26:24 2008
@@ -350,7 +350,7 @@
# Some argument names are suffixed by "_" -- strip this.
# gtk-doc uses @thearg, but doxygen uses @a thearg.
- s" ?\@([a-zA-Z0-9]*(_[a-zA-Z0-9]+)*)_?\b" \ a $1 "g;
+ s" ?\@([a-zA-Z0-9]*(_[a-zA-Z0-9]+)*)_?\b" \ a $1"g;
s"^Note ?\d?: "\ note "mg;
s"</?programlisting>""g;
@@ -410,6 +410,7 @@
# Undo wrong substitutions.
s/\bHas::/HAS_/g;
s/\bNo::/NO_/g;
+ s/\bG:://g; #Rename G::Something to Something. Doesn't seem to work. murrayc.
# Replace C function names with C++ counterparts.
s/\b([a-z]+_[a-z][a-z\d_]+) ?\(\)/&DocsParser::substitute_function($doc_func, $1)/eg;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]