|
Enhanced C#
Loyc library documentation
|
A mutable pair of (StartIndex, Length) that implements IIndexRange. More...
A mutable pair of (StartIndex, Length) that implements IIndexRange.
Properties | |
| int | StartIndex [get, set] |
| int | Length [get, set] |
| int | EndIndex [get, set] |
Properties inherited from Loyc.Syntax.IIndexRange | |
| int | StartIndex [get] |
| int | EndIndex [get] |
| int | Length [get] |
Public Member Functions | |
| IndexRange (int startIndex, int length=0) | |
| IndexRange | Normalize () |
| Ensures that StartIndex <= EndIndex by swapping the two if the Length is negative. More... | |
| IndexRange | GetRangeOfOverlap (IndexRange other) |
| Assuming both ranges are normalized, returns the range of overlap between them. If the ranges do not overlap, the Length of the returned range will be zero or negative. More... | |
| bool | Overlaps (IndexRange other) |
| Returns true if, assuming both ranges are normalized, the two regions share at least one common character. More... | |
| bool | Contains (IndexRange other) |
Returns true if, assuming both ranges are normalized, the other range is entirely within the boundaries of this range. More... | |
| bool Loyc.Syntax.IndexRange.Contains | ( | IndexRange | other | ) |
Returns true if, assuming both ranges are normalized, the other range is entirely within the boundaries of this range.
| IndexRange Loyc.Syntax.IndexRange.GetRangeOfOverlap | ( | IndexRange | other | ) |
Assuming both ranges are normalized, returns the range of overlap between them. If the ranges do not overlap, the Length of the returned range will be zero or negative.
|
inline |
Ensures that StartIndex <= EndIndex by swapping the two if the Length is negative.
| OverflowException | An integer overflow occurred. |
this.| bool Loyc.Syntax.IndexRange.Overlaps | ( | IndexRange | other | ) |
Returns true if, assuming both ranges are normalized, the two regions share at least one common character.
Note: this returns false if either of the ranges has a Length of zero and is at the boundary of the other range.
1.8.7