You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb Patrick.Boutot, aditya.ravichandran #jira none #ushell-cherrypick of 30885232 by kristof.morva1 [CL 30939858 by ben hoffman in ue5-main branch]
36 lines
870 B
C++
36 lines
870 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ConsoleSettings.h"
|
|
|
|
TArray<FString> UConsoleSettings::GetFilteredManualAutoCompleteCommands(FStringView Substring) const
|
|
{
|
|
// We reserve some arbitrary size here, we could use more complex heuristics later on
|
|
TArray<FString> Commands;
|
|
Commands.Reserve(Substring.IsEmpty() ? ManualAutoCompleteList.Num() : 20);
|
|
|
|
// We convert to FString because there's no ParseIntoArrayWS just yet that's compatible with String Views
|
|
TArray<FString> Tokens;
|
|
FString(Substring).ParseIntoArrayWS(Tokens);
|
|
|
|
for (const FAutoCompleteCommand& Command : ManualAutoCompleteList)
|
|
{
|
|
bool bAllMatch = true;
|
|
|
|
for (const FString& Token : Tokens)
|
|
{
|
|
if (!Command.Command.Contains(Token))
|
|
{
|
|
bAllMatch = false;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (bAllMatch)
|
|
{
|
|
Commands.Add(Command.Command);
|
|
}
|
|
}
|
|
|
|
return Commands;
|
|
}
|