Codechange: Turn bit-stuffed FiosType enum into a struct. (#14019)

This commit is contained in:
frosch
2025-04-18 15:20:55 +02:00
committed by GitHub
parent b862d4937f
commit 26db4ccf09
13 changed files with 59 additions and 105 deletions
+5 -17
View File
@@ -3370,33 +3370,21 @@ std::string GenerateDefaultSaveName()
return filename;
}
/**
* Set the mode and file type of the file to save or load based on the type of file entry at the file system.
* @param ft Type of file entry of the file system.
*/
void FileToSaveLoad::SetMode(FiosType ft)
{
this->SetMode(SLO_LOAD, GetAbstractFileType(ft), GetDetailedFileType(ft));
}
/**
* Set the mode and file type of the file to save or load.
* @param ft File type.
* @param fop File operation being performed.
* @param aft Abstract file type.
* @param dft Detailed file type.
*/
void FileToSaveLoad::SetMode(SaveLoadOperation fop, AbstractFileType aft, DetailedFileType dft)
void FileToSaveLoad::SetMode(const FiosType &ft, SaveLoadOperation fop)
{
if (aft == FT_INVALID || aft == FT_NONE) {
if (ft.abstract == FT_INVALID || ft.abstract == FT_NONE) {
this->file_op = SLO_INVALID;
this->detail_ftype = DFT_INVALID;
this->abstract_ftype = FT_INVALID;
this->ftype = FIOS_TYPE_INVALID;
return;
}
this->file_op = fop;
this->detail_ftype = dft;
this->abstract_ftype = aft;
this->ftype = ft;
}
/**