Table of Contents

Class IndexedFileLine

Namespace
Hi.Common.FileLines
Assembly
HiGeom.dll

Represents a line of text from a file with associated file and line information.

public class IndexedFileLine : IFileLine, IFileLineIndex, IGetFileLineIndex, IGetIndexedFileLine
Inheritance
IndexedFileLine
Implements
Inherited Members
Extension Methods

Constructors

IndexedFileLine()

Initializes a new instance of the IndexedFileLine class.

public IndexedFileLine()

IndexedFileLine(IndexedFileLine)

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

public IndexedFileLine(IndexedFileLine src)

Parameters

src IndexedFileLine

The source IndexedFileLine to copy from.

IndexedFileLine(int, string, int, string)

Initializes a new instance of the IndexedFileLine class with the specified file information and line content.

public IndexedFileLine(int fileIndex, string filePath, int lineIndex, string line)

Parameters

fileIndex int

The zero-based index of the file.

filePath string

The path of the file.

lineIndex int

The zero-based index of the line within the file.

line string

The content of the line.

Properties

FileIndex

File Index. Start on 0.

public int FileIndex { get; set; }

Property Value

int

FileNo

public int FileNo { get; set; }

Property Value

int

FilePath

File path.

public string FilePath { get; set; }

Property Value

string

Line

The line.

public string Line { get; set; }

Property Value

string

LineIndex

Line Index. Start on 0.

public int LineIndex { get; set; }

Property Value

int

LineNo

public int LineNo { get; set; }

Property Value

int

Methods

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.

Remarks

Checks the equalty of FileIndex and LineIndex.

GetFileLine()

public IFileLine GetFileLine()

Returns

IFileLine

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.

Remarks

The hashcode is composed of FileIndex and LineIndex.

GetIndexedFileLine()

Gets the file line associated with this object.

public IndexedFileLine GetIndexedFileLine()

Returns

IndexedFileLine

The file line object.

ReadFile(int, string)

Read file to IndexedFileLines.

public static IEnumerable<IndexedFileLine> ReadFile(int fileIndex, string filePath)

Parameters

fileIndex int

file number. If only one file in the scenerio, assign zero is prefered.

filePath string

file path

Returns

IEnumerable<IndexedFileLine>

IndexedFileLines

ReadFiles(List<string>)

Read files to IndexedFileLines.

public static IEnumerable<IndexedFileLine> ReadFiles(List<string> files)

Parameters

files List<string>

files

Returns

IEnumerable<IndexedFileLine>

IndexedFileLines

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.