Class FamosFileHeader
Represents an imc FAMOS file in a hierachical structure containing texts, single values, channels and more.
Namespace: ImcFamosFile
Assembly: ImcFamosFile.dll
Syntax
public class FamosFileHeader : FamosFileBaseExtended
Constructors
| Improve this Doc View SourceFamosFileHeader()
Initializes a new instance of the FamosFileHeader class.
Declaration
public FamosFileHeader()
Properties
| Improve this Doc View SourceChannels
Gets a list of channels.
Declaration
public List<FamosFileChannel> Channels { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<FamosFileChannel> |
CustomKeys
Gets a list of custom keys which must be unique globally.
Declaration
public List<FamosFileCustomKey> CustomKeys { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<FamosFileCustomKey> |
Fields
Gets a list of fields.
Declaration
public List<FamosFileField> Fields { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<FamosFileField> |
Groups
Gets a list of groups.
Declaration
public List<FamosFileGroup> Groups { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<FamosFileGroup> |
LanguageInfo
Gets or sets the language info containing data about the code page and language.
Declaration
public FamosFileLanguageInfo LanguageInfo { get; set; }
Property Value
Type | Description |
---|---|
FamosFileLanguageInfo |
OriginInfo
Gets or sets the data origin info.
Declaration
public FamosFileOriginInfo OriginInfo { get; set; }
Property Value
Type | Description |
---|---|
FamosFileOriginInfo |
RawBlocks
Gets a list of raw data blocks.
Declaration
public List<FamosFileRawBlock> RawBlocks { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<FamosFileRawBlock> |
SingleValues
Gets a list of single values.
Declaration
public List<FamosFileSingleValue> SingleValues { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<FamosFileSingleValue> |
Texts
Gets a list of texts.
Declaration
public List<FamosFileText> Texts { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<FamosFileText> |
Methods
| Improve this Doc View SourceAlignBuffers(FamosFileRawBlock, FamosFileAlignmentMode)
Aligns the buffers of all components of this instance to the provided rawBlock
instance. This is done automatically, if the functionality is not being disabled in the call to 'famosFile.Save(...)'.
Declaration
public void AlignBuffers(FamosFileRawBlock rawBlock, FamosFileAlignmentMode alignmentMode)
Parameters
Type | Name | Description |
---|---|---|
FamosFileRawBlock | rawBlock | The raw block instance, where the actual data is stored. |
FamosFileAlignmentMode | alignmentMode | The buffer alignment mode. |
AlignBuffers(FamosFileRawBlock, FamosFileAlignmentMode, List<FamosFileComponent>)
Aligns the buffers of all components
to the provided rawBlock
instance. This is done automatically, if the functionality is not being disabled in the call to 'famosFile.Save(...)'.
Declaration
public void AlignBuffers(FamosFileRawBlock rawBlock, FamosFileAlignmentMode alignmentMode, List<FamosFileComponent> components)
Parameters
Type | Name | Description |
---|---|---|
FamosFileRawBlock | rawBlock | The raw block instance, where the actual data is stored. |
FamosFileAlignmentMode | alignmentMode | The buffer alignment mode. |
System.Collections.Generic.List<FamosFileComponent> | components | The list of components to align. |
FindComponent(FamosFileChannel)
Finds the parent component of the provided channel.
Declaration
public FamosFileComponent FindComponent(FamosFileChannel channel)
Parameters
Type | Name | Description |
---|---|---|
FamosFileChannel | channel | The channel that belongs to the component to be searched for. |
Returns
Type | Description |
---|---|
FamosFileComponent | Returns the found FamosFileComponent. |
FindField(FamosFileChannel)
Finds the parent field of the provided channel.
Declaration
public FamosFileField FindField(FamosFileChannel channel)
Parameters
Type | Name | Description |
---|---|---|
FamosFileChannel | channel | The channel that belongs to the component to be searched for. |
Returns
Type | Description |
---|---|
FamosFileField | Returns the found FamosFileField. |
FindFieldAndComponent(FamosFileChannel)
Finds the parent field and component of the provided channel.
Declaration
public (FamosFileField Field, FamosFileComponent Component) FindFieldAndComponent(FamosFileChannel channel)
Parameters
Type | Name | Description |
---|---|---|
FamosFileChannel | channel | The channel that belongs to the component and field to be searched for. |
Returns
Type | Description |
---|---|
System.ValueTuple<FamosFileField, FamosFileComponent> | Returns the found FamosFileField and FamosFileComponent. |
Save(Stream, Action<BinaryWriter>, Boolean)
Serializes the current instance to the passed stream
.
Declaration
public void Save(Stream stream, Action<BinaryWriter> writeData, bool autoAlign = true)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream where the data will be written to. |
System.Action<System.IO.BinaryWriter> | writeData | The action that is being called (when the file header has been written) to now write the actual data. |
System.Boolean | autoAlign | A boolean indicating if all component buffers and pack infos should be aligned automatically. |
Save(String, Action<BinaryWriter>, Boolean)
Serializes the current instance to disk.
Declaration
public void Save(string filePath, Action<BinaryWriter> writeData, bool autoAlign = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path of the file on disk. |
System.Action<System.IO.BinaryWriter> | writeData | The action that is being called (when the file header has been written) to now write the actual data. |
System.Boolean | autoAlign | A boolean indicating if all component buffers and pack infos should be aligned automatically. |
Save(String, FileMode, Action<BinaryWriter>, Boolean)
Serializes the current instance to disk.
Declaration
public void Save(string filePath, FileMode fileMode, Action<BinaryWriter> writeData, bool autoAlign = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path of the file on disk. |
System.IO.FileMode | fileMode | Specified the mode with which the file should be opened. |
System.Action<System.IO.BinaryWriter> | writeData | The action that is being called (when the file header has been written) to now write the actual data. |
System.Boolean | autoAlign | A boolean indicating if all component buffers and pack infos should be aligned automatically. |
Validate()
Validates the key status.
Declaration
public override void Validate()
Overrides
| Improve this Doc View SourceWriteSingle<T>(BinaryWriter, FamosFileComponent, T[])
This method should be called in the action block that has been passed to the 'famosFile.Save(...)' or Edit(Action<BinaryWriter>) method to write the actual data of type T
.
Declaration
public void WriteSingle<T>(BinaryWriter writer, FamosFileComponent component, T[] data)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryWriter | writer | The binary writer that has been provided in the action block. |
FamosFileComponent | component | The component that describes the data to write. |
T[] | data | The actual data of type |
Type Parameters
Name | Description |
---|---|
T | The data type parameter. |
WriteSingle<T>(BinaryWriter, FamosFileComponent, Int32, T[])
This method should be called in the action block that has been passed to the 'famosFile.Save(...)' or Edit(Action<BinaryWriter>) method to write the actual data of type T
.
Declaration
public void WriteSingle<T>(BinaryWriter writer, FamosFileComponent component, int start, T[] data)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryWriter | writer | The binary writer that has been provided in the action block. |
FamosFileComponent | component | The component that describes the data to write. |
System.Int32 | start | The number of values to skip. |
T[] | data | The actual data of type |
Type Parameters
Name | Description |
---|---|
T | The data type parameter. |
WriteSingle<T>(BinaryWriter, FamosFileComponent, Int32, Span<T>)
This method should be called in the action block that has been passed to the 'famosFile.Save(...)' or Edit(Action<BinaryWriter>) method to write the actual data of type T
.
Declaration
public void WriteSingle<T>(BinaryWriter writer, FamosFileComponent component, int start, Span<T> data)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryWriter | writer | The binary writer that has been provided in the action block. |
FamosFileComponent | component | The component that describes the data to write. |
System.Int32 | start | The number of values to skip. |
System.Span<T> | data | The actual data of type |
Type Parameters
Name | Description |
---|---|
T | The data type parameter. |
WriteSingle<T>(BinaryWriter, FamosFileComponent, Span<T>)
This method should be called in the action block that has been passed to the 'famosFile.Save(...)' or Edit(Action<BinaryWriter>) method to write the actual data of type T
.
Declaration
public void WriteSingle<T>(BinaryWriter writer, FamosFileComponent component, Span<T> data)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryWriter | writer | The binary writer that has been provided in the action block. |
FamosFileComponent | component | The component that describes the data to write. |
System.Span<T> | data | The actual data of type |
Type Parameters
Name | Description |
---|---|
T | The data type parameter. |