ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable > Class Template Reference

Description:

template<typename TChar>
template<typename TCharConstOrMutable>
class alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >

Implementation of std::iterator_traits for class TString and its descendents. Base class String exposes const_iterator which uses const TChar* and const TChar& for template types TPointer and TReference. Descendant classes may expose a mutable version (e.g., AString).

As the name of the class indicates, this iterator satisfies the C++ standard library concept RandomAccessIterator .

Definition at line 1813 of file string.hpp.

#include <string.hpp>

Public Type Index:

using difference_type = integer
 Implementation of std::iterator_traits.
using iterator_category = std::random_access_iterator_tag
 Implementation of std::iterator_traits.
using pointer = TCharConstOrMutable*
 Implementation of std::iterator_traits.
using reference = TCharConstOrMutable&
 Implementation of std::iterator_traits.
using value_type = TCharConstOrMutable
 Implementation of std::iterator_traits.

Public Method Index:

 TRandomAccessIterator (TCharConstOrMutable *start=nullptr)
bool operator!= (TRandomAccessIterator other) const
TCharConstOrMutable & operator* ()
TCharConstOrMutable & operator* () const
TRandomAccessIterator operator+ (integer n) const
TRandomAccessIteratoroperator++ ()
TRandomAccessIterator operator++ (int)
TRandomAccessIteratoroperator+= (integer n)
TRandomAccessIterator operator- (integer n) const
integer operator- (TRandomAccessIterator other) const
TRandomAccessIteratoroperator-- ()
TRandomAccessIterator operator-- (int)
TRandomAccessIteratoroperator-= (integer n)
bool operator< (TRandomAccessIterator other) const
bool operator<= (TRandomAccessIterator other) const
bool operator== (TRandomAccessIterator other) const
bool operator> (TRandomAccessIterator other) const
bool operator>= (TRandomAccessIterator other) const
TCharConstOrMutable & operator[] (integer n) const

Protected Field Index:

TCharConstOrMutable * p
 The pointer into the buffer is all we store.

Type Definition Details:

◆ difference_type

template<typename TChar>
template<typename TCharConstOrMutable>
using alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::difference_type = integer

Implementation of std::iterator_traits.

Definition at line 1817 of file string.hpp.

◆ iterator_category

template<typename TChar>
template<typename TCharConstOrMutable>
using alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::iterator_category = std::random_access_iterator_tag

Implementation of std::iterator_traits.

Definition at line 1815 of file string.hpp.

◆ pointer

template<typename TChar>
template<typename TCharConstOrMutable>
using alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::pointer = TCharConstOrMutable*

Implementation of std::iterator_traits.

Definition at line 1818 of file string.hpp.

◆ reference

template<typename TChar>
template<typename TCharConstOrMutable>
using alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::reference = TCharConstOrMutable&

Implementation of std::iterator_traits.

Definition at line 1819 of file string.hpp.

◆ value_type

template<typename TChar>
template<typename TCharConstOrMutable>
using alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::value_type = TCharConstOrMutable

Implementation of std::iterator_traits.

Definition at line 1816 of file string.hpp.

Field Details:

◆ p

template<typename TChar>
template<typename TCharConstOrMutable>
TCharConstOrMutable* alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::p
protected

The pointer into the buffer is all we store.

Definition at line 1823 of file string.hpp.

Constructor(s) / Destructor Details:

◆ TRandomAccessIterator()

template<typename TChar>
template<typename TCharConstOrMutable>
alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::TRandomAccessIterator ( TCharConstOrMutable * start = nullptr)
inlineexplicit

Constructor.

Parameters
startPointer to the initial character.

Definition at line 1827 of file string.hpp.

Method Details:

◆ operator!=()

template<typename TChar>
template<typename TCharConstOrMutable>
bool alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator!= ( TRandomAccessIterator< TCharConstOrMutable > other) const
inline

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and given iterator are not equal, false otherwise.

Definition at line 1848 of file string.hpp.

◆ operator*() [1/2]

template<typename TChar>
template<typename TCharConstOrMutable>
TCharConstOrMutable & alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator* ( )
inline

Retrieves the character that this iterator references.

Returns
The character value.

Definition at line 1856 of file string.hpp.

◆ operator*() [2/2]

template<typename TChar>
template<typename TCharConstOrMutable>
TCharConstOrMutable & alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator* ( ) const
inline

Retrieves the character that this iterator references.

Returns
The character value.

Definition at line 1852 of file string.hpp.

◆ operator+()

template<typename TChar>
template<typename TCharConstOrMutable>
TRandomAccessIterator alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator+ ( integer n) const
inline

Addition.

Parameters
nThe value to subtract.
Returns
The resulting iterator value.

Definition at line 1886 of file string.hpp.

◆ operator++() [1/2]

template<typename TChar>
template<typename TCharConstOrMutable>
TRandomAccessIterator & alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator++ ( )
inline

Prefix increment operator.

Returns
A reference to this object.

Definition at line 1833 of file string.hpp.

◆ operator++() [2/2]

template<typename TChar>
template<typename TCharConstOrMutable>
TRandomAccessIterator alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator++ ( int )
inline

Postfix increment operator.

Returns
An iterator value that is not increased, yet.

Definition at line 1837 of file string.hpp.

◆ operator+=()

template<typename TChar>
template<typename TCharConstOrMutable>
TRandomAccessIterator & alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator+= ( integer n)
inline

Addition assignment.

Parameters
nThe value to subtract.
Returns
A reference to this iterator.

Definition at line 1876 of file string.hpp.

◆ operator-() [1/2]

template<typename TChar>
template<typename TCharConstOrMutable>
TRandomAccessIterator alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator- ( integer n) const
inline

Subtraction.

Parameters
nThe value to subtract.
Returns
The resulting iterator value.

Definition at line 1891 of file string.hpp.

◆ operator-() [2/2]

template<typename TChar>
template<typename TCharConstOrMutable>
integer alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator- ( TRandomAccessIterator< TCharConstOrMutable > other) const
inline

Difference (distance) from this iterator to the given one.

Parameters
otherThe iterator to subtract
Returns
The difference between (distance of) this and the given iterator.

Definition at line 1896 of file string.hpp.

◆ operator--() [1/2]

template<typename TChar>
template<typename TCharConstOrMutable>
TRandomAccessIterator & alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator-- ( )
inline

Prefix decrement operator.

Returns
A reference to this object.

Definition at line 1863 of file string.hpp.

◆ operator--() [2/2]

template<typename TChar>
template<typename TCharConstOrMutable>
TRandomAccessIterator alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator-- ( int )
inline

Postfix decrement operator.

Returns
The iterator value prior the decrement operation.

Definition at line 1868 of file string.hpp.

◆ operator-=()

template<typename TChar>
template<typename TCharConstOrMutable>
TRandomAccessIterator & alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator-= ( integer n)
inline

Subtraction assignment.

Parameters
nThe value to subtract.
Returns
A reference to this iterator.

Definition at line 1881 of file string.hpp.

◆ operator<()

template<typename TChar>
template<typename TCharConstOrMutable>
bool alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator< ( TRandomAccessIterator< TCharConstOrMutable > other) const
inline

Compares this iterator with the given one.

Parameters
otherThe iterator to compare
Returns
true if this iterator is smaller than other, false otherwise.

Definition at line 1910 of file string.hpp.

◆ operator<=()

template<typename TChar>
template<typename TCharConstOrMutable>
bool alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator<= ( TRandomAccessIterator< TCharConstOrMutable > other) const
inline

Compares this iterator with the given one.

Parameters
otherThe iterator to compare
Returns
true if this iterator is smaller than or equal to other, false otherwise.

Definition at line 1916 of file string.hpp.

◆ operator==()

template<typename TChar>
template<typename TCharConstOrMutable>
bool alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator== ( TRandomAccessIterator< TCharConstOrMutable > other) const
inline

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and the given iterator are pointing to the same character in the same array, false otherwise.

Definition at line 1843 of file string.hpp.

◆ operator>()

template<typename TChar>
template<typename TCharConstOrMutable>
bool alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator> ( TRandomAccessIterator< TCharConstOrMutable > other) const
inline

Compares this iterator with the given one.

Parameters
otherThe iterator to compare
Returns
true if this iterator is greater than other, false otherwise.

Definition at line 1922 of file string.hpp.

◆ operator>=()

template<typename TChar>
template<typename TCharConstOrMutable>
bool alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator>= ( TRandomAccessIterator< TCharConstOrMutable > other) const
inline

Compares this iterator with the given one.

Parameters
otherThe iterator to compare
Returns
true if this iterator is greater than or equal to other, false otherwise.

Definition at line 1928 of file string.hpp.

◆ operator[]()

template<typename TChar>
template<typename TCharConstOrMutable>
TCharConstOrMutable & alib::strings::TString< TChar >::TRandomAccessIterator< TCharConstOrMutable >::operator[] ( integer n) const
inline

Subscript operator.

Parameters
nThe distance to add.
Returns
Reference to the character referenced by this iterator plus the distance given.

Definition at line 1902 of file string.hpp.


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