mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 07:18:11 -05:00
Write IPak base skeleton without data
This commit is contained in:
@ -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)
|
||||
{
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user