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

Class implementing StringSet concept for arrays of std::string objects. More...

#include <string_set.hpp>

Inheritance diagram for StdStringSet:
StdStringSetTraits StringSetBase< StdStringSet, StdStringSetTraits >

Public Member Functions

 StdStringSet (const Iterator &begin, const Iterator &end)
 Construct from begin and end string pointers.
 
 StdStringSet (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[] (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 &s, 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)
 
StdStringSet sub (Iterator begin, Iterator end) const
 Subset this string set using iterator range.
 
- Public Member Functions inherited from StringSetBase< StdStringSet, StdStringSetTraits >
Traits::String & at (size_t i) const
 index-based array access (readable and writable) to String objects.
 
StdStringSet 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
 
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)
 
uint8_t get_uint8 (const typename Traits::String &s, size_t depth) const
 
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)
 
uint16_t get_uint16 (const typename Traits::String &s, size_t depth) const
 
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)
 
uint32_t get_uint32 (const typename Traits::String &s, size_t depth) const
 
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)
 
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_
 pointers to std::string objects
 
Iterator end_
 

Additional Inherited Members

- Public Types inherited from StdStringSetTraits
typedef uint8_t Char
 exported alias for character type
 
typedef std::string String
 String reference: std::string, which should be reference counted.
 
typedef StringIterator
 Iterator over string references: pointer to std::string.
 
typedef const CharCharIterator
 iterator of characters in a string
 
typedef std::pair< Iterator, size_t > Container
 exported alias for assumed string container
 

Detailed Description

Class implementing StringSet concept for arrays of std::string objects.

Definition at line 394 of file string_set.hpp.

Constructor & Destructor Documentation

◆ StdStringSet() [1/2]

StdStringSet ( const Iterator begin,
const Iterator end 
)
inline

Construct from begin and end string pointers.

Definition at line 400 of file string_set.hpp.

◆ StdStringSet() [2/2]

StdStringSet ( Container c)
inlineexplicit

Construct from a string container.

Definition at line 405 of file string_set.hpp.

Member Function Documentation

◆ allocate()

static Container allocate ( size_t  n)
inlinestatic

Allocate a new temporary string container with n empty Strings.

Definition at line 437 of file string_set.hpp.

◆ begin()

Iterator begin ( ) const
inline

Iterator representing first String position.

Definition at line 412 of file string_set.hpp.

◆ deallocate()

static void deallocate ( Container c)
inlinestatic

Deallocate a temporary string container.

Definition at line 441 of file string_set.hpp.

◆ end()

Iterator end ( ) const
inline

Iterator representing beyond last String position.

Definition at line 414 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 421 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 429 of file string_set.hpp.

◆ is_end()

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

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

Definition at line 425 of file string_set.hpp.

◆ operator[]()

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

Array access (readable and writable) to String objects.

Definition at line 417 of file string_set.hpp.

◆ size()

size_t size ( ) const
inline

Return size of string array.

Definition at line 410 of file string_set.hpp.

◆ sub()

StdStringSet sub ( Iterator  begin,
Iterator  end 
) const
inline

Subset this string set using iterator range.

Definition at line 433 of file string_set.hpp.

Member Data Documentation

◆ begin_

Iterator begin_
protected

pointers to std::string objects

Definition at line 446 of file string_set.hpp.

◆ end_

Iterator end_
protected

Definition at line 446 of file string_set.hpp.


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