Navigation
API > API/Runtime > API/Runtime/uLangCore > API/Runtime/uLangCore/uLang > API/Runtime/uLangCore/uLang/Common > API/Runtime/uLangCore/uLang/Common/Text
References
| Module | uLangCore |
| Header | /Engine/Source/Runtime/Solaris/uLangCore/Public/uLang/Common/Text/TextRange.h |
| Include | #include "uLang/Common/Text/TextRange.h" |
Syntax
struct STextRange
Remarks
A range in a text document/string expressed as (zero-based) begin and end row/column. A range is comparable to a selection in an editor. Therefore the end position is exclusive. Columns are byte offsets into the UTF-8 encoded line.
To specify a range that contains a line including the line ending character(s), use an end position denoting the start of the next line (or) same row and the column just past the last character on the row.
Often used with CUTF8StringView and SIdxRange. CUTF8StringView should do the converting to and from SIdxRange and STextRange.
Similar to a LSP Range - https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#range Also similar to UE `FIntRect_
Constructors
| Type | Name | Description | |
|---|---|---|---|
| ULANG_FORCEINLINE | STextRange () |
||
| ULANG_FORCEINLINE | STextRange
(
ENoInit |
||
| ULANG_FORCEINLINE | STextRange
(
const STextPosition& BeginAndEnd |
||
| ULANG_FORCEINLINE | STextRange
(
const STextPosition& Begin, |
||
| ULANG_FORCEINLINE | STextRange
(
uint32_t BeginRow, |
Functions
| Type | Name | Description | |
|---|---|---|---|
| uint32_t | BeginColumn () |
||
| uint32_t | BeginRow () |
||
| uint32_t | EndColumn () |
||
| uint32_t | EndRow () |
||
| ULANG_FORCEINLINESTextPosition | GetBegin () |
||
| ULANG_FORCEINLINESTextPosition | GetEnd () |
||
| ULANG_FORCEINLINE void | Invalidate () |
||
| ULANG_FORCEINLINE void | |||
| ULANG_FORCEINLINE bool | IsContainedIn
(
const STextRange& ContainingRange |
||
| ULANG_FORCEINLINE bool | IsEmpty () |
||
| ULANG_FORCEINLINE bool | IsInRange
(
const STextPosition& Position |
||
| ULANG_FORCEINLINE bool | IsInvalid () |
||
| ULANG_FORCEINLINE bool | IsInvalidEnd () |
||
| ULANG_FORCEINLINE bool | IsOrdered () |
||
| ULANG_FORCEINLINE bool | IsRowMulti () |
||
| ULANG_FORCEINLINE bool | IsRowSingle () |
||
| ULANG_FORCEINLINE bool | IsValid () |
||
| ULANG_FORCEINLINE bool | IsValidEnd () |
||
| ULANG_FORCEINLINE bool | Overlaps
(
const STextRange& Other |
||
| ULANG_FORCEINLINE void | Reset () |
||
| ULANG_FORCEINLINE void | SetBegin
(
const STextPosition& Begin |
||
| void | SetBeginColumn
(
uint32_t Col |
||
| void | SetBeginRow
(
uint32_t Row |
||
| ULANG_FORCEINLINE void | SetEnd
(
const STextPosition& End |
||
| void | SetEndColumn
(
uint32_t Col |
||
| void | SetEndRow
(
uint32_t Row |
Operators
| Type | Name | Description | |
|---|---|---|---|
| ULANG_FORCEINLINE bool | operator!=
(
const STextRange& Other |
||
| ULANG_FORCEINLINESTextRange | operator|
(
const STextRange& Other |
Compute the union of two text ranges. | |
| ULANG_FORCEINLINESTextRange & | operator|=
(
const STextRange& Other |
Make this text range the union of this and another. | |
| ULANG_FORCEINLINE bool | operator==
(
const STextRange& Other |