UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FParse Struct Reference

#include <Parse.h>

Classes

struct  FGrammarBasedParseResult
 

Public Types

enum class  ELineExtendedFlags : uint8 {
  None = 0 , SwallowDoubleSlashComments = 1 , SwallowSemicolonComments = 2 , SwallowExtraEOLs = 4 ,
  BreakOnPipe = 8 , AllowBracketedMultiline = 16 , AllowEscapedEOLMultiline = 32 , Standard = AllowEscapedEOLMultiline ,
  OldDefaultMode = SwallowDoubleSlashComments | BreakOnPipe | AllowBracketedMultiline | AllowEscapedEOLMultiline | SwallowExtraEOLs , OldExactMode = AllowBracketedMultiline | AllowEscapedEOLMultiline
}
 
enum class  EGrammarBasedParseFlags { None = 0u , AllowQuotedCommands = 1 << 0u }
 
enum class  EGrammarBasedParseErrorCode { Succeeded , NotRun , UnBalancedQuote , DisallowedQuotedCommand }
 

Static Public Member Functions

static CORE_API bool Command (const TCHAR **Stream, const TCHAR *Match, bool bParseMightTriggerExecution=true)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, FName &Name)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, uint32 &Value)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, struct FGuid &Guid)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, TCHAR *Value, int32 MaxLen, bool bShouldStopOnSeparator=true, const TCHAR **OptStreamGotTo=nullptr)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, uint8 &Value)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, int8 &Value)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, uint16 &Value)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, int16 &Value)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, float &Value)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, double &Value)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, int32 &Value)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, FString &Value, bool bShouldStopOnSeparator=true, const TCHAR **OptStreamGotTo=nullptr)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, FText &Value, const TCHAR *Namespace=NULL)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, uint64 &Value)
 
static CORE_API bool Value (const TCHAR *Stream, const TCHAR *Match, int64 &Value)
 
static CORE_API bool Bool (const TCHAR *Stream, const TCHAR *Match, bool &OnOff)
 
static CORE_API bool Line (const TCHAR **Stream, TCHAR *Result, int32 MaxLen, bool Exact=false)
 
static CORE_API bool Line (const TCHAR **Stream, FString &Result, bool Exact=false)
 
static CORE_API bool Line (const TCHAR **Stream, FStringView &Result, bool Exact=false)
 
static CORE_API bool LineExtended (const TCHAR **Stream, FString &Result, int32 &LinesConsumed, ELineExtendedFlags Flags=ELineExtendedFlags::Standard)
 
static CORE_API bool LineExtended (const TCHAR **Stream, FStringBuilderBase &Result, int32 &LinesConsumed, ELineExtendedFlags Flags=ELineExtendedFlags::Standard)
 
static bool LineExtended (const TCHAR **Stream, FString &Result, int32 &LinesConsumed, bool bExact)
 
static bool LineExtended (const TCHAR **Stream, FStringBuilderBase &Result, int32 &LinesConsumed, bool bExact)
 
static CORE_API bool Token (const TCHAR *&Str, TCHAR *Result, int32 MaxLen, bool bUseEscape, const TCHAR SingleCharacterDelimiter=TEXT('\0'))
 
static CORE_API bool Token (const TCHAR *&Str, FString &Arg, bool bUseEscape, const TCHAR SingleCharacterDelimiter=TEXT('\0'))
 
static CORE_API bool AlnumToken (const TCHAR *&Str, FString &Arg)
 
static CORE_API FString Token (const TCHAR *&Str, bool UseEscape)
 
static CORE_API void Next (const TCHAR **Stream)
 
static CORE_API bool Param (const TCHAR *Stream, const TCHAR *Param)
 
static CORE_API bool Text (const TCHAR *Stream, FText &Value, const TCHAR *Namespace=nullptr)
 
static CORE_API bool QuotedString (const TCHAR *Stream, FString &Value, int32 *OutNumCharsRead=nullptr)
 
static CORE_API bool QuotedString (const TCHAR *Stream, FStringBuilderBase &Value, int32 *OutNumCharsRead=nullptr)
 
static CORE_API bool Expression (const TCHAR *&Str, FString &OutExpression, bool bUseEscape, const TCHAR SingleCharacterDelimiter=TEXT('\0'))
 
static int32 HexDigit (TCHAR c)
 
static CORE_API uint32 HexNumber (FStringView HexString)
 
static CORE_API uint64 HexNumber64 (FStringView HexString)
 
static CORE_API bool SchemeNameFromURI (const TCHAR *InURI, FString &OutSchemeName)
 
static CORE_API FGrammarBasedParseResult GrammarBasedCLIParse (const TCHAR *Stream, TFunctionRef< void(FStringView, FStringView)> OnCommandCallback, EGrammarBasedParseFlags Flags=EGrammarBasedParseFlags::AllowQuotedCommands)
 

Member Enumeration Documentation

◆ EGrammarBasedParseErrorCode

Enumerator
Succeeded 
NotRun 
UnBalancedQuote 
DisallowedQuotedCommand 

◆ EGrammarBasedParseFlags

Enumerator
None 
AllowQuotedCommands 

◆ ELineExtendedFlags

Get a line of Stream, with support for extending beyond that line with certain characters, e.g. {} and \ the out character array will not include the ignored endlines

Enumerator
None 
SwallowDoubleSlashComments 
SwallowSemicolonComments 
SwallowExtraEOLs 
BreakOnPipe 
AllowBracketedMultiline 
AllowEscapedEOLMultiline 
Standard 
OldDefaultMode 
OldExactMode 

Member Function Documentation

◆ AlnumToken()

bool FParse::AlnumToken ( const TCHAR *&  Str,
FString &  Arg 
)
static

Grabs the next alpha-numeric space-delimited token from the input stream.

◆ Bool()

bool FParse::Bool ( const TCHAR Stream,
const TCHAR Match,
bool OnOff 
)
static

Parses a boolean value.

◆ Command()

bool FParse::Command ( const TCHAR **  Stream,
const TCHAR Match,
bool  bParseMightTriggerExecution = true 
)
static

Sees if Stream starts with the named command. If it does, skips through the command and blanks past it. Returns true of match.

Parameters
bParseMightTriggerExecutiontrue: Caller guarantees this is only part of parsing and no execution happens without further parsing (good for "DumpConsoleCommands").

◆ Expression()

bool FParse::Expression ( const TCHAR *&  Str,
FString &  OutExpression,
bool  bUseEscape,
const TCHAR  SingleCharacterDelimiter = TEXT('\0') 
)
static

Parse the next space-delimited (or SingleCharacterDelmiter-delimited) expression, using brackets (), {}, or [] to allow subexpressions to be part of the single expression even if they contain the delimiter. The parsed expression can be either an atomic token such as "Value1" in the stream "Value1 Value2 Value3" or a bracketed expression such as "(Value1.1 Value1.2)" in the stream "(Value1.1 Value1.2) Value2 Value3". If quotes are encountered, text inside of the quotes is not interpreted (brackets and delimiters are ignored) and it is included verbatim in the parsed expression. Trailing delimiters are not consumed, only leading delimiters.

◆ GrammarBasedCLIParse()

FParse::FGrammarBasedParseResult FParse::GrammarBasedCLIParse ( const TCHAR Stream,
TFunctionRef< void(FStringView, FStringView)>  OnCommandCallback,
EGrammarBasedParseFlags  Flags = EGrammarBasedParseFlags::AllowQuotedCommands 
)
static

Grammar Line -> Cmd* Cmd -> "Cmd*" – allowed if EGrammaredParseFlags::AllowQuotedCommands is given | Key(=Value)? – invokes OnCommandCallback Key -> (/|(-?-?))Ident Value -> "[^"]*" | [^" \t\r
]+ Ident -> [_a-zA-Z][_a-zA-Z0-9.]*

Grammar Key Expressions

Operators

  • = 0 or more of a expression
  • = 1 or more of a expression ? = 0 or 1 of an expression (IE, its optional) [] = set of characters () = treat enclosed expressions as 1 for purpose of other operators

◆ HexDigit()

static int32 FParse::HexDigit ( TCHAR  c)
inlinestatic

◆ HexNumber()

uint32 FParse::HexNumber ( FStringView  HexString)
static

Parses a hexadecimal string value.

◆ HexNumber64()

uint64 FParse::HexNumber64 ( FStringView  HexString)
static

◆ Line() [1/3]

bool FParse::Line ( const TCHAR **  Stream,
FString &  Result,
bool  Exact = false 
)
static

Get a line of Stream (everything up to, but not including, CR/LF. Returns 0 if ok, nonzero if at end of stream and returned 0-length string.

◆ Line() [2/3]

bool FParse::Line ( const TCHAR **  Stream,
FStringView Result,
bool  Exact = false 
)
static

Get a line of Stream (everything up to, but not including, CR/LF. Returns 0 if ok, nonzero if at end of stream and returned 0-length string.

◆ Line() [3/3]

bool FParse::Line ( const TCHAR **  Stream,
TCHAR Result,
int32  MaxLen,
bool  Exact = false 
)
static

Get a line of Stream (everything up to, but not including, CR/LF. Returns 0 if ok, nonzero if at end of stream and returned 0-length string.

◆ LineExtended() [1/4]

static bool FParse::LineExtended ( const TCHAR **  Stream,
FString &  Result,
int32 LinesConsumed,
bool  bExact 
)
inlinestatic

◆ LineExtended() [2/4]

bool FParse::LineExtended ( const TCHAR **  Stream,
FString &  Result,
int32 LinesConsumed,
ELineExtendedFlags  Flags = ELineExtendedFlags::Standard 
)
static

◆ LineExtended() [3/4]

static bool FParse::LineExtended ( const TCHAR **  Stream,
FStringBuilderBase Result,
int32 LinesConsumed,
bool  bExact 
)
inlinestatic

◆ LineExtended() [4/4]

bool FParse::LineExtended ( const TCHAR **  Stream,
FStringBuilderBase Result,
int32 LinesConsumed,
ELineExtendedFlags  Flags = ELineExtendedFlags::Standard 
)
static

◆ Next()

void FParse::Next ( const TCHAR **  Stream)
static

Get next command. Skips past comments and cr's.

◆ Param()

bool FParse::Param ( const TCHAR Stream,
const TCHAR Param 
)
static

Checks if a command-line parameter exists in the stream.

◆ QuotedString() [1/2]

bool FParse::QuotedString ( const TCHAR Stream,
FString &  Value,
int32 OutNumCharsRead = nullptr 
)
static

Parse a quoted string token.

◆ QuotedString() [2/2]

bool FParse::QuotedString ( const TCHAR Stream,
FStringBuilderBase Value,
int32 OutNumCharsRead = nullptr 
)
static

◆ SchemeNameFromURI()

bool FParse::SchemeNameFromURI ( const TCHAR InURI,
FString &  OutSchemeName 
)
static

Parses the scheme name from a URI

◆ Text()

bool FParse::Text ( const TCHAR Stream,
FText Value,
const TCHAR Namespace = nullptr 
)
static

Parse an Text token.

◆ Token() [1/3]

FString FParse::Token ( const TCHAR *&  Str,
bool  UseEscape 
)
static

Grabs the next space-delimited string from the input stream. If quoted, gets entire quoted string.

◆ Token() [2/3]

bool FParse::Token ( const TCHAR *&  Str,
FString &  Arg,
bool  bUseEscape,
const TCHAR  SingleCharacterDelimiter = TEXT('\0') 
)
static

Grabs the next space-delimited (unless SingleCharacterDelimiter is provided) string from the input stream. If quoted, gets entire quoted string.

◆ Token() [3/3]

bool FParse::Token ( const TCHAR *&  Str,
TCHAR Result,
int32  MaxLen,
bool  bUseEscape,
const TCHAR  SingleCharacterDelimiter = TEXT('\0') 
)
static

Grabs the next space-delimited (unless SingleCharacterDelimiter is provided) string from the input stream. If quoted, gets entire quoted string.

◆ Value() [1/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
double Value 
)
static

Parses a double precision floating-point value.

◆ Value() [2/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
float Value 
)
static

Parses a floating-point value.

◆ Value() [3/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
FName Name 
)
static

Parses a name.

◆ Value() [4/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
FString &  Value,
bool  bShouldStopOnSeparator = true,
const TCHAR **  OptStreamGotTo = nullptr 
)
static

Parses a string.

Parameters
Stream,thestring you want to extract the value from.
Match,theidentifier for the value in the stream.
Value,thedestination to the value to be extracted to.
bShouldStopOnSeparator,(default= true) If this is true, and the value doesn't start with a '"' then it may be truncated to ',' or ')' in addition to whitespace.
OptStreamGotTo,(default= nullptr) If this is not null, then its dereference is set to the address of the end of the value within Stream. This permits consuming of stream in a loop where Match may occur multiple times.

◆ Value() [5/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
FText Value,
const TCHAR Namespace = NULL 
)
static

Parses an FText.

◆ Value() [6/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
int16 Value 
)
static

Parses a signed word.

◆ Value() [7/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
int32 Value 
)
static

Parses a signed double word.

◆ Value() [8/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
int64 Value 
)
static

Parses a signed quadword.

◆ Value() [9/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
int8 Value 
)
static

Parses a signed byte.

◆ Value() [10/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
struct FGuid Guid 
)
static

Parses a globally unique identifier.

◆ Value() [11/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
TCHAR Value,
int32  MaxLen,
bool  bShouldStopOnSeparator = true,
const TCHAR **  OptStreamGotTo = nullptr 
)
static

Parses a string from a text string.

Parameters
Stream,thestring you want to extract the value from.
Match,theidentifier for the value in the stream.
Value,thedestination to the value to be extracted to.
MaxLen,themaximum size eof the string that can be extracted.
bShouldStopOnSeparator,(default= true) If this is true, and the value doesn't start with a '"' then it may be truncated to ',' or ')' in addition to whitespace.
OptStreamGotTo,(default= nullptr) If this is not null, then its dereference is set to the address of the end of the value within Stream. This permits consuming of stream in a loop where Match may occur multiple times.

◆ Value() [12/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
uint16 Value 
)
static

Parses a uint16.

◆ Value() [13/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
uint32 Value 
)
static

Parses a uint32.

◆ Value() [14/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
uint64 Value 
)
static

Parses a quadword.

◆ Value() [15/15]

bool FParse::Value ( const TCHAR Stream,
const TCHAR Match,
uint8 Value 
)
static

Parses a byte.


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