Leviathan  0.8.0.0
Leviathan game engine
Leviathan::FileDefinitionType Struct Reference

#include <FileSystem.h>

Public Member Functions

 FileDefinitionType (FileSystem *instance, const std::string &path)
 
 ~FileDefinitionType ()
 
std::string GetNameWithExtension () const
 
bool operator< (const FileDefinitionType &other) const
 

Public Attributes

std::string RelativePath
 
std::string Name
 
int ExtensionID
 

Detailed Description

Definition at line 43 of file FileSystem.h.

Constructor & Destructor Documentation

◆ FileDefinitionType()

Leviathan::FileDefinitionType::FileDefinitionType ( FileSystem instance,
const std::string &  path 
)

Definition at line 1029 of file FileSystem.cpp.

1029  :
1030  RelativePath(path)
1031 {
1032  // get extension //
1033  string tempexpt = StringOperations::GetExtension<std::string>(path);
1034 
1035  // register extension and store id //
1036  ExtensionID = instance->RegisterExtension(tempexpt);
1037 
1038  // save name //
1039  Name = StringOperations::RemoveExtension<std::string>(path, true);
1040 }
DLLEXPORT int RegisterExtension(const std::string &extension)
Reserves a number for an extension string.
Definition: FileSystem.cpp:623

◆ ~FileDefinitionType()

Leviathan::FileDefinitionType::~FileDefinitionType ( )

Definition at line 1047 of file FileSystem.cpp.

1047 {}

Member Function Documentation

◆ GetNameWithExtension()

std::string Leviathan::FileDefinitionType::GetNameWithExtension ( ) const
Returns
The name in this format: "file.extension"

Definition at line 1049 of file FileSystem.cpp.

1050 {
1051  // Add the extension text to the end of the name //
1052  return Name + "." + FileSystem::Get()->GetExtensionName(ExtensionID);
1053 }
static DLLEXPORT FileSystem * Get()
Definition: FileSystem.cpp:78
DLLEXPORT const std::string & GetExtensionName(int id) const
Retrieves the name of the extension from the id.
Definition: FileSystem.cpp:654

◆ operator<()

bool Leviathan::FileDefinitionType::operator< ( const FileDefinitionType other) const

Definition at line 1042 of file FileSystem.cpp.

1043 {
1044  return this->Name < other.Name;
1045 }

Member Data Documentation

◆ ExtensionID

int Leviathan::FileDefinitionType::ExtensionID

Definition at line 56 of file FileSystem.h.

◆ Name

std::string Leviathan::FileDefinitionType::Name

Definition at line 55 of file FileSystem.h.

◆ RelativePath

std::string Leviathan::FileDefinitionType::RelativePath

Definition at line 54 of file FileSystem.h.


The documentation for this struct was generated from the following files: