equal
deleted
inserted
replaced
125 iBytesPerSector=aDriveSectorSize; |
125 iBytesPerSector=aDriveSectorSize; |
126 return; |
126 return; |
127 } |
127 } |
128 else |
128 else |
129 { |
129 { |
130 std::cout<<"Warning: Invalid Sector Size value. Default value is considered.\n"; |
130 cout<<"Warning: Invalid Sector Size value. Default value is considered.\n"; |
131 } |
131 } |
132 } |
132 } |
133 iBytesPerSector=KDefaultBytesPerSector; |
133 iBytesPerSector=KDefaultBytesPerSector; |
134 } |
134 } |
135 |
135 |
160 if (aDriveNoOfFATs != 0) |
160 if (aDriveNoOfFATs != 0) |
161 { |
161 { |
162 // If invalid value for No of FATs is provided, generate a warning and take the default value. |
162 // If invalid value for No of FATs is provided, generate a warning and take the default value. |
163 if ((aDriveNoOfFATs>255) || (aDriveNoOfFATs<1)) |
163 if ((aDriveNoOfFATs>255) || (aDriveNoOfFATs<1)) |
164 { |
164 { |
165 std::cout<<"Warning: No of FATs should be between 0 and 256. Default value is considered.\n"; |
165 cout<<"Warning: No of FATs should be between 0 and 256. Default value is considered.\n"; |
166 iNumberOfFats= KDefaultNumFats; |
166 iNumberOfFats= KDefaultNumFats; |
167 return; |
167 return; |
168 } |
168 } |
169 iNumberOfFats= aDriveNoOfFATs; |
169 iNumberOfFats= aDriveNoOfFATs; |
170 } |
170 } |
405 @internalComponent |
405 @internalComponent |
406 @released |
406 @released |
407 |
407 |
408 @param aVolumeLable Data Drive Volume Label |
408 @param aVolumeLable Data Drive Volume Label |
409 */ |
409 */ |
410 void TFATBaseBootSector::SetVolumeLab(String aVolumeLable) |
410 void TFATBaseBootSector::SetVolumeLab(string aVolumeLable) |
411 { |
411 { |
412 // Set the default value of VolumeLable(i.e. "NO NAME ") if not provided |
412 // Set the default value of VolumeLable(i.e. "NO NAME ") if not provided |
413 // by the user. |
413 // by the user. |
414 if (aVolumeLable.empty()) |
414 if (aVolumeLable.empty()) |
415 { |
415 { |
421 // the first 11 characters and generate a warning. |
421 // the first 11 characters and generate a warning. |
422 int volumeMaxLangth= 11; |
422 int volumeMaxLangth= 11; |
423 int volumeLabelSize= aVolumeLable.size(); |
423 int volumeLabelSize= aVolumeLable.size(); |
424 if (volumeLabelSize > volumeMaxLangth) |
424 if (volumeLabelSize > volumeMaxLangth) |
425 { |
425 { |
426 std::cout<<"Warning: Size overflow for Data Drive Volume Label. Truncating to 11-bytes.\n"; |
426 cout<<"Warning: Size overflow for Data Drive Volume Label. Truncating to 11-bytes.\n"; |
427 aVolumeLable.resize(volumeMaxLangth); |
427 aVolumeLable.resize(volumeMaxLangth); |
428 strcpy(reinterpret_cast<char*>(iVolumeLabel),aVolumeLable.c_str()); |
428 strcpy(reinterpret_cast<char*>(iVolumeLabel),aVolumeLable.c_str()); |
429 return; |
429 return; |
430 } |
430 } |
431 |
431 |