Table of Contents

Class FileLineCharIndex

Namespace
Hi.Common.FileLines
Assembly
HiGeom.dll

Represents a character-level position within a file by file index, line index, and character index. All indices are 0-based.

public class FileLineCharIndex : IFileLineCharIndex, IFileLineIndex, IGetFileLineIndex, IComparable<FileLineCharIndex>, IEquatable<FileLineCharIndex>
Inheritance
FileLineCharIndex
Implements
Inherited Members
Extension Methods

Constructors

FileLineCharIndex()

Initializes a new instance of the FileLineCharIndex class.

public FileLineCharIndex()

FileLineCharIndex(IFileLineCharIndex)

Initializes a new instance of the FileLineCharIndex class by copying another instance.

public FileLineCharIndex(IFileLineCharIndex src)

Parameters

src IFileLineCharIndex

The source to copy from.

FileLineCharIndex(int, int, int)

Initializes a new instance of the FileLineCharIndex class with specified indices.

public FileLineCharIndex(int fileIndex, int lineIndex, int charIndex)

Parameters

fileIndex int

The zero-based file index.

lineIndex int

The zero-based line index.

charIndex int

The zero-based character index within the line.

Properties

CharIndex

Character index within the line. 0-based.

public int CharIndex { get; set; }

Property Value

int

FileIndex

File Index. Start on 0.

public int FileIndex { get; set; }

Property Value

int

LineIndex

Line Index. Start on 0.

public int LineIndex { get; set; }

Property Value

int

Methods

AtLineBegin(int, int)

Creates a FileLineCharIndex at the beginning of a line (CharIndex = 0).

public static FileLineCharIndex AtLineBegin(int fileIndex, int lineIndex)

Parameters

fileIndex int

The zero-based file index.

lineIndex int

The zero-based line index.

Returns

FileLineCharIndex

CompareTo(FileLineCharIndex)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(FileLineCharIndex other)

Parameters

other FileLineCharIndex

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

Equals(FileLineCharIndex)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(FileLineCharIndex other)

Parameters

other FileLineCharIndex

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetFileLineIndex()

public FileLineIndex GetFileLineIndex()

Returns

FileLineIndex

FileLineIndex

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ToUserString()

Returns a user-friendly string representation.

public string ToUserString()

Returns

string

Operators

operator ==(FileLineCharIndex, FileLineCharIndex)

public static bool operator ==(FileLineCharIndex left, FileLineCharIndex right)

Parameters

left FileLineCharIndex
right FileLineCharIndex

Returns

bool

operator >(FileLineCharIndex, FileLineCharIndex)

public static bool operator >(FileLineCharIndex left, FileLineCharIndex right)

Parameters

left FileLineCharIndex
right FileLineCharIndex

Returns

bool

operator >=(FileLineCharIndex, FileLineCharIndex)

public static bool operator >=(FileLineCharIndex left, FileLineCharIndex right)

Parameters

left FileLineCharIndex
right FileLineCharIndex

Returns

bool

operator !=(FileLineCharIndex, FileLineCharIndex)

public static bool operator !=(FileLineCharIndex left, FileLineCharIndex right)

Parameters

left FileLineCharIndex
right FileLineCharIndex

Returns

bool

operator <(FileLineCharIndex, FileLineCharIndex)

public static bool operator <(FileLineCharIndex left, FileLineCharIndex right)

Parameters

left FileLineCharIndex
right FileLineCharIndex

Returns

bool

operator <=(FileLineCharIndex, FileLineCharIndex)

public static bool operator <=(FileLineCharIndex left, FileLineCharIndex right)

Parameters

left FileLineCharIndex
right FileLineCharIndex

Returns

bool