TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class CodeInput in Tinman.Core.Parsing

An input token source of char values.

sealed class CodeInput extends CodeInputBase

Remarks

The CodeInput supports the concepts of text lines. Two consecutive text lines are separated by \r\n, \n or \r tokens.

Public / Attributes

CharCount

Returns the number of input tokens.

public override property CharCount { get }
type int32
value [>=0] The number of input token.
implements CodeInputBase.CharCount

RowCount

Returns the number of rows in the input.

public override property RowCount { get }
type int32
value [>=0] The number of rows.
overrides CodeInputBase.RowCount

Public / Methods

CharAt

Returns the index-th token.

public override method CharAt (int32 index)
type char
params index [0..CharCount-1] Index of input token to return.
returns The input token.
implements CodeInputBase.CharAt

ColumnCount

Returns the number of columns in the given input row.

[Pure]
public override method ColumnCount (int32 row)
type int32
params row [0..RowCount-1] Index of input row.
returns [>=0] The number of columns in input row.
overrides CodeInputBase.ColumnCount

FromChars

Creates a new instance of CodeInput.

public static method FromChars (char[] input, int32 inputOffset, int32 inputLength)
type CodeInput
params input [not-null] The input token array.
  inputOffset [>=0] Offset into input to first input token.
  inputLength [>=0] Length of input token array, starting at inputOffset.
returns [not-null] The token input object.

Remarks:

The given character array is used as is, no copying is performed.

FromString

Creates a new instance of CodeInput.

public static method FromString (string input)
type CodeInput
params input [not-null] The input string that represents the sequence of input tokens.
returns [not-null] The token input object.

OffsetToRowColumn

Translates the given absolute token offset into row and column numbers.

[Pure]
public override method OffsetToRowColumn (int32 offset)
type Vec2I
params offset [0..CharCount] The token offset.
returns The zero-based row and column numbers (stored in Y and X respectively).
overrides CodeInputBase.OffsetToRowColumn

Range

Extracts a sequence of tokens.

[Pure]
public override method Range (RangeI range)
type string
params range The token range to extract.
returns The extracted tokens.
implements CodeInputBase.Range

Row

Returns a single row of the input.

[Pure]
public override method Row (int32 lineIdx)
type string
params lineIdx [0..RowCount-1] The row index.
returns [not-null] The input row.
overrides CodeInputBase.Row

RowColumnToOffset

Translates the given row and column number to an absolute token offset.

[Pure]
public override method RowColumnToOffset (int32 row, int32 column)
type int32
params row [0..RowCount-1] The row number.
  column [>=0] The column number.
returns [0..CharCount] The token offset.
overrides CodeInputBase.RowColumnToOffset

ToString

[Pure]
public override method ToString ()
type string