Add device sector size to partition object

The device sector size is needed in all calculations that convert
between sectors and bytes.  The device sector_size is included in
the partition object because this object is used to contain
operation information in addition to actual partitions and
unallocated space.  A second option was considered to pass the
device object to many methods, but this was considered a much
larger task that might not provide significant gains in
maintainability.
This commit is contained in:
Curtis Gedak 2010-04-19 19:06:08 -06:00
parent acd29683a9
commit 4bcd0a3704
2 changed files with 4 additions and 1 deletions

View File

@ -115,7 +115,9 @@ public:
bool strict ; //Indicator if start and end sectors must stay unchanged
bool strict_start ; //Indicator if start sector must stay unchanged
Byte_Value sector_size ; //Sector size of the disk device needed for converting to/from sectors and bytes.
private:
void sort_paths_and_remove_duplicates() ;

View File

@ -43,6 +43,7 @@ void Partition::Reset()
label .clear() ;
uuid .clear() ;
partition_number = sector_start = sector_end = sectors_used = sectors_unused = -1;
sector_size = 0 ;
color .set( "black" ) ;
inside_extended = busy = strict = strict_start = false ;
logicals .clear() ;