mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Symbian Installation File] Adjust parsing so options are parsed first to have their name available when used as conditions.
This commit is contained in:
@@ -45,7 +45,7 @@ namespace Aaru.Archives;
|
||||
public sealed partial class Symbian
|
||||
{
|
||||
void Parse(BinaryReader br, ref uint offset, ref uint currentFile, uint maxFiles, List<string> languages,
|
||||
ref int conditionLevel)
|
||||
ref int conditionLevel, bool optionsOnly)
|
||||
{
|
||||
currentFile++;
|
||||
|
||||
@@ -84,6 +84,9 @@ public sealed partial class Symbian
|
||||
if(!_release6)
|
||||
offset -= sizeof(uint) * 3;
|
||||
|
||||
if(optionsOnly)
|
||||
break;
|
||||
|
||||
var decodedFileRecord = new DecodedFileRecord
|
||||
{
|
||||
type = simpleFileRecord.record.type,
|
||||
@@ -276,6 +279,8 @@ public sealed partial class Symbian
|
||||
multipleFileRecord.originalLengths = multipleFileRecord.lengths;
|
||||
|
||||
offset = (uint)br.BaseStream.Position;
|
||||
if(optionsOnly)
|
||||
break;
|
||||
|
||||
br.BaseStream.Seek(multipleFileRecord.record.sourceNamePtr, SeekOrigin.Begin);
|
||||
buffer = br.ReadBytes((int)multipleFileRecord.record.sourceNameLen);
|
||||
@@ -485,7 +490,8 @@ public sealed partial class Symbian
|
||||
|
||||
br.BaseStream.Seek(offset, SeekOrigin.Begin);
|
||||
|
||||
_options.Add(optionsLineRecord.options[i]);
|
||||
if(optionsOnly)
|
||||
_options.Add(optionsLineRecord.options[i]);
|
||||
}
|
||||
|
||||
offset = (uint)br.BaseStream.Position;
|
||||
@@ -504,7 +510,11 @@ public sealed partial class Symbian
|
||||
length = br.ReadUInt32()
|
||||
};
|
||||
|
||||
offset = (uint)(br.BaseStream.Position + conditionalRecord.length);
|
||||
offset = (uint)(br.BaseStream.Position + conditionalRecord.length);
|
||||
|
||||
if(optionsOnly)
|
||||
break;
|
||||
|
||||
conditionSb = new StringBuilder();
|
||||
nullAttribute = null;
|
||||
|
||||
@@ -527,7 +537,11 @@ public sealed partial class Symbian
|
||||
length = br.ReadUInt32()
|
||||
};
|
||||
|
||||
offset = (uint)(br.BaseStream.Position + conditionalRecord.length);
|
||||
offset = (uint)(br.BaseStream.Position + conditionalRecord.length);
|
||||
|
||||
if(optionsOnly)
|
||||
break;
|
||||
|
||||
conditionSb = new StringBuilder();
|
||||
nullAttribute = null;
|
||||
|
||||
@@ -544,15 +558,23 @@ public sealed partial class Symbian
|
||||
tabulationChars[i] = '\t';
|
||||
tabulation = new string(tabulationChars);
|
||||
|
||||
_conditions.Add(tabulation + "else");
|
||||
offset = (uint)(br.BaseStream.Position + Marshal.SizeOf<ConditionalEndRecord>());
|
||||
|
||||
if(optionsOnly)
|
||||
break;
|
||||
|
||||
_conditions.Add(tabulation + "else");
|
||||
|
||||
break;
|
||||
case FileRecordType.EndIf:
|
||||
conditionLevel++;
|
||||
_conditions.Add(tabulation + "endif()" + Environment.NewLine);
|
||||
offset = (uint)(br.BaseStream.Position + Marshal.SizeOf<ConditionalEndRecord>());
|
||||
|
||||
if(optionsOnly)
|
||||
break;
|
||||
|
||||
_conditions.Add(tabulation + "endif()" + Environment.NewLine);
|
||||
|
||||
break;
|
||||
case FileRecordType.Skip:
|
||||
offset = (uint)br.BaseStream.Seek(sizeof(FileRecordType), SeekOrigin.Current);
|
||||
|
||||
Reference in New Issue
Block a user