IniPropertySyntax Class

A key/value pair such as name=value or name: value.

public sealed class IniPropertySyntax : IniEntrySyntax
Inheritance
IniEntrySyntax IniPropertySyntax

Properties

NameDescription
ContinuationTokensGets the tokens of the lines the value continues on, one per line.
KeyGets the key, without the whitespace around it.
KeyToken
SeparatorTokenGets = or :, or a missing token when the line holds only a key.
ValueGets the value.
ValueTokenGets the token of the first line of the value, whose text is that line as written, or a missing token when the line holds only a key.

ContinuationTokens

IniPropertySyntax.cs

Gets the tokens of the lines the value continues on, one per line.

public SyntaxTokenList ContinuationTokens { get; }

Property value

SyntaxTokenList

Remarks

A document read with IniParseOptions.AllowMultilineValues continues a value on the lines below it that are indented more than its key. The blank lines and comment lines between them are the leading trivia of the token that follows them. Otherwise, this is empty.

Gets the key, without the whitespace around it.

public string Key { get; }

Property value

string

public SyntaxToken KeyToken { get; }

Property value

SyntaxToken

No documentation is available.

SeparatorToken

IniPropertySyntax.cs

Gets = or :, or a missing token when the line holds only a key.

public SyntaxToken SeparatorToken { get; }

Property value

SyntaxToken

Gets the value.

public string Value { get; }

Property value

string

Remarks

The value is the text after the separator, without the whitespace around it or the comment after it. When the whole of it is in quotes, such as "a;b", and IniParseOptions.AllowQuotedValues is set, the quotes are left out; nothing is escaped inside them. A value that continues on the lines below it is those lines joined with \n, each read the same way and without its indentation; a blank line between them is an empty line, and a comment line is left out. A line holding only a key has the empty string.

Gets the token of the first line of the value, whose text is that line as written, or a missing token when the line holds only a key.

public SyntaxToken ValueToken { get; }

Property value

SyntaxToken

Methods

NameDescription
Accept(IniSyntaxVisitor)
Accept<TResult>(IniSyntaxVisitor<TResult>)
Update(SyntaxToken, SyntaxToken, SyntaxToken)Returns this property with the given parts and the lines its value continues on, or itself when nothing changed.
Update(SyntaxToken, SyntaxToken, SyntaxToken, SyntaxTokenList)Returns this property with the given parts, or itself when nothing changed.
WithContinuationTokens(SyntaxTokenList)
WithKey(string)Returns this property with a new key.
WithKeyToken(SyntaxToken)
WithSeparatorToken(SyntaxToken)
WithValue(string)Returns this property with a new value, keeping the trivia around the old one.
WithValueToken(SyntaxToken)

Accept overloads

Accept(IniSyntaxVisitor)

IniPropertySyntax.cs
public override void Accept(IniSyntaxVisitor visitor)
Parameters
visitor IniSyntaxVisitor

No documentation is available.

Accept<TResult>(IniSyntaxVisitor<TResult>)

IniPropertySyntax.cs
public override TResult? Accept<TResult>(IniSyntaxVisitor<TResult> visitor)
Type parameters
TResult
Parameters
visitor IniSyntaxVisitor<TResult>
Returns

TResult?

No documentation is available.

Update overloads

Update(SyntaxToken, SyntaxToken, SyntaxToken)

IniPropertySyntax.cs

Returns this property with the given parts and the lines its value continues on, or itself when nothing changed.

public IniPropertySyntax Update(SyntaxToken keyToken, SyntaxToken separatorToken, SyntaxToken valueToken)
Parameters
keyToken SyntaxToken
separatorToken SyntaxToken
valueToken SyntaxToken
Returns

IniPropertySyntax

Update(SyntaxToken, SyntaxToken, SyntaxToken, SyntaxTokenList)

IniPropertySyntax.cs

Returns this property with the given parts, or itself when nothing changed.

public IniPropertySyntax Update(SyntaxToken keyToken, SyntaxToken separatorToken, SyntaxToken valueToken, SyntaxTokenList continuationTokens)
Parameters
keyToken SyntaxToken
separatorToken SyntaxToken
valueToken SyntaxToken
continuationTokens SyntaxTokenList
Returns

IniPropertySyntax

WithContinuationTokens(SyntaxTokenList)

IniPropertySyntax.cs
public IniPropertySyntax WithContinuationTokens(SyntaxTokenList continuationTokens)

Parameters

continuationTokens SyntaxTokenList

Returns

IniPropertySyntax

No documentation is available.

WithKey(string)

IniPropertySyntax.cs

Returns this property with a new key.

public IniPropertySyntax WithKey(string key)

Parameters

key string

Returns

IniPropertySyntax

Exceptions

ArgumentNullException
key is null.
ArgumentException
key cannot be written as a key.

Remarks

In a document, the key is checked the way the document reads it (see IniDocumentSyntax.Options), as SyntaxFactory.Key checks it. Otherwise it is checked as SyntaxFactory.Key checks it.

WithKeyToken(SyntaxToken)

IniPropertySyntax.cs
public IniPropertySyntax WithKeyToken(SyntaxToken keyToken)

Parameters

keyToken SyntaxToken

Returns

IniPropertySyntax

No documentation is available.

WithSeparatorToken(SyntaxToken)

IniPropertySyntax.cs
public IniPropertySyntax WithSeparatorToken(SyntaxToken separatorToken)

Parameters

separatorToken SyntaxToken

Returns

IniPropertySyntax

No documentation is available.

WithValue(string)

IniPropertySyntax.cs

Returns this property with a new value, keeping the trivia around the old one.

public IniPropertySyntax WithValue(string value)

Parameters

value string

Returns

IniPropertySyntax

Exceptions

ArgumentNullException
value is null.
ArgumentException
value cannot be written as a value; see SyntaxFactory.Value. Or it cannot be written in front of the comment that follows the old value on its line, which would read as part of it.

Remarks

In a document, the value is written the way the document reads it (see IniDocumentSyntax.Options), and quoted only when those options require it. A property that is not part of a document has no options to go by, so its value is quoted as SyntaxFactory.Value quotes it.

A value with line breaks continues on the lines below the key, which only a document read with IniParseOptions.AllowMultilineValues allows. They are indented as the lines the old value continued on were, or four spaces more than the key, and the comment lines between the old lines stay in front of the new line in the same place. IniPropertySyntax.Value joins the lines with \n, whichever of \r\n, \r, or \n separated them. A line that held only a key gets = between the key and the value.

WithValueToken(SyntaxToken)

IniPropertySyntax.cs
public IniPropertySyntax WithValueToken(SyntaxToken valueToken)

Parameters

valueToken SyntaxToken

Returns

IniPropertySyntax

No documentation is available.