sl_text_analyze function

  1. @Native<Pointer<Int32> Function(sl_analyzer_handle_t, Pointer<Char>)>(sl_analyzer_handle_t, ffi.Pointer<ffi.Char>)>(assetId: _sweetlineAssetId)
Pointer<Int32> sl_text_analyze(
  1. sl_analyzer_handle_t analyzer_handle,
  2. Pointer<Char> text
)

Perform full highlight analysis on a text @param analyzer_handle Plain text highlight analyzer handle @param text Full text content @return Analysis result, tightly packed in byte order. Structure: @code result0 = span payload flags bit0: hasStartIndex bit1: inlineStyle result1 = span field count (stride) result2 = line count Followed by line_count line entries: line_entry0 = span count of current line Followed by span_count * stride fields Span payload: common: column, length if show_index=true: append startIndex if inline_style=true: append foregroundColor, backgroundColor, fontAttributes else: append styleId fontAttributes bitmask: (bits & 1) != 0 => bold (bits & (1 << 1)) != 0 => italic (bits & (1 << 2)) != 0 => strikethrough @endcode Note: the return value must be freed by calling sl_free_buffer after use

Implementation

@ffi.Native<
  ffi.Pointer<ffi.Int32> Function(sl_analyzer_handle_t, ffi.Pointer<ffi.Char>)
>(assetId: _sweetlineAssetId)
external ffi.Pointer<ffi.Int32> sl_text_analyze(
  sl_analyzer_handle_t analyzer_handle,
  ffi.Pointer<ffi.Char> text,
);