SmlWriter

References
public sealed class SmlWriter
A basic utility class for writing SML compliant text.

Constructors

SmlWriter

#
public SmlWriter(
indent = " "
)

Properties

Depth

#
Gets the current indentation depth.
public int Depth { get; }

IndentCode

#
Gets the indentation string to use.
public string IndentCode { get; }

IndentText

#
Gets the current indent text.
public string IndentText { get; }

Methods

BeginAttribute

#
Begin a new attribute.
public SmlWriter.SmlAttribute BeginAttribute(
name
Name of attribute.
)

BeginAttribute

#
Begin a new attribute.
public SmlWriter.SmlAttribute BeginAttribute(
name
Name of attribute.
)

BeginElement

#
public SmlWriter.SmlElement BeginElement(
name
)

BeginElement

#
public SmlWriter.SmlElement BeginElement(
name
)

Escape

#
Apply Sml escape rules for text.

Hyphens are surrounded by double quotes.

Strings with whitespace are surrounded by double quotes.

Strings containing double quotes are surrounded by double quotes.

Double quotes in strings are doubled up.

Strings containing hash characters are surrounded by double quotes.

Strings containing newline character are split into lines, surrounded by double quotes and separated by slashes.

public static string Escape(
text
)

ToString

#
Convert the text inside this writer to a string.
public override string ToString()
Object.ToString