2012-07-27 16:58:27 +00:00
|
|
|
#ifndef _FOLDER_H_
|
|
|
|
#define _FOLDER_H_
|
|
|
|
|
|
|
|
#include "FileData.h"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class SystemData;
|
|
|
|
|
2012-09-07 21:44:07 +00:00
|
|
|
//This class lets us hold a vector of FileDatas within under a common name.
|
2012-07-27 16:58:27 +00:00
|
|
|
class FolderData : public FileData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FolderData(SystemData* system, std::string path, std::string name);
|
|
|
|
~FolderData();
|
|
|
|
|
2013-06-28 12:54:14 +00:00
|
|
|
bool isFolder() const;
|
|
|
|
const std::string & getName() const;
|
|
|
|
const std::string & getPath() const;
|
2012-07-27 16:58:27 +00:00
|
|
|
|
|
|
|
unsigned int getFileCount();
|
2013-06-28 12:54:14 +00:00
|
|
|
FileData* getFile(unsigned int i) const;
|
|
|
|
std::vector<FileData*> getFiles(bool onlyFiles = false) const;
|
|
|
|
std::vector<FileData*> getFilesRecursive(bool onlyFiles = false) const;
|
2012-07-27 16:58:27 +00:00
|
|
|
|
|
|
|
void pushFileData(FileData* file);
|
2012-08-02 04:03:15 +00:00
|
|
|
|
|
|
|
void sort();
|
2013-06-28 12:54:14 +00:00
|
|
|
|
|
|
|
static bool compareFileName(const FileData* file1, const FileData* file2);
|
|
|
|
static bool compareRating(const FileData* file1, const FileData* file2);
|
|
|
|
static bool compareTimesPlayed(const FileData* file1, const FileData* file2);
|
2012-07-27 16:58:27 +00:00
|
|
|
private:
|
|
|
|
SystemData* mSystem;
|
|
|
|
std::string mPath;
|
|
|
|
std::string mName;
|
|
|
|
std::vector<FileData*> mFileVector;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|