Class IndexedFileLineChar
Represents a character-level position within a file, with associated file path context. Analogous to IndexedFileLine but at character granularity.
public class IndexedFileLineChar : IFileLineCharIndex, IFileLineIndex, IGetFileLineIndex, IEquatable<IndexedFileLineChar>
- Inheritance
-
IndexedFileLineChar
- Implements
- Inherited Members
- Extension Methods
Constructors
IndexedFileLineChar()
Initializes a new instance of the IndexedFileLineChar class.
public IndexedFileLineChar()
IndexedFileLineChar(IndexedFileLine, int)
Creates an IndexedFileLineChar from an IndexedFileLine at the specified character index.
public IndexedFileLineChar(IndexedFileLine src, int charIndex)
Parameters
srcIndexedFileLineThe source indexed file line.
charIndexintThe zero-based character index within the line.
IndexedFileLineChar(IndexedFileLineChar)
Initializes a new instance of the IndexedFileLineChar class by copying another instance.
public IndexedFileLineChar(IndexedFileLineChar src)
Parameters
srcIndexedFileLineCharThe source to copy from.
IndexedFileLineChar(int, string, int, int)
Initializes a new instance of the IndexedFileLineChar class with specified values.
public IndexedFileLineChar(int fileIndex, string filePath, int lineIndex, int charIndex)
Parameters
fileIndexintThe zero-based file index.
filePathstringThe file path.
lineIndexintThe zero-based line index.
charIndexintThe zero-based character index within the line.
Properties
CharIndex
Character index within the line. 0-based.
public int CharIndex { get; set; }
Property Value
FileIndex
File Index. Start on 0.
public int FileIndex { get; set; }
Property Value
FilePath
File path.
public string FilePath { get; set; }
Property Value
LineIndex
Line Index. Start on 0.
public int LineIndex { get; set; }
Property Value
Methods
Equals(IndexedFileLineChar)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(IndexedFileLineChar other)
Parameters
otherIndexedFileLineCharAn object to compare with this object.
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current object.
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.
ToFileLineCharIndex()
Converts to a FileLineCharIndex (without file path context).
public FileLineCharIndex ToFileLineCharIndex()
Returns
ToHumanString()
Returns a human-readable string representation.
public string ToHumanString()
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.