Class IndexedFileLine
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
IndexedFileLineThe 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
intThe zero-based index of the file.
filePath
stringThe path of the file.
lineIndex
intThe zero-based index of the line within the file.
line
stringThe content of the line.
Properties
FileIndex
File Index. Start on 0.
public int FileIndex { get; set; }
Property Value
FileNo
FileIndex+1.
public int FileNo { get; set; }
Property Value
FilePath
File path.
public string FilePath { get; set; }
Property Value
Line
The line.
public string Line { get; set; }
Property Value
LineIndex
Line Index. Start on 0.
public int LineIndex { get; set; }
Property Value
LineNo
LineIndex+1.
public int LineNo { get; set; }
Property Value
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
Remarks
GetFileLine()
public IFileLine GetFileLine()
Returns
GetFileLineIndex()
Get FileLineIndex.
public FileLineIndex GetFileLineIndex()
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Remarks
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
intfile number. If only one file in the scenerio, assign zero is prefered.
filePath
stringfile path
Returns
ReadFiles(List<string>)
Read files to IndexedFileLines.
public static IEnumerable<IndexedFileLine> ReadFiles(List<string> files)
Parameters
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.