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 44 of file FileSystem.h.

Constructor & Destructor Documentation

◆ FileDefinitionType()

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

Definition at line 1024 of file FileSystem.cpp.

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

◆ ~FileDefinitionType()

Leviathan::FileDefinitionType::~FileDefinitionType ( )

Definition at line 1042 of file FileSystem.cpp.

1042 {}

Member Function Documentation

◆ GetNameWithExtension()

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

Definition at line 1044 of file FileSystem.cpp.

1045 {
1046  // Add the extension text to the end of the name //
1047  return Name + "." + FileSystem::Get()->GetExtensionName(ExtensionID);
1048 }
static DLLEXPORT FileSystem * Get()
Definition: FileSystem.cpp:79
DLLEXPORT const std::string & GetExtensionName(int id) const
Retrieves the name of the extension from the id.
Definition: FileSystem.cpp:655

◆ operator<()

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

Definition at line 1037 of file FileSystem.cpp.

1038 {
1039  return this->Name < other.Name;
1040 }

Member Data Documentation

◆ ExtensionID

int Leviathan::FileDefinitionType::ExtensionID

Definition at line 57 of file FileSystem.h.

◆ Name

std::string Leviathan::FileDefinitionType::Name

Definition at line 56 of file FileSystem.h.

◆ RelativePath

std::string Leviathan::FileDefinitionType::RelativePath

Definition at line 55 of file FileSystem.h.


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