Create get_byte_length method

This commit is contained in:
Curtis Gedak 2010-04-27 11:28:36 -06:00
parent cb08e8c7dd
commit fe9ee68385
2 changed files with 9 additions and 0 deletions

View File

@ -82,6 +82,7 @@ public:
void add_path( const Glib::ustring & path, bool clear_paths = false ) ;
void add_paths( const std::vector<Glib::ustring> & paths, bool clear_paths = false ) ;
Byte_Value get_byte_length() const ;
Sector get_length() const ;
Glib::ustring get_path() const ;
std::vector<Glib::ustring> get_paths() const ;

View File

@ -154,6 +154,14 @@ void Partition::add_paths( const std::vector<Glib::ustring> & paths, bool clear_
sort_paths_and_remove_duplicates() ;
}
Byte_Value Partition::get_byte_length() const
{
if ( get_length() >= 0 )
return get_length() * sector_size ;
else
return -1 ;
}
Sector Partition::get_length() const
{
if ( sector_start >= 0 && sector_end >= 0 )