morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::table::TextCollator Class Referenceabstract

Orders and matches text. The renderer injects the toolkit's collator for the user's locale; CodePointCollator is the default. More...

#include <data_source.hpp>

Inheritance diagram for morph::table::TextCollator:
morph::table::CodePointCollator

Public Member Functions

virtual std::string sortKey (std::string_view text) const =0
 A key whose byte order is the collation order of text.
virtual std::string fold (std::string_view text) const =0
 text folded to primary strength: two texts a user would call equal ignoring case and accents fold to the same bytes.
virtual std::shared_ptr< TextCollator const > cloneForTask () const
 An instance for one task to use alone.

Detailed Description

Orders and matches text. The renderer injects the toolkit's collator for the user's locale; CodePointCollator is the default.

Called from the engine's worker. An implementation either is safe to call concurrently, and returns null from cloneForTask, or returns a fresh instance there that one task uses alone.

Definition at line 225 of file data_source.hpp.

Member Function Documentation

◆ sortKey()

virtual std::string morph::table::TextCollator::sortKey ( std::string_view text) const
nodiscardpure virtual

A key whose byte order is the collation order of text.

Parameters
textThe text to order.
Returns
The collation key.

Implemented in morph::table::CodePointCollator.

◆ fold()

virtual std::string morph::table::TextCollator::fold ( std::string_view text) const
nodiscardpure virtual

text folded to primary strength: two texts a user would call equal ignoring case and accents fold to the same bytes.

Parameters
textThe text to fold.
Returns
The folded text, which filters match against.

Implemented in morph::table::CodePointCollator.

◆ cloneForTask()

virtual std::shared_ptr< TextCollator const > morph::table::TextCollator::cloneForTask ( ) const
inlinenodiscardvirtual

An instance for one task to use alone.

Returns
Null when this instance is safe to call concurrently, else a copy.

Definition at line 242 of file data_source.hpp.


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