From 5493f7ecc68ff219d402c1ed6985297465c66da6 Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Thu, 18 Dec 2008 21:36:57 +0000 Subject: [PATCH] Added get_fs_type() method to retrieve the file system type svn path=/trunk/; revision=1003 --- ChangeLog | 5 +++++ include/FS_Info.h | 1 + src/FS_Info.cc | 12 ++++++++++++ 3 files changed, 18 insertions(+) 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 = "" ;