Write IPak base skeleton without data

This commit is contained in:
Jan
2023-10-07 19:41:54 +02:00
parent 23d0fe1eb0
commit 8514378465
15 changed files with 390 additions and 62 deletions

View File

@ -1,10 +1,13 @@
#include "AssetList.h"
AssetListEntry::AssetListEntry()
= default;
AssetListEntry::AssetListEntry(std::string type, std::string name)
: m_type(std::move(type)),
m_name(std::move(name))
: m_is_reference(false)
{
}
AssetListEntry::AssetListEntry(std::string type, std::string name, const bool isReference)
: m_type(std::move(type)),
m_name(std::move(name)),
m_is_reference(isReference)
{
}

View File

@ -7,9 +7,10 @@ class AssetListEntry
public:
std::string m_type;
std::string m_name;
bool m_is_reference;
AssetListEntry();
AssetListEntry(std::string type, std::string name);
AssetListEntry(std::string type, std::string name, bool isReference);
};
class AssetList

View File

@ -9,7 +9,7 @@ bool AssetListInputStream::NextEntry(AssetListEntry& entry) const
{
std::vector<std::string> row;
while(true)
while (true)
{
if (!m_stream.NextRow(row))
return false;
@ -18,8 +18,17 @@ bool AssetListInputStream::NextEntry(AssetListEntry& entry) const
continue;
entry.m_type = row[0];
if (row.size() >= 2)
if (row.size() >= 3 && row[1].empty())
{
entry.m_name = row[2];
entry.m_is_reference = true;
}
else
{
entry.m_name = row[1];
entry.m_is_reference = false;
}
return true;
}
}