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

Owning immutable selected range; retains original data, never a scene or widget. Empty handles represent empty-query/no-match states. Old handles remain readable after replacement; Ref.current() determines whether their result identity still belongs to the current search. More...

#include <find_bar.hpp>

Public Member Functions

 FindMatch ()=default
 Construct an empty range without allocation.
 operator bool () const noexcept
std::size_t begin () const noexcept
std::size_t end () const noexcept
std::size_t ordinal () const noexcept
RowId rowId () const noexcept
std::uint64_t sourceRevision () const noexcept
std::optional< std::uint64_t > sourceByteOffset () const noexcept
std::optional< std::uint64_t > sourceByteLength () const noexcept
std::uint64_t queryGeneration () const noexcept
std::size_t storedCount () const noexcept
bool truncated () const noexcept
std::string_view text () const noexcept
std::string_view context (std::size_t maxBytes=256) const noexcept

Friends

struct detail::FindAccess

Detailed Description

Owning immutable selected range; retains original data, never a scene or widget. Empty handles represent empty-query/no-match states. Old handles remain readable after replacement; Ref.current() determines whether their result identity still belongs to the current search.

Member Function Documentation

◆ begin()

std::size_t portals::FindMatch::begin ( ) const
noexcept
Returns
Inclusive UTF-8 byte offset, or zero for an empty handle.

◆ context()

std::string_view portals::FindMatch::context ( std::size_t maxBytes = 256) const
noexcept
Parameters
maxBytesMaximum whole-grapheme context bytes; defaults to256, clamped to source length.
Returns
Borrowed context including the match, or empty when no match or the match exceeds the budget. Uses cached source boundaries and performs no allocation; the view expires with this handle.

◆ end()

std::size_t portals::FindMatch::end ( ) const
noexcept
Returns
Exclusive whole-grapheme UTF-8 offset, or zero for an empty handle.

◆ operator bool()

portals::FindMatch::operator bool ( ) const
explicitnoexcept
Returns
True for a selected stored range; no allocation or UI access.

◆ ordinal()

std::size_t portals::FindMatch::ordinal ( ) const
noexcept
Returns
One-based stored position, or zero for an empty handle.

◆ queryGeneration()

std::uint64_t portals::FindMatch::queryGeneration ( ) const
noexcept
Returns
Accepted model query generation, or zero for a legacy document match.

◆ rowId()

RowId portals::FindMatch::rowId ( ) const
noexcept
Returns
Full model row identity, or zero identity for an empty/legacy document match.

◆ sourceByteLength()

std::optional< std::uint64_t > portals::FindMatch::sourceByteLength ( ) const
noexcept
Returns
Original encoded byte length for document/file search, otherwise empty.

◆ sourceByteOffset()

std::optional< std::uint64_t > portals::FindMatch::sourceByteOffset ( ) const
noexcept
Returns
Original logical-source byte offset for document/file search, otherwise empty.

◆ sourceRevision()

std::uint64_t portals::FindMatch::sourceRevision ( ) const
noexcept
Returns
Exact provider revision, or zero for a legacy document match.

◆ storedCount()

std::size_t portals::FindMatch::storedCount ( ) const
noexcept
Returns
Number of stored ranges; never an exact total when truncated() is true.

◆ text()

std::string_view portals::FindMatch::text ( ) const
noexcept
Returns
Original selected bytes, borrowed until this handle is assigned or destroyed.

◆ truncated()

bool portals::FindMatch::truncated ( ) const
noexcept
Returns
Whether at least one additional whole-grapheme match was found beyond the cap.

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