Class StringDocument

Namespace
Pixie.Code
Assembly
Pixie.dll

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

identifier string

The document's identifier.

contents string

The document's contents.

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

offset int

The offset of the first character to read.

length int

The number of characters to read.

Returns

string

A span of text.

Open(int)

Opens this source document at the given offset.

public override TextReader Open(int offset)

Parameters

offset int

The offset to open the source document at.

Returns

TextReader

A text reader.