Plasma Engine  2.0
Loading...
Searching...
No Matches
plStringIterator Struct Reference

STL forward iterator used by all string classes. Iterates over unicode characters. The iterator starts at the first character of the string and ends at the address beyond the last character of the string. More...

#include <StringIterator.h>

Public Types

using iterator_category = std::bidirectional_iterator_tag
 
using value_type = plUInt32
 
using difference_type = std::ptrdiff_t
 
using pointer = const char*
 
using reference = plUInt32
 

Public Member Functions

 PL_DECLARE_POD_TYPE ()
 
PL_ALWAYS_INLINE plStringIterator ()=default
 Constructs an invalid iterator.
 
PL_FORCE_INLINE plStringIterator (const char *pStartPtr, const char *pEndPtr, const char *pCurPtr)
 Constructs either a begin or end iterator for the given string.
 
PL_ALWAYS_INLINE bool IsValid () const
 Checks whether this iterator points to a valid element. Invalid iterators either point to m_pEndPtr or were never initialized.
 
PL_ALWAYS_INLINE plUInt32 GetCharacter () const
 Returns the currently pointed to character in Utf32 encoding.
 
PL_ALWAYS_INLINE plUInt32 operator* () const
 Returns the currently pointed to character in Utf32 encoding.
 
PL_ALWAYS_INLINE const char * GetData () const
 Returns the address the iterator currently points to.
 
PL_ALWAYS_INLINE bool operator== (const plStringIterator &it2) const
 Checks whether the two iterators point to the same element.
 
 PL_ADD_DEFAULT_OPERATOR_NOTEQUAL (const plStringIterator &)
 
PL_ALWAYS_INLINE plUInt32 Advance ()
 Advances the iterated to the next character, same as operator++, but returns how many bytes were consumed in the source string.
 
PL_ALWAYS_INLINE plStringIteratoroperator++ ()
 Move to the next Utf8 character.
 
PL_ALWAYS_INLINE plStringIteratoroperator-- ()
 Move to the previous Utf8 character.
 
PL_ALWAYS_INLINE plStringIterator operator++ (int)
 Move to the next Utf8 character.
 
PL_ALWAYS_INLINE plStringIterator operator-- (int)
 Move to the previous Utf8 character.
 
PL_FORCE_INLINE void operator+= (difference_type d)
 Advances the iterator forwards by d characters. Does not move it beyond the range's end.
 
PL_FORCE_INLINE void operator-= (difference_type d)
 Moves the iterator backwards by d characters. Does not move it beyond the range's start.
 
PL_ALWAYS_INLINE plStringIterator operator+ (difference_type d) const
 Returns an iterator that is advanced forwards by d characters.
 
PL_ALWAYS_INLINE plStringIterator operator- (difference_type d) const
 Returns an iterator that is advanced backwards by d characters.
 
void SetCurrentPosition (const char *szCurPos)
 Allows to set the 'current' iteration position to a different value.
 

Detailed Description

STL forward iterator used by all string classes. Iterates over unicode characters. The iterator starts at the first character of the string and ends at the address beyond the last character of the string.

Member Function Documentation

◆ SetCurrentPosition()

void plStringIterator::SetCurrentPosition ( const char * szCurPos)
inline

Allows to set the 'current' iteration position to a different value.

Must be between the iterators start and end range.


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