Class UZagalaSpecCaptureGroupCustomizer#

Inheritance Relationships#

Base Type#

  • public UObject

Class Documentation#

class UZagalaSpecCaptureGroupCustomizer : public UObject#

Manages the mapping between regex capture groups and typed UObjects.

After a pattern to text match, UZagalaSpecCaptureGroupCustomizer::FillPatternData() gets called to:

  1. Store the matched text in StepText.

  2. Store the pattern in StepPattern.

  3. Extract each capture group value from the matched text.

  4. Sync the CaptureGroups array — preserving existing user configuration where possible.

At setup time, callers retrieve the tagged data using StoreDataIntoCache().

Public Functions

UZagalaSpecCaptureGroupCustomizer(const FObjectInitializer &ObjectInitializer = FObjectInitializer::Get())#
const FString &GetStepPattern() const#

The regex pattern that matched the last StepText.

const FString &GetStepText() const#

The input text that produced the last match.

const TArray<TObjectPtr<UZagalaSpecCaptureGroupData>> &GetCaptureGroups() const#

One entry per capture group in StepPattern.

UZagalaSpecCaptureGroupData *GetCaptureGroup(const int32 Index) const#

Returns the capture group at Index, or nullptr when Index is out of range.

void FillPatternData(const FString &MatchedText, FString MatchedPattern)#

Resolves the matched pattern from MatchedPattern, stores it in StepPattern, extracts all capture group values from MatchedText, and syncs the CaptureGroups array accordingly.

Existing entries whose GroupValueClass is already set are preserved; new slots are created as fresh UZagalaSpecCaptureGroupData objects.

Parameters:
  • MatchedText – The plain text that produced the match.

  • MatchedPattern – The regex pattern that matched the text.

void CopyCaptureGroupValuesFrom(const UZagalaSpecCaptureGroupCustomizer *Other)#

Copies the capture group values of Other into the matching non-null entries of this customizer.

Only the overlapping range of entries is copied; StepPattern and StepText are left untouched.

void StoreDataIntoCache(const TScriptInterface<IZagalaSpecTaggedDataCacher> &Cacher)#

Converts every capture group and stores the resulting tagged data into Cacher.

For each non-null CaptureGroupData whose ConverterClass implements IZagalaSpecCaptureGroupConverter: takes a snapshot, instantiates the converter with Cacher’s UObject as the outer, converts, and stores the result via SetTaggedData when the conversion returns non-null. Groups with a null or non-conforming ConverterClass are skipped silently.

Parameters:

Cacher – Destination cache that receives the converted tagged data entries.

virtual EDataValidationResult IsDataValid(class FDataValidationContext &Context) const override#

Fails when StepPattern or StepText is empty, or any capture group is null or invalid.

No capture groups is valid.

Protected Functions

TArray<FString> ExtractCaptureGroups(const FString &InputText)#

Extracts all capture group values from InputText based on the current StepPattern.

The first group does not correspond to the regex full match but the first capture group.

Parameters:

InputText – The text to match against StepPattern.

Returns:

The capture group values in order, or an empty array when there is no match.

virtual void InternalFillCaptureGroups(const FString &InputText, const TArray<FString> &ExtractedGroups)#

Resizes CaptureGroups to match the extracted groups and assigns their values.

Parameters:
  • InputText – The text that produced the match.

  • ExtractedGroups – The capture group values extracted from InputText.

template<typename GroupDataType>
void ResizeCaptureGroups(const int32 &NewCount)#

Grows CaptureGroups with new GroupDataType objects or shrinks it to NewCount entries.

Parameters:

NewCount – The target number of capture group entries.

void FillCaptureGroupDataValues(const TArray<FString> &ExtractedGroups)#

Assigns each extracted value to the matching non-null CaptureGroups entry.

Parameters:

ExtractedGroups – The capture group values, one per CaptureGroups entry.

void UpdateHasFilledCaptureGroups()#

Sets bHasFilledCaptureGroups to true when CaptureGroups is not empty.

Protected Attributes

FString StepPattern#

The regex pattern that matched the last StepText.

Set by FillPatternData().

FString StepText#

The input text that produced the last match.

Set by FillPatternData().

TArray<TObjectPtr<UZagalaSpecCaptureGroupData>> CaptureGroups#

One entry per capture group in StepPattern.

Populated by FillPatternData().

bool bHasFilledCaptureGroups#

True when CaptureGroups is not empty.