gparted r1003 - in trunk: . include src



Author: gedakc
Date: Thu Dec 18 21:36:57 2008
New Revision: 1003
URL: http://svn.gnome.org/viewvc/gparted?rev=1003&view=rev

Log:
Added get_fs_type() method to retrieve the file system type

Modified:
   trunk/ChangeLog
   trunk/include/FS_Info.h
   trunk/src/FS_Info.cc

Modified: trunk/include/FS_Info.h
==============================================================================
--- trunk/include/FS_Info.h	(original)
+++ trunk/include/FS_Info.h	Thu Dec 18 21:36:57 2008
@@ -29,6 +29,7 @@
 	FS_Info() ;
 	FS_Info( bool do_refresh ) ;
 	~FS_Info() ;
+	Glib::ustring get_fs_type( const Glib::ustring & path ) ;
 	Glib::ustring get_label( const Glib::ustring & path, bool & found ) ;
 	Glib::ustring get_uuid( const Glib::ustring & path ) ;
 private:

Modified: trunk/src/FS_Info.cc
==============================================================================
--- trunk/src/FS_Info.cc	(original)
+++ trunk/src/FS_Info.cc	Thu Dec 18 21:36:57 2008
@@ -60,6 +60,18 @@
 	return entry;
 }
 
+Glib::ustring FS_Info::get_fs_type( const Glib::ustring & path )
+{
+	Glib::ustring fs_type = "" ;
+
+	//Retrieve the line containing the device path
+	Glib::ustring temp = get_device_entry( path ) ;
+	
+	//Retrieve TYPE
+	fs_type = Utils::regexp_label( temp, "TYPE=\"([^\"]*)\"" ) ;
+	return fs_type ;
+}
+
 Glib::ustring FS_Info::get_label( const Glib::ustring & path, bool & found )
 {
 	Glib::ustring label = "" ;



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