diff --git a/ChangeLog b/ChangeLog index 0121aa7c..b726fafe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-12-18 Curtis Gedak + + * include/FS_Info.h, + src/FS_Info.cc: Added get_fs_type() method + 2008-12-08 Curtis Gedak * include/FS_Info.h, diff --git a/include/FS_Info.h b/include/FS_Info.h index 2f5304e7..d7c49fa5 100644 --- a/include/FS_Info.h +++ b/include/FS_Info.h @@ -29,6 +29,7 @@ public: 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: diff --git a/src/FS_Info.cc b/src/FS_Info.cc index 0c5e94c9..fd7b26c3 100644 --- a/src/FS_Info.cc +++ b/src/FS_Info.cc @@ -60,6 +60,18 @@ Glib::ustring FS_Info::get_device_entry( const Glib::ustring & path ) 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 = "" ;