Show / Hide Table of Contents

Class FamosFileHeader

Represents an imc FAMOS file in a hierachical structure containing texts, single values, channels and more.

Inheritance
System.Object
FamosFileBase
FamosFileBaseExtended
FamosFileHeader
FamosFile
Namespace: ImcFamosFile
Assembly: ImcFamosFile.dll
Syntax
public class FamosFileHeader : FamosFileBaseExtended

Constructors

| Improve this Doc View Source

FamosFileHeader()

Initializes a new instance of the FamosFileHeader class.

Declaration
public FamosFileHeader()

Properties

| Improve this Doc View Source

Channels

Gets a list of channels.

Declaration
public List<FamosFileChannel> Channels { get; }
Property Value
Type Description
System.Collections.Generic.List<FamosFileChannel>
| Improve this Doc View Source

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>
| Improve this Doc View Source

Fields

Gets a list of fields.

Declaration
public List<FamosFileField> Fields { get; }
Property Value
Type Description
System.Collections.Generic.List<FamosFileField>
| Improve this Doc View Source

Groups

Gets a list of groups.

Declaration
public List<FamosFileGroup> Groups { get; }
Property Value
Type Description
System.Collections.Generic.List<FamosFileGroup>
| Improve this Doc View Source

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
| Improve this Doc View Source

OriginInfo

Gets or sets the data origin info.

Declaration
public FamosFileOriginInfo OriginInfo { get; set; }
Property Value
Type Description
FamosFileOriginInfo
| Improve this Doc View Source

RawBlocks

Gets a list of raw data blocks.

Declaration
public List<FamosFileRawBlock> RawBlocks { get; }
Property Value
Type Description
System.Collections.Generic.List<FamosFileRawBlock>
| Improve this Doc View Source

SingleValues

Gets a list of single values.

Declaration
public List<FamosFileSingleValue> SingleValues { get; }
Property Value
Type Description
System.Collections.Generic.List<FamosFileSingleValue>
| Improve this Doc View Source

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 Source

AlignBuffers(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

Validate()

Validates the key status.

Declaration
public override void Validate()
Overrides
FamosFileBase.Validate()
| Improve this Doc View Source

WriteSingle<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 T.

Type Parameters
Name Description
T

The data type parameter.

| Improve this Doc View Source

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 T.

Type Parameters
Name Description
T

The data type parameter.

| Improve this Doc View Source

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 T.

Type Parameters
Name Description
T

The data type parameter.

| Improve this Doc View Source

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 T.

Type Parameters
Name Description
T

The data type parameter.

  • Improve this Doc
  • View Source
Back to top Copyright © 2019 Vincent Wilms