Nuke.Unreal
Build Unreal apps in Style.
Loading...
Searching...
No Matches
Nuke.Unreal.Ini.ConfigSection Class Reference

Represents a section block in an Unreal INI configuration under a [SectionName] header. More...

Public Member Functions

void SetLine (string line, int order)
 Parse an entire config item (or a line) as a command and add it to this section.
 
void Remove (IEnumerable< string > keys)
 Remove all given keys from this section.
 
void Remove (params string[] keys)
 Remove all given keys from this section.
 
ConfigCommand GetFirst (string key, ConfigCommand fallback=default)
 Gets a config item in this section with specified key.
 
void Set (string key, string value, CommandType type=CommandType.Set)
 Set or add an individual config item.
 
void Merge (ConfigSection from)
 Merge another section into this one, overriding existing values and adding new ones.
 
string Serialize ()
 Convert this section to INI format.
 
ConfigSection Copy ()
 Deep copy this section.
 

Properties

int Order [get, set]
 Maintain the original position for this section as they were in the source file so serialization doesn't introduce that much unnecessary changes.
 
string? Name [get, set]
 Section name without square brackets.
 
List< ConfigCommandCommands = new() [get, private set]
 Individual config items underneath this section. Here it's referred to as commands because Unreal INI config items can procedurally add or remove items from containers.
 
IEnumerable< ConfigCommandthis[string key] [get]
 Get all commands matching given name.
 

Detailed Description

Represents a section block in an Unreal INI configuration under a [SectionName] header.

Definition at line 10 of file ConfigSection.cs.

Member Function Documentation

◆ Copy()

ConfigSection Nuke.Unreal.Ini.ConfigSection.Copy ( )

Deep copy this section.

◆ GetFirst()

ConfigCommand Nuke.Unreal.Ini.ConfigSection.GetFirst ( string key,
ConfigCommand fallback = default )

Gets a config item in this section with specified key.

Parameters
key
fallback
Returns
Config item or a given fallback if it doesn't exist.

◆ Merge()

void Nuke.Unreal.Ini.ConfigSection.Merge ( ConfigSection from)

Merge another section into this one, overriding existing values and adding new ones.

Definition at line 102 of file ConfigSection.cs.

◆ Remove() [1/2]

void Nuke.Unreal.Ini.ConfigSection.Remove ( IEnumerable< string > keys)

Remove all given keys from this section.

Definition at line 64 of file ConfigSection.cs.

◆ Remove() [2/2]

void Nuke.Unreal.Ini.ConfigSection.Remove ( params string[] keys)

Remove all given keys from this section.

◆ Serialize()

string Nuke.Unreal.Ini.ConfigSection.Serialize ( )

Convert this section to INI format.

Returns

Definition at line 150 of file ConfigSection.cs.

◆ Set()

void Nuke.Unreal.Ini.ConfigSection.Set ( string key,
string value,
CommandType type = CommandType::Set )

Set or add an individual config item.

Parameters
keyName of the config item
valueAssociated value after = sign.
typeCommand type of config item.

Definition at line 91 of file ConfigSection.cs.

◆ SetLine()

void Nuke.Unreal.Ini.ConfigSection.SetLine ( string line,
int order )

Parse an entire config item (or a line) as a command and add it to this section.

Parameters
line
orderMaintain the original position for this section as they were in the source file so serialization doesn't introduce that much unnecessary changes.

Definition at line 45 of file ConfigSection.cs.

Property Documentation

◆ Commands

List<ConfigCommand> Nuke.Unreal.Ini.ConfigSection.Commands = new()
getprivate set

Individual config items underneath this section. Here it's referred to as commands because Unreal INI config items can procedurally add or remove items from containers.

Definition at line 27 of file ConfigSection.cs.

◆ Name

string? Nuke.Unreal.Ini.ConfigSection.Name
getset

Section name without square brackets.

Definition at line 21 of file ConfigSection.cs.

◆ Order

int Nuke.Unreal.Ini.ConfigSection.Order
getset

Maintain the original position for this section as they were in the source file so serialization doesn't introduce that much unnecessary changes.

Definition at line 16 of file ConfigSection.cs.

◆ this[string key]

IEnumerable<ConfigCommand> Nuke.Unreal.Ini.ConfigSection.this[string key]
get

Get all commands matching given name.

Returns
Matched commands or an empty enumerable if there wasn't any matching the given name.

Definition at line 35 of file ConfigSection.cs.


The documentation for this class was generated from the following file: