Class StringDocument
A document of source code that is stored as a string.
public sealed class StringDocument : OriginalSourceDocument
- Inheritance
-
StringDocument
- Inherited Members
Constructors
StringDocument(string, string)
Creates a string document from an identifier and a contents string.
public StringDocument(string identifier, string contents)
Parameters
Properties
Contents
Gets the string that defines this source document's contents.
public string Contents { get; }
Property Value
- string
The document's contents string.
Length
Gets the document's length, in characters.
public override int Length { get; }
Property Value
- int
The document's length.
Methods
GetText(int, int)
Gets a span of text in the document.
public override string GetText(int offset, int length)
Parameters
Returns
- string
A span of text.
Open(int)
Opens this source document at the given offset.
public override TextReader Open(int offset)
Parameters
offsetintThe offset to open the source document at.
Returns
- TextReader
A text reader.