tlx
Loading...
Searching...
No Matches
GenericCharStringSet< CharType > Class Template Reference

Class implementing StringSet concept for char* and unsigned char* strings. More...

#include <string_set.hpp>

Inheritance diagram for GenericCharStringSet< CharType >:
GenericCharStringSetTraits< CharType > StringSetBase< GenericCharStringSet< CharType >, GenericCharStringSetTraits< CharType > >

Public Types

typedef GenericCharStringSetTraits< CharType > Traits
 
typedef Traits::Char Char
 
typedef Traits::String String
 
typedef Traits::Iterator Iterator
 
typedef Traits::CharIterator CharIterator
 
typedef Traits::Container Container
 
- Public Types inherited from GenericCharStringSetTraits< CharType >
typedef CharType Char
 exported alias for character type
 
typedef CharString
 String reference: pointer to first character.
 
typedef StringIterator
 Iterator over string references: pointer over pointers.
 
typedef const CharCharIterator
 iterator of characters in a string
 
typedef std::pair< Iterator, size_t > Container
 exported alias for assumed string container
 

Public Member Functions

 GenericCharStringSet (Iterator begin, Iterator end)
 Construct from begin and end string pointers.
 
 GenericCharStringSet (const Container &c)
 Construct from a string container.
 
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[] (Iterator i) const
 Iterator-based array access (readable and writable) to String objects.
 
CharIterator get_chars (const String &s, size_t depth) const
 Return CharIterator for referenced string, which belong 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)
 
GenericCharStringSet sub (Iterator begin, Iterator end) const
 Subset this string set using iterator range.
 
- Public Member Functions inherited from StringSetBase< GenericCharStringSet< CharType >, GenericCharStringSetTraits< CharType > >
Traits::String & at (size_t i) const
 index-based array access (readable and writable) to String objects.
 
GenericCharStringSet< CharType > subi (size_t begin, size_t end) const
 Subset this string set using index range.
 
bool check_order (const typename Traits::String &s1, const typename Traits::String &s2) const
 
bool check_order () const
 
void print () const
 
bool is_equal (const typename Traits::String &a, const typename Traits::CharIterator &ai, const typename Traits::String &b, const typename Traits::CharIterator &bi) const
 check equality of two strings a and b at char iterators ai and bi.
 
bool is_less (const typename Traits::String &a, const typename Traits::CharIterator &ai, const typename Traits::String &b, const typename Traits::CharIterator &bi) const
 check if string a is less or equal to string b at iterators ai and bi.
 
bool is_leq (const typename Traits::String &a, const typename Traits::CharIterator &ai, const typename Traits::String &b, const typename Traits::CharIterator &bi) const
 check if string a is less or equal to string b at iterators ai and bi.
 
Traits::Char get_char (const typename Traits::String &s, size_t depth) const
 
std::uint8_t get_uint8 (const typename Traits::String &s, typename Traits::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::uint8_t get_uint8 (const typename Traits::String &s, size_t depth) const
 
std::uint16_t get_uint16 (const typename Traits::String &s, typename Traits::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::uint16_t get_uint16 (const typename Traits::String &s, size_t depth) const
 
std::uint32_t get_uint32 (const typename Traits::String &s, typename Traits::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::uint32_t get_uint32 (const typename Traits::String &s, size_t depth) const
 
std::uint64_t get_uint64 (const typename Traits::String &s, typename Traits::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)
 
std::uint64_t get_uint64 (const typename Traits::String &s, size_t depth) const
 

Static Public Member Functions

static Container allocate (size_t n)
 Allocate a new temporary string container with n empty Strings.
 
static void deallocate (Container &c)
 Deallocate a temporary string container.
 

Protected Attributes

Iterator begin_
 array of string pointers
 
Iterator end_
 

Detailed Description

template<typename CharType>
class tlx::sort_strings_detail::GenericCharStringSet< CharType >

Class implementing StringSet concept for char* and unsigned char* strings.

Definition at line 297 of file string_set.hpp.

Member Typedef Documentation

◆ Char

template<typename CharType >
typedef Traits::Char Char

Definition at line 305 of file string_set.hpp.

◆ CharIterator

template<typename CharType >
typedef Traits::CharIterator CharIterator

Definition at line 308 of file string_set.hpp.

◆ Container

template<typename CharType >
typedef Traits::Container Container

Definition at line 309 of file string_set.hpp.

◆ Iterator

template<typename CharType >
typedef Traits::Iterator Iterator

Definition at line 307 of file string_set.hpp.

◆ String

template<typename CharType >
typedef Traits::String String

Definition at line 306 of file string_set.hpp.

◆ Traits

template<typename CharType >
typedef GenericCharStringSetTraits<CharType> Traits

Definition at line 303 of file string_set.hpp.

Constructor & Destructor Documentation

◆ GenericCharStringSet() [1/2]

template<typename CharType >
GenericCharStringSet ( Iterator  begin,
Iterator  end 
)
inline

Construct from begin and end string pointers.

Definition at line 312 of file string_set.hpp.

◆ GenericCharStringSet() [2/2]

template<typename CharType >
GenericCharStringSet ( const Container c)
inlineexplicit

Construct from a string container.

Definition at line 317 of file string_set.hpp.

Member Function Documentation

◆ allocate()

template<typename CharType >
static Container allocate ( size_t  n)
inlinestatic

Allocate a new temporary string container with n empty Strings.

Definition at line 349 of file string_set.hpp.

◆ begin()

template<typename CharType >
Iterator begin ( ) const
inline

Iterator representing first String position.

Definition at line 324 of file string_set.hpp.

◆ deallocate()

template<typename CharType >
static void deallocate ( Container c)
inlinestatic

Deallocate a temporary string container.

Definition at line 353 of file string_set.hpp.

◆ end()

template<typename CharType >
Iterator end ( ) const
inline

Iterator representing beyond last String position.

Definition at line 326 of file string_set.hpp.

◆ get_chars()

template<typename CharType >
CharIterator get_chars ( const String s,
size_t  depth 
) const
inline

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

Definition at line 333 of file string_set.hpp.

◆ get_string()

template<typename CharType >
std::string get_string ( const String s,
size_t  depth = 0 
) const
inline

Return complete string (for debugging purposes)

Definition at line 341 of file string_set.hpp.

◆ is_end()

template<typename CharType >
bool is_end ( const String ,
const CharIterator i 
) const
inline

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

Definition at line 337 of file string_set.hpp.

◆ operator[]()

template<typename CharType >
String & operator[] ( Iterator  i) const
inline

Iterator-based array access (readable and writable) to String objects.

Definition at line 329 of file string_set.hpp.

◆ size()

template<typename CharType >
size_t size ( ) const
inline

Return size of string array.

Definition at line 322 of file string_set.hpp.

◆ sub()

template<typename CharType >
GenericCharStringSet sub ( Iterator  begin,
Iterator  end 
) const
inline

Subset this string set using iterator range.

Definition at line 345 of file string_set.hpp.

Member Data Documentation

◆ begin_

template<typename CharType >
Iterator begin_
protected

array of string pointers

Definition at line 358 of file string_set.hpp.

◆ end_

template<typename CharType >
Iterator end_
protected

Definition at line 358 of file string_set.hpp.


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