Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::StringIteratorASCII Struct Reference

A string iterator for ASCII strings. More...

#include <StringIterator.h>

Inheritance diagram for SC::StringIteratorASCII:
SC::StringIterator< StringIteratorASCII >

Public Member Functions

constexpr bool advanceUntilMatches (CodePoint c)
 
- Public Member Functions inherited from SC::StringIterator< StringIteratorASCII >
constexpr void setToStart ()
 Rewind current position to start of iterator range. More...
 
constexpr void setToEnd ()
 Set current position to end of iterator range. More...
 
constexpr bool isAtEnd () const
 Check if current position is at end of iterator range. More...
 
constexpr bool isAtStart () const
 Check if current position is at start of iterator range. More...
 
constexpr bool advanceUntilMatches (CodePoint c)
 Advances position towards end until it matches CodePoint c or position == end More...
 
bool reverseAdvanceUntilMatches (CodePoint c)
 Moves position towards start until CodePoint c is found or position == end More...
 
bool advanceAfterFinding (StringIterator other)
 Advances position towards end until a matching range of character equal to other[it, end) is found. More...
 
bool advanceBeforeFinding (StringIterator other)
 Advances position towards end until a matching range of character equal to other[it, end) is found. More...
 
bool advanceByLengthOf (StringIterator other)
 Advances position by the same number of code points as other. More...
 
bool advanceUntilMatchesAny (Span< const CodePoint > items, CodePoint &matched)
 Advances position until any CodePoint in the given Span is found. More...
 
bool reverseAdvanceUntilMatchesAny (Span< const CodePoint > items, CodePoint &matched)
 Moves position towards start until any CodePoint in the given Span is found. More...
 
bool advanceUntilDifferentFrom (CodePoint c, CodePoint *optionalReadChar=nullptr)
 Advances position until a code point different from c is found or end is reached. More...
 
constexpr bool advanceIfMatches (CodePoint c)
 Advance position only if next code point matches c. More...
 
bool advanceBackwardIfMatches (CodePoint c)
 Move position by one code point towards start if previous code point matches c More...
 
bool advanceIfMatchesAny (Span< const CodePoint > items)
 Advance position only if any of the code points in given Span is matched. More...
 
bool advanceIfMatchesRange (CodePoint first, CodePoint last)
 Advance position if any code point in the range [first, last] is matched. More...
 
bool match (CodePoint c)
 Check if code unit at current position matches CodePoint c More...
 
constexpr bool advanceRead (CodePoint &c)
 Decode code unit at current position and advance. More...
 
bool read (CodePoint &c)
 Read code unit at current position. More...
 
bool advanceBackwardRead (CodePoint &c)
 Move to previous position and read code unit. More...
 
constexpr bool stepForward ()
 Move position to next code point. More...
 
constexpr bool stepBackward ()
 Move position to previous code point. More...
 
constexpr bool advanceCodePoints (size_t numCodePoints)
 Move position forward (towards end) by variable number of code points. More...
 
bool reverseAdvanceCodePoints (size_t numCodePoints)
 Move position backwards (towards start) by variable number of code pints. More...
 
constexpr bool isFollowedBy (CodePoint c)
 Check if next code point is c More...
 
constexpr bool isPrecededBy (CodePoint c)
 Check if previous code point is c More...
 
constexpr StringIterator sliceFromStartUntil (StringIterator otherPoint) const
 Returns another StringIterator range, starting from start to otherPoint position. More...
 
constexpr ssize_t bytesDistanceFrom (StringIterator other) const
 Get distance in bytes from current position to another StringIterator current position. More...
 
bool endsWithAnyOf (Span< const CodePoint > codePoints) const
 Check if this Iterator ends with any code point in the given span. More...
 
bool startsWithAnyOf (Span< const CodePoint > codePoints) const
 Check if this Iterator starts with any code point in the given span. More...
 
bool endsWith (IteratorType other) const
 Check if this Iterator at its end matches entirely another Iterator's range. More...
 
bool startsWith (IteratorType other) const
 Check if this Iterator at its start matches entirely another Iterator's range. More...
 

Friends

struct StringView
 

Additional Inherited Members

- Public Types inherited from SC::StringIterator< StringIteratorASCII >
using CodeUnit = char
 
using CodePoint = StringCodePoint
 
- Static Public Member Functions inherited from SC::StringIterator< StringIteratorASCII >
static constexpr StringEncoding getEncoding ()
 
- Protected Member Functions inherited from SC::StringIterator< StringIteratorASCII >
bool advanceOfBytes (ssize_t bytesLength)
 
constexpr StringIterator (const CodeUnit *it, const CodeUnit *end)
 
constexpr auto * getCurrentIt () const
 
- Static Protected Member Functions inherited from SC::StringIterator< StringIteratorASCII >
static constexpr const CodeUnit * getNextOf (const CodeUnit *src)
 
static constexpr const CodeUnit * getPreviousOf (const CodeUnit *src)
 
- Protected Attributes inherited from SC::StringIterator< StringIteratorASCII >
const CodeUnit * it
 
const CodeUnit * start
 
const CodeUnit * end
 

Detailed Description

A string iterator for ASCII strings.


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