Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::DocumentSearchMatch Struct Reference

Immutable owning selection; remains readable after session/source replacement. text is the exact decoded UTF-8 literal. snippet contains bounded preceding whole-grapheme context and the match; it is empty when the match exceeds its snippet cap. Neither string borrows source pages or UI state. More...

#include <document_search.hpp>

Public Member Functions

std::size_t retainedBytes () const noexcept

Public Attributes

DocumentRevision revision
 Exact source namespace and provider revision.
std::uint64_t byteOffset {}
 Inclusive offset in the original source encoding.
std::uint64_t byteLength {}
 Original byte length, with an exclusive whole-grapheme end.
std::string text = std::string(0, '\0')
 Complete UTF-8 match, bounded by maxQueryBytes.
std::string snippet = std::string(0, '\0')
 Whole-grapheme context, bounded by maxSnippetBytes.
std::size_t snippetMatchOffset {}
 Inclusive UTF-8 match offset inside snippet.
std::size_t snippetMatchLength {}
 UTF-8 match length inside snippet; zero for an omitted snippet.
bool snippetTruncated {}
 The complete match cannot fit inside the configured snippet cap.

Friends

class DocumentSearchSession

Detailed Description

Immutable owning selection; remains readable after session/source replacement. text is the exact decoded UTF-8 literal. snippet contains bounded preceding whole-grapheme context and the match; it is empty when the match exceeds its snippet cap. Neither string borrows source pages or UI state.

Member Function Documentation

◆ retainedBytes()

std::size_t portals::DocumentSearchMatch::retainedBytes ( ) const
inlinenoexcept
Returns
Retained credit bytes; no allocation, locking or source access.

The documentation for this struct was generated from the following file: