UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TTokenStream< CharType > Class Template Reference

#include <ExpressionParserTypes.h>

Public Member Functions

CORE_API TOptional< TStringToken< CharType > > ParseToken (TFunctionRef< EParseState(CharType)> Pred, TStringToken< CharType > *Accumulate=nullptr) const
 
CORE_API TOptional< TStringToken< CharType > > ParseToken (const CharType *Symbol, TStringToken< CharType > *Accumulate=nullptr) const
 
CORE_API TOptional< TStringToken< CharType > > ParseTokenIgnoreCase (const CharType *Symbol, TStringToken< CharType > *Accumulate=nullptr) const
 
CORE_API TOptional< TStringToken< CharType > > ParseSymbol (TStringToken< CharType > *Accumulate=nullptr) const
 
CORE_API TOptional< TStringToken< CharType > > ParseSymbol (CharType Symbol, TStringToken< CharType > *Accumulate=nullptr) const
 
CORE_API TOptional< TStringToken< CharType > > ParseWhitespace (TStringToken< CharType > *Accumulate=nullptr) const
 
CORE_API TOptional< TStringToken< CharType > > GenerateToken (int32 NumChars, TStringToken< CharType > *Accumulate=nullptr) const
 
CORE_API TTokenStream (const CharType *In)
 
CORE_API CharType PeekChar (int32 Offset=0) const
 
CORE_API int32 CharsRemaining () const
 
CORE_API bool IsReadPosValid (const CharType *InPos, int32 MinNumChars=1) const
 
CORE_API bool IsEmpty () const
 
CORE_API int32 GetPosition () const
 
const CharType * GetStart () const
 
const CharType * GetRead () const
 
const CharType * GetEnd () const
 
CORE_API FString GetErrorContext () const
 
CORE_API void SetReadPos (const TStringToken< CharType > &Token)
 

Detailed Description

template<typename CharType>
class TTokenStream< CharType >

A token stream wraps up a raw string, providing accessors into it for consuming tokens

Constructor & Destructor Documentation

◆ TTokenStream()

template<typename CharType >
TTokenStream< CharType >::TTokenStream ( const CharType *  In)
explicit

Constructor. The stream is only valid for the lifetime of the string provided

Member Function Documentation

◆ CharsRemaining()

template<typename CharType >
int32 TTokenStream< CharType >::CharsRemaining ( ) const

Get the number of characters remaining in the stream after the current read position

◆ GenerateToken()

template<typename CharType >
TOptional< TStringToken< CharType > > TTokenStream< CharType >::GenerateToken ( int32  NumChars,
TStringToken< CharType > *  Accumulate = nullptr 
) const

Generate a token for the specified number of chars, at the current read position (or end of Accumulate)

◆ GetEnd()

template<typename CharType >
const CharType * TTokenStream< CharType >::GetEnd ( ) const
inline

◆ GetErrorContext()

template<typename CharType >
FString TTokenStream< CharType >::GetErrorContext ( ) const

Get the error context from the current read position

◆ GetPosition()

template<typename CharType >
int32 TTokenStream< CharType >::GetPosition ( ) const

Get the current read position from the start of the stream

◆ GetRead()

template<typename CharType >
const CharType * TTokenStream< CharType >::GetRead ( ) const
inline

◆ GetStart()

template<typename CharType >
const CharType * TTokenStream< CharType >::GetStart ( ) const
inline

◆ IsEmpty()

template<typename CharType >
bool TTokenStream< CharType >::IsEmpty ( ) const

Check if the stream is empty

◆ IsReadPosValid()

template<typename CharType >
bool TTokenStream< CharType >::IsReadPosValid ( const CharType *  InPos,
int32  MinNumChars = 1 
) const

Check if it is valid to read (the optional number of characters) from the specified position

◆ ParseSymbol() [1/2]

template<typename CharType >
TOptional< TStringToken< CharType > > TTokenStream< CharType >::ParseSymbol ( CharType  Symbol,
TStringToken< CharType > *  Accumulate = nullptr 
) const

Attempt parse out the specified pre-defined string from the current read position (or accumulating into the specified existing token)

◆ ParseSymbol() [2/2]

template<typename CharType >
TOptional< TStringToken< CharType > > TTokenStream< CharType >::ParseSymbol ( TStringToken< CharType > *  Accumulate = nullptr) const

Return a string token for the next character in the stream (or accumulating into the specified existing token)

◆ ParseToken() [1/2]

template<typename CharType >
TOptional< TStringToken< CharType > > TTokenStream< CharType >::ParseToken ( const CharType *  Symbol,
TStringToken< CharType > *  Accumulate = nullptr 
) const

Attempt parse out the specified pre-defined string from the current read position (or accumulating into the specified existing token)

◆ ParseToken() [2/2]

template<typename CharType >
TOptional< TStringToken< CharType > > TTokenStream< CharType >::ParseToken ( TFunctionRef< EParseState(CharType)>  Pred,
TStringToken< CharType > *  Accumulate = nullptr 
) const

Parse out a token using the supplied predicate. Will keep consuming characters into the resulting token provided the predicate returns EParseState::Continue or EParseState::StopAfter. Optionally supply a token to accumulate into Returns a string token for the stream, or empty on error

Parse out a token

◆ ParseTokenIgnoreCase()

template<typename CharType >
TOptional< TStringToken< CharType > > TTokenStream< CharType >::ParseTokenIgnoreCase ( const CharType *  Symbol,
TStringToken< CharType > *  Accumulate = nullptr 
) const

◆ ParseWhitespace()

template<typename CharType >
TOptional< TStringToken< CharType > > TTokenStream< CharType >::ParseWhitespace ( TStringToken< CharType > *  Accumulate = nullptr) const

Parse a whitespace token

◆ PeekChar()

template<typename CharType >
CharType TTokenStream< CharType >::PeekChar ( int32  Offset = 0) const

Peek at the character at the specified offset from the current read position

◆ SetReadPos()

template<typename CharType >
void TTokenStream< CharType >::SetReadPos ( const TStringToken< CharType > &  Token)

Set the current read position to the character proceeding the specified token


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