LifePlay-Revival/Source/LifePlay/LPStringCompat.cpp
edujiro5972 0d703d47a7 L4-CX-B08 : ParseIntoArray au comportement UE 4.27 (cause d'ERR-027)
LPStringCompat::ParseIntoArray (algorithme 4.27 : chaine vide -> [], separateur
sensible a la casse) ; commandlet LPFixParseIntoArray : 114 noeuds rebranches dans
17 Blueprints, 0 ecart de liaison (controle integre), 0 broche orpheline,
CompileAllBlueprints 0 erreur. LPDumpFunction : option -Exec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 23:56:16 +02:00

27 lines
759 B
C++

// Portage UE 5.5 - voir LPStringCompat.h
#include "LPStringCompat.h"
TArray<FString> ULPStringCompat::ParseIntoArray(const FString& SourceString, const FString& Delimiter, const bool CullEmptyStrings)
{
// Transcription de FString::ParseIntoArray, UE 4.27 (String.cpp, lignes 940-963).
TArray<FString> OutArray;
const TCHAR* Start = *SourceString;
const int32 DelimLength = Delimiter.Len();
if (Start && *Start != TEXT('\0') && DelimLength)
{
while (const TCHAR* At = FCString::Strstr(Start, *Delimiter))
{
if (!CullEmptyStrings || At - Start)
{
OutArray.Emplace(UE_PTRDIFF_TO_INT32(At - Start), Start);
}
Start = At + DelimLength;
}
if (!CullEmptyStrings || *Start)
{
OutArray.Emplace(Start);
}
}
return OutArray;
}