Class IZagalaSpecRegexRegistry#

Inheritance Relationships#

Derived Type#

Class Documentation#

class IZagalaSpecRegexRegistry#

Interface for registry objects that manage IZagalaSpecRegexIdentity implementors.

Concrete subclasses (e.g. UZagalaSpecDefaultRegexRegistry) store the soft path of each registered entry keyed by its regex pattern and match incoming plain text against those patterns. The first entry registered for a pattern wins; later entries for the same pattern are rejected.

Subclassed by UZagalaSpecDefaultRegexRegistry

Public Functions

virtual bool Register(UObject *RegexIdentityObject) = 0#

Registers a UObject that implements IZagalaSpecRegexIdentity with this registry.

The object’s regex pattern (from GetRegexPattern()) is stored as the key.

Parameters:

RegexIdentityObject – The object to register. Must implement IZagalaSpecRegexIdentity.

Returns:

true if the pattern was newly registered, false otherwise.

virtual bool RegisterRecord(const FString &Pattern, const FSoftObjectPath &Entry) = 0#

Registers a pattern for an entry by soft path, without loading the entry.

Registering the same pattern for the same entry again is a no-op that returns true. A pattern already owned by another entry is kept as is, a warning is logged and false is returned.

Parameters:
  • Pattern – The regex pattern.

  • Entry – The soft path of the entry that owns the pattern.

Returns:

true if the pattern is mapped to Entry after the call.

virtual FZagalaSpecRegexMatch FindMatch(const FString &RegexString) = 0#

Searches registered patterns for one that matches the given string.

Parameters:

RegexString – The plain text to test against all registered patterns.

Returns:

The matched pattern and entry path, or an invalid match if none match.

virtual bool Unregister(const FString &Pattern) = 0#

Removes the entry keyed by the given regex pattern from this registry.

Parameters:

Pattern – The exact regex pattern string that was used during registration.

Returns:

true if the pattern was found and removed, false if it was not registered.

virtual int32 UnregisterBatch(const TArray<FString> &Patterns) = 0#

Forwards each element of Patterns to Unregister(); returns the count of patterns actually removed.

Parameters:

Patterns – The regex patterns to unregister.

Returns:

The number of patterns that were removed.

virtual int32 UnregisterEntry(const FSoftObjectPath &Entry) = 0#

Removes every pattern owned by the given entry from this registry.

Parameters:

Entry – The soft path of the entry to remove.

Returns:

The number of patterns that were removed from the registry.

virtual void Clear() = 0#

Removes all registered entries from this registry.

virtual const TMap<FString, FSoftObjectPath> &GetRegisteredEntries() const = 0#

Returns a read-only view of all registered pattern-to-entry mappings.

Used by UZagalaSpecFeatureSettings to snapshot the registry contents into the editor-visible cache.

Returns:

Immutable reference to the internal pattern-to-entry map.