Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::TStrings< T, CharType > Class Template Reference

Counted vector of strings. More...

#include <TStrings.h>

Inheritance diagram for sf::TStrings< T, CharType >:
Collaboration diagram for sf::TStrings< T, CharType >:

Public Types

typedef TVector< T > base_type
 Base type of this template .
 
typedef base_type::size_type size_type
 Size type of this template.
 
typedef base_type::value_type value_type
 Value type contained by this vector template.
 
typedef TIterator< value_typeiter_type
 Iteration type of the template.
 
typedef const iter_type const_iter_type
 Iteration const type of the template.
 
- Public Types inherited from sf::TVector< T >
typedef std::vector< T > base_type
 Base type of this template .
 
typedef base_type::size_type size_type
 Size type of this template.
 
typedef base_type::value_type value_type
 Value type contained by this vector template.
 
typedef TIterator< value_typeiter_type
 Iteration type of the template.
 
typedef const iter_type const_iter_type
 Iteration const type of the template.
 

Public Member Functions

 TStrings ()=default
 Default constructor.
 
template<typename InputIterator >
 TStrings (InputIterator first, InputIterator last)
 Initializing constructor using an iterator.
 
 TStrings (std::initializer_list< value_type > list)
 Initializer list constructor.
 
 TStrings (const base_type &list)
 Initializer list constructor.
 
 TStrings (size_type sz)
 Initializing constructor.
 
join (const T &glue)
 Joins all entries using the passed glue.
 
TStrings< T, CharType > & explode (T str, const T &separator)
 Splits all entries using the passed separator.
 
TStrings< T, CharType > & split (const T &s, CharType sep, CharType delimiter=0)
 Appends all split entries. Splits' the passed string using a separator and text delimiter.
 
- Public Member Functions inherited from sf::TVector< T >
 TVector ()=default
 Default constructor.
 
 TVector (const TVector &v)
 Copy constructor.
 
 TVector (TVector &&) noexcept=default
 Move constructor.
 
TVectoroperator= (const TVector &v) noexcept
 Assignment operator.
 
TVectoroperator= (TVector &&v) noexcept
 Assignment move operator.
 
template<typename InputIterator >
 TVector (InputIterator first, InputIterator last)
 Initializing constructor using an iterator.
 
 TVector (std::initializer_list< value_type > list)
 Initializing constructor using list like:
TVector vect{1,2,3,4,5,6,7}
 
 TVector (const base_type &sv)
 Copy constructor for base type.
 
 TVector (size_type sz)
 Initializing constructor.
 
size_type add (const T &t)
 Adds item at the end of the vector.
 
size_type add (T &&t)
 Adds item at the end of the vector.
 
TVector< T > & append (const T &t)
 Appends an entry to the vectors items at the end of the vector but returns itself.
 
TVector< T > & append (T &&t)
 Appends an entry to the vectors items at the end of the vector but returns itself.
 
size_type add (const TVector< T > &)
 Adds the vectors items at the end of the vector.
 
bool addAt (const T &t, size_type index)
 Adds an item at index position.
 
bool addAt (T &&t, size_type index)
 Adds an item at index position.
 
bool detach (const T &t)
 Removes specific item from the list by instance.
 
bool detachAt (size_type index)
 Removes specific item from the list by index.
 
bool isEmpty () const
 Returns true when empty false otherwise.
 
void flush ()
 Removes all entries from the vector.
 
void flush (size_type stop, size_type start=0)
 Removes specific range of entries from the vector.
 
size_type find (const T &) const
 Finds an entry by instance in the vector.
 
size_type count () const
 Returns the amount of entries in the vector.
 
T & first ()
 Gets the first element of the vector.
 
const T & first () const noexcept
 Gets the first element of the vector.
 
T & last ()
 Gets the last element of the vector.
 
const T & last () const noexcept
 Gets the last element of the vector.
 
bool startsWith (T t) const
 Checks if the first element is of the passed value.
 
bool endsWith (T t) const
 Checks if the last element is of the passed value.
 
T & get (size_type i)
 Gets entry from index position.
 
const T & get (size_type i) const
 Const version of getting entry from index position.
 
base_type getBase ()
 Returns the base type to access it methods explicitly.
 
base_type getBase () const
 Returns the constant const base type.
 
T & operator[] (size_type i)
 Array operator.
 
const T & operator[] (size_type i) const
 Const array operator.
 
std::ostream & write (std::ostream &os, bool inc_hex) const
 

Additional Inherited Members

- Static Public Attributes inherited from sf::TVector< T >
static const size_t npos = static_cast<size_type>(-1)
 Value returned by various member functions when they fail.
 

Detailed Description

template<typename T, typename CharType>
class sf::TStrings< T, CharType >

Counted vector of strings.

Member Typedef Documentation

◆ base_type

template<typename T , typename CharType >
typedef TVector<T> sf::TStrings< T, CharType >::base_type

Base type of this template .

◆ const_iter_type

template<typename T , typename CharType >
typedef const iter_type sf::TStrings< T, CharType >::const_iter_type

Iteration const type of the template.

◆ iter_type

template<typename T , typename CharType >
typedef TIterator<value_type> sf::TStrings< T, CharType >::iter_type

Iteration type of the template.

◆ size_type

template<typename T , typename CharType >
typedef base_type::size_type sf::TStrings< T, CharType >::size_type

Size type of this template.

◆ value_type

template<typename T , typename CharType >
typedef base_type::value_type sf::TStrings< T, CharType >::value_type

Value type contained by this vector template.

Constructor & Destructor Documentation

◆ TStrings() [1/5]

template<typename T , typename CharType >
sf::TStrings< T, CharType >::TStrings ( )
default

Default constructor.

◆ TStrings() [2/5]

template<typename T , typename CharType >
template<typename InputIterator >
sf::TStrings< T, CharType >::TStrings ( InputIterator  first,
InputIterator  last 
)
inline

Initializing constructor using an iterator.

◆ TStrings() [3/5]

template<typename T , typename CharType >
sf::TStrings< T, CharType >::TStrings ( std::initializer_list< value_type list)
inlineexplicit

Initializer list constructor.

◆ TStrings() [4/5]

template<typename T , typename CharType >
sf::TStrings< T, CharType >::TStrings ( const base_type list)
inlineexplicit

Initializer list constructor.

◆ TStrings() [5/5]

template<typename T , typename CharType >
sf::TStrings< T, CharType >::TStrings ( size_type  sz)
inlineexplicit

Initializing constructor.

Parameters
szSize of the vector.

Member Function Documentation

◆ explode()

template<typename T , typename CharType >
TStrings< T, CharType > & sf::TStrings< T, CharType >::explode ( str,
const T &  separator 
)
inline

Splits all entries using the passed separator.

Parameters
strSource string.
separatorSeparation string.
Returns
Separated string.

◆ join()

template<typename T , typename CharType >
T sf::TStrings< T, CharType >::join ( const T &  glue)
inline

Joins all entries using the passed glue.

Parameters
glueSeparation string.
Returns
Glued string.

◆ split()

template<typename T , typename CharType >
TStrings< T, CharType > & sf::TStrings< T, CharType >::split ( const T &  s,
CharType  sep,
CharType  delimiter = 0 
)
inline

Appends all split entries. Splits' the passed string using a separator and text delimiter.

Parameters
sSource string to split.
sepSeparator to split on which could be a comma character (',').
delimiterOptional text delimiter which could be a double quote character ('"')
Returns
Itself.

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