Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Struct

YamlPosition

OfficeIMO.Yaml

Namespace
OfficeIMO.Yaml
Assembly
OfficeIMO.Yaml
Source revision
0eef6a5756b9 with working tree changes
Base
ValueType
Implements
IEquatable<YamlPosition>
Modifiers
sealed

A location in the decoded YAML text. Offsets count UTF-16 code units from the start of the text; a byte-order mark consumed while decoding a stream is not part of the text. Lines and columns are one-based, and columns count UTF-16 code units from the start of the line.

Inheritance

  • ValueType
  • YamlPosition

Usage

Explore 19 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 5

Constructors

public YamlPosition(long offset, int line, int column) #

Creates a position from its zero-based offset and one-based line and column.

Parameters

offset long required
line int required
column int required

Methods

Equals 2 overloads
public bool Equals(YamlPosition other) #

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

Parameters

other OfficeIMO.Yaml.YamlPosition required
An object to compare with this object.

Returns

bool true if the current object is equal to the other parameter; otherwise, false.
public override bool Equals(object? obj) #

Indicates whether this instance and a specified object are equal.

Parameters

obj object? required
The object to compare with the current instance.

Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.
public override int GetHashCode() #

Returns the hash code for this instance.

Returns

int A 32-bit signed integer that is the hash code for this instance.
public static bool op_Equality(YamlPosition left, YamlPosition right) #

Compares two positions for equality.

Parameters

left OfficeIMO.Yaml.YamlPosition required
right OfficeIMO.Yaml.YamlPosition required

Returns

bool
public static bool op_Inequality(YamlPosition left, YamlPosition right) #

Compares two positions for inequality.

Parameters

left OfficeIMO.Yaml.YamlPosition required
right OfficeIMO.Yaml.YamlPosition required

Returns

bool
public override string ToString() #

Formats the position as line:column for diagnostics.

Returns

string

Properties

public long Offset { get; } #

Gets the zero-based offset in UTF-16 code units. Spans between positions of consecutive events reproduce the source exactly.

public int Line { get; } #

Gets the one-based line. Each \r\n, \n or \r starts a new line.

public int Column { get; } #

Gets the one-based column in UTF-16 code units.