69 lines
1.3 KiB
C++
69 lines
1.3 KiB
C++
/**
|
|
* @file DatEntry.cpp
|
|
* @date 20/09/2022
|
|
* @author JackCarterSmith
|
|
* @copyright GPL-v3.0
|
|
* @brief Data file entry descriptor class.
|
|
*
|
|
*/
|
|
|
|
#include "DatEntry.h"
|
|
|
|
|
|
namespace RDI {
|
|
|
|
FileEntry::FileEntry( std::string name, DAT_FILE_FLAGS fFlags, unsigned int size, MEMFILE fPtr ) {
|
|
this->name = name;
|
|
this->size = size;
|
|
this->fFlags.raw = fFlags.raw;
|
|
this->fileMemPtr = fPtr;
|
|
}
|
|
|
|
FileEntry::~FileEntry() {}
|
|
|
|
/*std::string FileEntry::toString() {
|
|
|
|
}*/
|
|
|
|
|
|
DirectoryEntry::DirectoryEntry( std::string name ) {
|
|
this->name = name;
|
|
this->fFlags.raw = 0;
|
|
this->rootDir = true;
|
|
vSubFiles = new std::vector<DatEntry*>;
|
|
}
|
|
|
|
DirectoryEntry::DirectoryEntry( std::string name, DAT_FILE_FLAGS fFlags ) {
|
|
this->name = name;
|
|
this->fFlags.raw = fFlags.raw;
|
|
this->rootDir = false;
|
|
vSubFiles = new std::vector<DatEntry*>;
|
|
}
|
|
|
|
DirectoryEntry::DirectoryEntry( std::string name, DAT_FILE_FLAGS fFlags, DatEntry* hFileEntry ) {
|
|
this->name = name;
|
|
this->fFlags.raw = fFlags.raw;
|
|
vSubFiles = new std::vector<DatEntry*>;
|
|
AddEntry(hFileEntry);
|
|
}
|
|
|
|
DirectoryEntry::~DirectoryEntry() {
|
|
for ( DatEntry* e : *vSubFiles )
|
|
delete e;
|
|
delete vSubFiles;
|
|
}
|
|
|
|
/*std::string DirectoryEntry::toString() {
|
|
|
|
}*/
|
|
|
|
void DirectoryEntry::ClearLinkedFiles() {
|
|
vSubFiles->clear();
|
|
}
|
|
|
|
void DirectoryEntry::AddEntry( DatEntry* hFileEntry ) {
|
|
vSubFiles->push_back(hFileEntry);
|
|
}
|
|
|
|
}
|