Preliminary design for (Before/After)SaveProcedure and conditional statement blocks
This commit is contained in:
parent
cb7a2ae583
commit
1f765e9013
@ -32,21 +32,9 @@
|
||||
</Format>
|
||||
</Structure>
|
||||
</Structures>
|
||||
<Format>
|
||||
<!-- signature field -->
|
||||
<Field DataType="FixedString" ID="Signature" Length="2" Value="FA" />
|
||||
<!--
|
||||
Conditional properties within a Field behave like so:
|
||||
|
||||
During a LOAD operation, if the FieldCondition is satisfied (i.e., current field value matches 'TrueResult'), the 'Variable' is set to the given 'Value'.
|
||||
During a SAVE operation, if the FieldCondition is satisfied (i.e, 'Variable' matches 'TrueResult'), the 'TrueResult' is written as the value of the field; otherwise, the 'FalseResult' is written.
|
||||
-->
|
||||
<Field DataType="FixedString" ID="EncryptionFlag" Length="1"
|
||||
Conditional-Variable="$(CustomOption:Encrypted)" Conditional-Value="true" Conditional-TrueResult="R" Conditional-FalseResult="r" />
|
||||
<Field DataType="FixedString" ID="CompressionFlag" Length="1"
|
||||
Conditional-Variable="$(CustomOption:Encrypted)" Conditional-Value="true" Conditional-TrueResult="C" Conditional-FalseResult="c" />
|
||||
|
||||
<Field DataType="Int32" ID="DirectorySize">
|
||||
<BeforeSaveProcedure>
|
||||
<Variable ID="m_TotalObjects" Value="$(ObjectModel:GetAllFiles())" />
|
||||
<Variable ID="m_DirectorySize">
|
||||
<Value>
|
||||
<!--
|
||||
for each file:
|
||||
@ -54,11 +42,44 @@
|
||||
|
||||
TODO: Figure out how to represent this!
|
||||
-->
|
||||
<Loop Variable="I" From="0" To="$(Count:$(m_TotalObjects))">
|
||||
<Add Value="$(TotalObjects[$(I)].Name.Length)" />
|
||||
<Add Value="1" />
|
||||
<Add Value="4" />
|
||||
<Add Value="4" />
|
||||
<Add Value="4" />
|
||||
</Loop>
|
||||
</Value>
|
||||
</Field>
|
||||
</Variable>
|
||||
</BeforeSaveProcedure>
|
||||
<Format>
|
||||
<!-- signature field -->
|
||||
<Field DataType="FixedString" ID="Signature" Length="2" Value="FA" />
|
||||
<!--
|
||||
Conditional properties within a Field behave like so:
|
||||
|
||||
During a LOAD operation, if the FieldCondition is satisfied (i.e., current field value matches 'TrueResult'), the 'Variable' is set to the given 'Value'.
|
||||
During a SAVE operation, if the FieldCondition is satisfied (i.e, 'Variable' matches 'Value'), the 'TrueResult' is written as the value of the field; otherwise, the 'FalseResult' is written.
|
||||
-->
|
||||
<Field DataType="FixedString" ID="EncryptionFlag" Length="1"
|
||||
Conditional-Variable="$(CustomOption:Encrypted)" Conditional-Value="true" Conditional-TrueResult="R" Conditional-FalseResult="r" />
|
||||
<Field DataType="FixedString" ID="CompressionFlag" Length="1"
|
||||
Conditional-Variable="$(CustomOption:Compressed)" Conditional-Value="true" Conditional-TrueResult="C" Conditional-FalseResult="c" />
|
||||
|
||||
<Field DataType="Int32" ID="DirectorySize" Value="$(m_DirectorySize)" />
|
||||
<Field DataType="Int32" ID="Reserved1" />
|
||||
|
||||
<Array DataType="Structure" ID="Files" StructureID="{A5945008-DB97-4314-BE99-6A3A383064FF}" MaximumSize="$(Field:DirectorySize)" />
|
||||
<ConditionalStatement>
|
||||
<Conditions>
|
||||
<Condition Variable="$(CustomOption:Compressed)" Comparison="Equal" Value="true" />
|
||||
</Conditions>
|
||||
<TrueResult>
|
||||
<Array DataType="Structure" ID="Files" StructureID="{8964EB0B-3666-4866-B72F-5B11BB1597DD}" MaximumSize="$(Field:DirectorySize)" />
|
||||
</TrueResult>
|
||||
<FalseResult>
|
||||
<Array DataType="Structure" ID="Files" StructureID="{A5945008-DB97-4314-BE99-6A3A383064FF}" MaximumSize="$(Field:DirectorySize)" />
|
||||
</FalseResult>
|
||||
</ConditionalStatement>
|
||||
</Format>
|
||||
</DataFormat>
|
||||
</DataFormats>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user