added and passed Header and DirectoryEntry tests

This commit is contained in:
Ivan Morozov
2022-07-27 22:36:56 +03:00
parent 7859d6ef03
commit c6fb020fda
13 changed files with 187 additions and 59 deletions

View File

@ -44,8 +44,13 @@ std::wstring DirectoryEntry::GetEntryName() const
{
if (entryName[0] != '\0' && nameLength > 0)
{
std::wstring name(entryName, entryName + nameLength);
return name;
wchar_t name[32];
for (int i = 0; i < 32; i++)
{
name[i] = entryName[2*i] + (entryName[2*i+1] << 8);
}
return std::wstring (name, name + nameLength/2 - 1);
}
else
return L"";
@ -135,7 +140,7 @@ void DirectoryEntry::Read(Stream stream, CFSVersion ver)
// where most significant bits are not initialized to zero
size = rw.Read<int>();
rw.ReadArray<4>(); //discard most significant 4 (possibly) dirty bytes
rw.Read<INT>(); //discard most significant 4 (possibly) dirty bytes
}
else
{