SmlWriter

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

Constructors

SmlWriter

#
public SmlWriter(string indent = " ")
indent (string = " ")

Properties

Depth

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

IndentCode

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

IndentText

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

Methods

BeginAttribute

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

BeginAttribute

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

BeginElement

#
public SmlWriter.SmlElement BeginElement(Name name)
name (Name)

BeginElement

#
public SmlWriter.SmlElement BeginElement(string name)
name (string)

Escape

#
public static string Escape(string text)
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.

text (string)

ToString

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