T_Cyjb_Text_LineLocator - CYJB/Cyjb GitHub Wiki

LineLocator 类

提供可以用于定位行位置的功能,支持 \n(Unix) 和 \r\n(Windows) 作为换行符。

继承层次

System.Object
  Cyjb.Text.LineLocator
Namespace: Cyjb.Text
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6

语法

C#

public sealed class LineLocator

The LineLocator type exposes the following members.

构造函数

 

名称 说明
公共方法 LineLocator() 使用默认的 Tab 宽度(4)初始化 LineLocator 类的新实例。
公共方法 LineLocator(Int32) 使用指定的 Tab 宽度初始化 LineLocator 类的新实例。
  Back to Top

属性

 

名称 说明
公共属性 TabSize 获取 Tab 的宽度。
  Back to Top

方法

 

名称 说明
公共方法 Equals Determines whether the specified object is equal to the current object. (继承自 Object。)
公共方法 GetHashCode Serves as the default hash function. (继承自 Object。)
公共方法 GetPosition 返回指定字符索引的行位置。
公共方法 GetType Gets the Type of the current instance. (继承自 Object。)
公共方法 Read 读取指定的字符范围。
公共方法 ToString Returns a string that represents the current object. (继承自 Object。)
  Back to Top

字段

 

名称 说明
公共字段静态成员 TabSizeMark 表示 Tab 的宽度标记。
  Back to Top

扩展方法

 

名称 说明
公共扩展器方法 GetSpan 返回指定文本范围的行位置范围。 (由 LineLocatorUtil 定义。)
  Back to Top

Remarks

对行位置定位方法的详细解释,请参见我的 C# 词法分析器系列博文 《C# 词法分析器(二)输入缓冲和代码定位》

参见

Reference

Cyjb.Text 命名空间

Other Resources

《C# 词法分析器(二)输入缓冲和代码定位》
⚠️ **GitHub.com Fallback** ⚠️