Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::string_search_detail Namespace Reference

Functions

Array< size_t > all_match_positions (const size_t text_size)
 Generate an array of all positions from 0 to text_size.
 
bool find_unused_delimiter (const std::string_view a, const std::string_view b, char &delimiter)
 Find a character not present in either string.
 
bool equals_at (const std::string_view text, const std::string_view pattern, const size_t pos)
 Check if pattern matches text at given position.
 

Function Documentation

◆ all_match_positions()

Array< size_t > Aleph::string_search_detail::all_match_positions ( const size_t  text_size)
inline

Generate an array of all positions from 0 to text_size.

Parameters
[in]text_sizeThe size of the text.
Returns
Array of positions.

Definition at line 72 of file String_Search.H.

References Aleph::divide_and_conquer_partition_dp(), and Aleph::Array< T >::reserve().

Referenced by Aleph::boyer_moore_horspool_search(), Aleph::kmp_search(), Aleph::rabin_karp_search(), and Aleph::z_search().

◆ equals_at()

bool Aleph::string_search_detail::equals_at ( const std::string_view  text,
const std::string_view  pattern,
const size_t  pos 
)
inline

Check if pattern matches text at given position.

Parameters
[in]textThe text to search in.
[in]patternThe pattern to match.
[in]posThe position in text to check.
Returns
true if matches, false otherwise.

Definition at line 117 of file String_Search.H.

References Aleph::divide_and_conquer_partition_dp().

Referenced by Aleph::rabin_karp_search().

◆ find_unused_delimiter()

bool Aleph::string_search_detail::find_unused_delimiter ( const std::string_view  a,
const std::string_view  b,
char delimiter 
)
inline

Find a character not present in either string.

Parameters
[in]aFirst string.
[in]bSecond string.
[out]delimiterThe unused character found.
Returns
true if an unused character was found, false otherwise.

Definition at line 88 of file String_Search.H.

References Aleph::divide_and_conquer_partition_dp().

Referenced by Aleph::z_search().