IniPropertySyntax Class
A key/value pair such as name=value or name: value.
public sealed class IniPropertySyntax : IniEntrySyntax- Inheritance
IniEntrySyntaxIniPropertySyntax
Properties
| Name | Description |
|---|---|
| ContinuationTokens | Gets the tokens of the lines the value continues on, one per line. |
| Key | Gets the key, without the whitespace around it. |
| KeyToken | |
| SeparatorToken | Gets = or :, or a missing token when the line holds only a key. |
| Value | Gets the value. |
| ValueToken | 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. |
ContinuationTokens
IniPropertySyntax.csGets the tokens of the lines the value continues on, one per line.
public SyntaxTokenList ContinuationTokens { get; }Property value
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.
KeyToken
IniPropertySyntax.csSeparatorToken
IniPropertySyntax.csGets = or :, or a missing token when the line holds only a key.
public SyntaxToken SeparatorToken { get; }Property value
Value
IniPropertySyntax.csGets the value.
public string Value { get; }Property value
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.
ValueToken
IniPropertySyntax.csGets 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
Methods
| Name | Description |
|---|---|
| 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.cspublic override void Accept(IniSyntaxVisitor visitor)Parameters
visitorIniSyntaxVisitor
No documentation is available.
Accept<TResult>(IniSyntaxVisitor<TResult>)
IniPropertySyntax.cspublic override TResult? Accept<TResult>(IniSyntaxVisitor<TResult> visitor)No documentation is available.
Update overloads
Update(SyntaxToken, SyntaxToken, SyntaxToken)
IniPropertySyntax.csReturns 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)Update(SyntaxToken, SyntaxToken, SyntaxToken, SyntaxTokenList)
IniPropertySyntax.csReturns this property with the given parts, or itself when nothing changed.
public IniPropertySyntax Update(SyntaxToken keyToken, SyntaxToken separatorToken, SyntaxToken valueToken, SyntaxTokenList continuationTokens)Parameters
keyTokenSyntaxTokenseparatorTokenSyntaxTokenvalueTokenSyntaxTokencontinuationTokensSyntaxTokenList
Returns
WithContinuationTokens(SyntaxTokenList)
IniPropertySyntax.cspublic IniPropertySyntax WithContinuationTokens(SyntaxTokenList continuationTokens)No documentation is available.
WithKey(string)
IniPropertySyntax.csReturns this property with a new key.
public IniPropertySyntax WithKey(string key)Parameters
keystring
Returns
Exceptions
ArgumentNullExceptionkeyisnull.ArgumentExceptionkeycannot 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.cspublic IniPropertySyntax WithKeyToken(SyntaxToken keyToken)No documentation is available.
WithSeparatorToken(SyntaxToken)
IniPropertySyntax.cspublic IniPropertySyntax WithSeparatorToken(SyntaxToken separatorToken)No documentation is available.
WithValue(string)
IniPropertySyntax.csReturns this property with a new value, keeping the trivia around the old one.
public IniPropertySyntax WithValue(string value)Parameters
valuestring
Returns
Exceptions
ArgumentNullExceptionvalueisnull.ArgumentExceptionvaluecannot be written as a value; seeSyntaxFactory.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.cspublic IniPropertySyntax WithValueToken(SyntaxToken valueToken)No documentation is available.