glibmm r755 - in trunk: . gio/giomm



Author: jjongsma
Date: Fri Dec 12 02:42:53 2008
New Revision: 755
URL: http://svn.gnome.org/viewvc/glibmm?rev=755&view=rev

Log:
add content_type_from_mime_type()

Modified:
   trunk/ChangeLog
   trunk/gio/giomm/contenttype.cc
   trunk/gio/giomm/contenttype.h

Modified: trunk/gio/giomm/contenttype.cc
==============================================================================
--- trunk/gio/giomm/contenttype.cc	(original)
+++ trunk/gio/giomm/contenttype.cc	Fri Dec 12 02:42:53 2008
@@ -60,6 +60,11 @@
   return g_content_type_can_be_executable(type.c_str());
 }
 
+Glib::ustring content_type_from_mime_type(const Glib::ustring& mime_type)
+{
+  return Glib::convert_return_gchar_ptr_to_ustring(g_content_type_from_mime_type(mime_type.c_str()));
+}
+
 Glib::ustring content_type_guess(const std::string& filename,
   const std::basic_string<guchar>& data, bool& result_uncertain)
 {

Modified: trunk/gio/giomm/contenttype.h
==============================================================================
--- trunk/gio/giomm/contenttype.h	(original)
+++ trunk/gio/giomm/contenttype.h	Fri Dec 12 02:42:53 2008
@@ -99,6 +99,15 @@
  */
 bool content_type_can_be_executable(const Glib::ustring& type);
 
+/** Tries to find a content type based on the mime type name.
+ *
+ * @param mime_type a mime type string.
+ * @returns string with content type or empty when it does not know.
+ *
+ * @newin2p20
+ */
+Glib::ustring content_type_from_mime_type(const Glib::ustring& mime_type);
+
 /**
  * Guesses the content type based on example data. If the function is uncertain,
  * @a result_uncertain will be set to true



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