Cleanup: Remove old FiosList helper methods. (#9139)
(cherry-picked from commit f018471b36)
This commit is contained in:
committed by
Jonathan G Rennison
parent
050b95e351
commit
9d72eb02f5
86
src/fios.h
86
src/fios.h
@@ -116,94 +116,10 @@ struct FiosItem {
|
||||
};
|
||||
|
||||
/** List of file information. */
|
||||
class FileList {
|
||||
class FileList : public std::vector<FiosItem> {
|
||||
public:
|
||||
~FileList();
|
||||
|
||||
/**
|
||||
* Construct a new entry in the file list.
|
||||
* @return Pointer to the new items to be initialized.
|
||||
*/
|
||||
inline FiosItem *Append()
|
||||
{
|
||||
return &this->files.emplace_back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of files in the list.
|
||||
* @return The number of files stored in the list.
|
||||
*/
|
||||
inline size_t Length() const
|
||||
{
|
||||
return this->files.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pointer to the first file information.
|
||||
* @return Address of the first file information.
|
||||
*/
|
||||
inline const FiosItem *Begin() const
|
||||
{
|
||||
return this->files.data();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pointer behind the last file information.
|
||||
* @return Address behind the last file information.
|
||||
*/
|
||||
inline const FiosItem *End() const
|
||||
{
|
||||
return this->Begin() + this->Length();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pointer to the indicated file information. File information must exist.
|
||||
* @return Address of the indicated existing file information.
|
||||
*/
|
||||
inline const FiosItem *Get(size_t index) const
|
||||
{
|
||||
return this->files.data() + index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pointer to the indicated file information. File information must exist.
|
||||
* @return Address of the indicated existing file information.
|
||||
*/
|
||||
inline FiosItem *Get(size_t index)
|
||||
{
|
||||
return this->files.data() + index;
|
||||
}
|
||||
|
||||
inline const FiosItem &operator[](size_t index) const
|
||||
{
|
||||
return this->files[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a reference to the indicated file information. File information must exist.
|
||||
* @return The requested file information.
|
||||
*/
|
||||
inline FiosItem &operator[](size_t index)
|
||||
{
|
||||
return this->files[index];
|
||||
}
|
||||
|
||||
/** Remove all items from the list. */
|
||||
inline void Clear()
|
||||
{
|
||||
this->files.clear();
|
||||
}
|
||||
|
||||
/** Compact the list down to the smallest block size boundary. */
|
||||
inline void Compact()
|
||||
{
|
||||
this->files.shrink_to_fit();
|
||||
}
|
||||
|
||||
void BuildFileList(AbstractFileType abstract_filetype, SaveLoadOperation fop);
|
||||
const FiosItem *FindItem(const char *file);
|
||||
|
||||
std::vector<FiosItem> files; ///< The list of files.
|
||||
};
|
||||
|
||||
enum SortingBits {
|
||||
|
||||
Reference in New Issue
Block a user