tlx
Loading...
Searching...
No Matches
StringSuffixSet Class Reference

Class implementing StringSet concept for suffix sorting indexes of a std::string text object. More...

#include <string_set.hpp>

Inheritance diagram for StringSuffixSet:
StringSuffixSetTraits StringSetBase< StringSuffixSet, StringSuffixSetTraits >

Public Member Functions

 StringSuffixSet (const Text &text, const Iterator &begin, const Iterator &end)
 Construct from begin and end string pointers.
size_t size () const
 Return size of string array.
Iterator begin () const
 Iterator representing first String position.
Iterator end () const
 Iterator representing beyond last String position.
Stringoperator[] (const Iterator &i) const
 Array access (readable and writable) to String objects.
CharIterator get_chars (const String &s, size_t depth) const
 Return CharIterator for referenced string, which belongs to this set.
bool is_end (const String &, const CharIterator &i) const
 Returns true if CharIterator is at end of the given String.
std::string get_string (const String &s, size_t depth=0) const
 Return complete string (for debugging purposes)
StringSuffixSet sub (Iterator begin, Iterator end) const
 Subset this string set using iterator range.
Container allocate (size_t n) const
 Allocate a new temporary string container with n empty Strings.
 StringSuffixSet (Container &c)
 Construct from a string container.
Public Member Functions inherited from StringSetBase< StringSuffixSet, StringSuffixSetTraits >
StringSuffixSetTraits::Stringat (size_t i) const
 index-based array access (readable and writable) to String objects.
StringSuffixSet subi (size_t begin, size_t end) const
 Subset this string set using index range.
bool check_order (const typename StringSuffixSetTraits::String &s1, const typename StringSuffixSetTraits::String &s2) const
void print () const
bool is_equal (const typename StringSuffixSetTraits::String &a, const typename StringSuffixSetTraits::CharIterator &ai, const typename StringSuffixSetTraits::String &b, const typename StringSuffixSetTraits::CharIterator &bi) const
 check equality of two strings a and b at char iterators ai and bi.
bool is_less (const typename StringSuffixSetTraits::String &a, const typename StringSuffixSetTraits::CharIterator &ai, const typename StringSuffixSetTraits::String &b, const typename StringSuffixSetTraits::CharIterator &bi) const
 check if string a is less or equal to string b at iterators ai and bi.
bool is_leq (const typename StringSuffixSetTraits::String &a, const typename StringSuffixSetTraits::CharIterator &ai, const typename StringSuffixSetTraits::String &b, const typename StringSuffixSetTraits::CharIterator &bi) const
 check if string a is less or equal to string b at iterators ai and bi.
StringSuffixSetTraits::Char get_char (const typename StringSuffixSetTraits::String &s, size_t depth) const
std::uint8_t get_uint8 (const typename StringSuffixSetTraits::String &s, typename StringSuffixSetTraits::CharIterator i) const
 Return up to 1 characters of string s at iterator i packed into a uint8_t (only works correctly for 8-bit characters)
std::uint16_t get_uint16 (const typename StringSuffixSetTraits::String &s, typename StringSuffixSetTraits::CharIterator i) const
 Return up to 2 characters of string s at iterator i packed into a uint16_t (only works correctly for 8-bit characters)
std::uint32_t get_uint32 (const typename StringSuffixSetTraits::String &s, typename StringSuffixSetTraits::CharIterator i) const
 Return up to 4 characters of string s at iterator i packed into a uint32_t (only works correctly for 8-bit characters)
std::uint64_t get_uint64 (const typename StringSuffixSetTraits::String &s, typename StringSuffixSetTraits::CharIterator i) const
 Return up to 8 characters of string s at iterator i packed into a uint64_t (only works correctly for 8-bit characters)

Static Public Member Functions

static StringSuffixSet Initialize (const Text &text, std::vector< String > &sa)
 Initializing constructor which fills output vector sa with indices.
static void deallocate (Container &c)
 Deallocate a temporary string container.

Protected Attributes

const Texttext_
 reference to base text
Iterator begin_
 iterators inside the output suffix array.
Iterator end_

Additional Inherited Members

Public Types inherited from StringSuffixSetTraits
typedef std::string Text
 exported alias for assumed string container
typedef std::uint8_t Char
 exported alias for character type
typedef Text::size_type String
 String reference: suffix index of the text.
typedef std::vector< String >::iterator Iterator
 Iterator over string references: using std::vector's iterator over suffix array vector.
typedef const CharCharIterator
 iterator of characters in a string
typedef std::pair< Text, std::vector< String > > Container
 exported alias for assumed string container

Detailed Description

Class implementing StringSet concept for suffix sorting indexes of a std::string text object.

Definition at line 575 of file string_set.hpp.

Constructor & Destructor Documentation

◆ StringSuffixSet() [1/2]

StringSuffixSet ( const Text & text,
const Iterator & begin,
const Iterator & end )
inline

Construct from begin and end string pointers.

Definition at line 581 of file string_set.hpp.

◆ StringSuffixSet() [2/2]

StringSuffixSet ( Container & c)
inlineexplicit

Construct from a string container.

Definition at line 632 of file string_set.hpp.

Member Function Documentation

◆ allocate()

Container allocate ( size_t n) const
inline

Allocate a new temporary string container with n empty Strings.

Definition at line 624 of file string_set.hpp.

◆ begin()

Iterator begin ( ) const
inline

Iterator representing first String position.

Definition at line 599 of file string_set.hpp.

◆ deallocate()

void deallocate ( Container & c)
inlinestatic

Deallocate a temporary string container.

Definition at line 628 of file string_set.hpp.

◆ end()

Iterator end ( ) const
inline

Iterator representing beyond last String position.

Definition at line 601 of file string_set.hpp.

◆ get_chars()

CharIterator get_chars ( const String & s,
size_t depth ) const
inline

Return CharIterator for referenced string, which belongs to this set.

Definition at line 608 of file string_set.hpp.

◆ get_string()

std::string get_string ( const String & s,
size_t depth = 0 ) const
inline

Return complete string (for debugging purposes)

Definition at line 616 of file string_set.hpp.

◆ Initialize()

StringSuffixSet Initialize ( const Text & text,
std::vector< String > & sa )
inlinestatic

Initializing constructor which fills output vector sa with indices.

Definition at line 589 of file string_set.hpp.

◆ is_end()

bool is_end ( const String & ,
const CharIterator & i ) const
inline

Returns true if CharIterator is at end of the given String.

Definition at line 612 of file string_set.hpp.

◆ operator[]()

String & operator[] ( const Iterator & i) const
inline

Array access (readable and writable) to String objects.

Definition at line 604 of file string_set.hpp.

◆ size()

size_t size ( ) const
inline

Return size of string array.

Definition at line 597 of file string_set.hpp.

◆ sub()

StringSuffixSet sub ( Iterator begin,
Iterator end ) const
inline

Subset this string set using iterator range.

Definition at line 620 of file string_set.hpp.

Member Data Documentation

◆ begin_

Iterator begin_
protected

iterators inside the output suffix array.

Definition at line 642 of file string_set.hpp.

◆ end_

Iterator end_
protected

Definition at line 642 of file string_set.hpp.

◆ text_

const Text* text_
protected

reference to base text

Definition at line 639 of file string_set.hpp.


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