top | up | prev | next

Resource Struct

Definition at line 21 of ResourceTable.hpp

Constructors

Resource()
Resource(const std::u32string& name_, Type type_, const std::string& filePath_)

Member Functions

void Dump(CodeFormatter& formatter, int index)
void Read(BinaryReader& reader, const std::string& cmajorRootDir)
void Write(BinaryWriter& writer, const std::string& cmajorRootDir)

Enumerations

enum class Type

Member Variables

std::string filePath
std::u32string name
Type type

Constructor Details

Resource Constructor

cmajor::symbols::Resource::Resource()

Definition at line 49 of ResourceTable.cpp :
 49 : name()type()filePath()
 50 {
 51 }


Declaration at line 27 of ResourceTable.hpp


Resource Constructor

cmajor::symbols::Resource::Resource(const std::u32string& name_, Type type_, const std::string& filePath_)

Definition at line 53 of ResourceTable.cpp :
 53 : name(name_)type(type_)filePath(GetFullPath(filePath_))
 54 {
 55 }


Declaration at line 28 of ResourceTable.hpp


Member Function Details

Dump Member Function

void cmajor::symbols::Resource::Dump(CodeFormatter& formatter, int index)

Definition at line 72 of ResourceTable.cpp :
 73 {
 74     formatter.WriteLine("RESOURCE " + std::to_string(index));
 75     formatter.WriteLine("resource name: " + ToUtf8(name));
 76     formatter.WriteLine("resource type: " + ResourceTypeStr(type));
 77     formatter.WriteLine("resource file: " + filePath);
 78 }


Called by: cmajor::symbols::ResourceTable::Dump


Read Member Function

void cmajor::symbols::Resource::Read(BinaryReader& reader, const std::string& cmajorRootDir)

Definition at line 64 of ResourceTable.cpp :
 65 {
 66     name = reader.ReadUtf32String();
 67     type = static_cast<Type>(reader.ReadInt());
 68     filePath = reader.ReadUtf8String();
 69     filePath = MakeFullPathFromCmajorRootDirRelativeFilePath(cmajorRootDirfilePath);
 70 }


Called by: cmajor::symbols::ResourceTable::Read


Write Member Function

void cmajor::symbols::Resource::Write(BinaryWriter& writer, const std::string& cmajorRootDir)

Definition at line 57 of ResourceTable.cpp :
 58 {
 59     writer.Write(name);
 60     writer.Write(static_cast<int32_t>(type));
 61     writer.Write(MakeCmajorRootDirRelativeFilePath(cmajorRootDirfilePath));
 62 }



top | up | prev | next