[gparted] Update declarations of some LVM2_PV_Info member functions



commit c90365a6dbe4a809c6e2fa60ce8a6222e2b90e6e
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sat Jul 7 12:14:25 2012 +0100

    Update declarations of some LVM2_PV_Info member functions
    
    Add const qualifier to get_pv_attr_by_path() and get_pv_attr_by_row() as
    they only access member variables read-only.
    
    Make lvm2_pv_attr_to_num() a static member function as it doesn't access
    any member variables.

 include/LVM2_PV_Info.h |    6 +++---
 src/LVM2_PV_Info.cc    |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/include/LVM2_PV_Info.h b/include/LVM2_PV_Info.h
index 30b8813..cda362f 100644
--- a/include/LVM2_PV_Info.h
+++ b/include/LVM2_PV_Info.h
@@ -49,9 +49,9 @@ private:
 	void initialize_if_required() ;
 	void set_command_found() ;
 	void load_lvm2_pv_info_cache() ;
-	Glib::ustring get_pv_attr_by_path( const Glib::ustring & path, unsigned int entry ) ;
-	Glib::ustring get_pv_attr_by_row( unsigned int row, unsigned int entry ) ;
-	Byte_Value lvm2_pv_attr_to_num( const Glib::ustring str ) ;
+	Glib::ustring get_pv_attr_by_path( const Glib::ustring & path, unsigned int entry ) const ;
+	Glib::ustring get_pv_attr_by_row( unsigned int row, unsigned int entry ) const ;
+	static Byte_Value lvm2_pv_attr_to_num( const Glib::ustring str ) ;
 	static bool lvm2_pv_info_cache_initialized ;
 	static bool lvm_found ;
 	static std::vector<Glib::ustring> lvm2_pv_cache ;
diff --git a/src/LVM2_PV_Info.cc b/src/LVM2_PV_Info.cc
index a9cf3cd..629fe3b 100644
--- a/src/LVM2_PV_Info.cc
+++ b/src/LVM2_PV_Info.cc
@@ -276,7 +276,7 @@ void LVM2_PV_Info::load_lvm2_pv_info_cache()
 //Return PV's nth attribute.  Performs linear search of the cache and
 //  uses the first matching PV entry.  Attributes are numbered 0 upward
 //  using PV_ATTRIBUTE enumeration.
-Glib::ustring LVM2_PV_Info::get_pv_attr_by_path( const Glib::ustring & path, unsigned int entry )
+Glib::ustring LVM2_PV_Info::get_pv_attr_by_path( const Glib::ustring & path, unsigned int entry ) const
 {
 	for ( unsigned int i = 0 ; i < lvm2_pv_cache .size() ; i ++ )
 	{
@@ -297,7 +297,7 @@ Glib::ustring LVM2_PV_Info::get_pv_attr_by_path( const Glib::ustring & path, uns
 //Return PV's nth attribute from specified cache row.  Row is numbered
 //  0 upwards and attributes are numbers numbered 0 upwards using
 //  PV_ATTRIBUTE enumeration.
-Glib::ustring LVM2_PV_Info::get_pv_attr_by_row( unsigned int row, unsigned int entry )
+Glib::ustring LVM2_PV_Info::get_pv_attr_by_row( unsigned int row, unsigned int entry ) const
 {
 	if ( row >= lvm2_pv_cache .size() )
 		return "" ;



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