Table of Contents

Class IniWriter

Namespace
Tlumach.Writers
Assembly
Tlumach.Writers.dll

A writer for the simple INI format.

public class IniWriter : BaseKeyValueWriter
Inheritance
IniWriter
Inherited Members

Properties

ConfigExtension

Gets the extension of the configuration files of the format, with the leading dot (e.g., ".jsoncfg"), or an empty string if the writer does not write configuration files.

public override string ConfigExtension { get; }

Property Value

string

FormatName

Gets the name of the format (e.g., "JSON" or "RESX"), which is also used in error messages.

public override string FormatName { get; }

Property Value

string

TranslationExtension

Gets the extension of the translation files of the format, with the leading dot (e.g., ".json").

public override string TranslationExtension { get; }

Property Value

string

Methods

ShouldWriteReference(TranslationEntry)

Determines whether the entry should be written as a reference to another entry (@ followed by the reference) rather than as text.

protected override bool ShouldWriteReference(TranslationEntry entry)

Parameters

entry TranslationEntry

The entry to be written.

Returns

bool

true if the entry has no text but has a reference; otherwise, false.

WriteKeyValueLine(string, string, StringBuilder)

Appends a line with a key and its value to the file being written, quoting and escaping them as the format requires.

protected override void WriteKeyValueLine(string key, string value, StringBuilder stringBuilder)

Parameters

key string

The key (within the current section).

value string

The value.

stringBuilder StringBuilder

The builder of the file.

WriteSection(string, StringBuilder)

Appends the header of a section to the file being written.

protected override void WriteSection(string key, StringBuilder stringBuilder)

Parameters

key string

The name of the section.

stringBuilder StringBuilder

The builder of the file.