API reference
Preparing search index…

Rml::StringView with immutable native backing retained by every slice.

All positions and lengths use bytes. Partial UTF-8 slices are allowed. Byte snapshots are independently writable and never alter the owner.

Source & inheritance
Member directory9

Constructors

Methods

Constructors

  • Construct a retained byte view.

    Parameters

    value
    string | StringView = ''

    Copied string or retained native view; default ''.

    offset
    number = 0

    Nonnegative byte offset, default zero.

    countOptional
    number

    Byte count, clipped at the end; default all remaining.

    Returns

    Source & inheritance

Methods

  • Represent Rml::StringView::begin as a view-relative byte position.

    Returns

    number

    Zero, including for an empty view.

    Source & inheritance
  • Check whether this UTF-8 view contains no bytes.

    Returns

    boolean

    Whether this view has no bytes.

    Source & inheritance
  • Represent Rml::StringView::end as a view-relative byte position.

    Returns

    number

    Byte length; the end position cannot be dereferenced.

    Source & inheritance
  • Compare every byte with Rml::StringView::operator==.

    Parameters

    other
    string | StringView

    Other view or UTF-8 string.

    Returns

    boolean

    Byte equality including bytes after NUL.

    Source & inheritance
  • Read Rml::StringView::size without a native call.

    Returns

    number

    Byte length.

    Source & inheritance
  • Create another view retaining this same immutable native owner.

    Parameters

    offset
    number

    Byte offset inside this view.

    countOptional
    number

    Byte count, clipped at the end; default all remaining.

    Returns

    Retained byte slice.

    Source & inheritance
  • Copy all bytes into an independently owned native snapshot.

    Returns

    Uint8Array

    Writable snapshot that preserves incomplete UTF-8 and NUL.

    Source & inheritance
  • Copy the view using Rml::StringView's String conversion.

    Returns

    string

    UTF-8 decoded text, replacing incomplete or invalid UTF-8.

    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0