Work on blueprint components in MCP

This commit is contained in:
2026-03-19 15:53:25 -04:00
parent 2e4606c9e4
commit 56f2257dd9
15 changed files with 385 additions and 202 deletions

View File

@@ -46,16 +46,11 @@
// ============================================================
// Name sanitization
//
// Our parsers reserve certain punctuation marks for parsing
// types, paths, and the like. For example: Array<Int>.
// We therefore cannot allow those specific punctuation marks
// in names. We replace them with similar-looking unicode
// characters.
// ============================================================
void WingUtils::SanitizeNameInPlace(FString &Name)
FString WingUtils::SanitizeName(const FString &InName)
{
FString Name = InName;
int32 Dst = 0;
for (int32 Src = 0; Src < Name.Len(); Src++)
{
@@ -64,25 +59,32 @@ void WingUtils::SanitizeNameInPlace(FString &Name)
if (c == ' ') c=L'·';
if (c == '<') c=L'';
if (c == '>') c=L'';
if (c == ',') c=L'·';
if (c == ',') c=L'';
Name[Dst++] = c;
}
if (Dst == 0) Name[Dst++] = L'·';
Name.LeftInline(Dst);
return Name;
}
FString WingUtils::SanitizeName(const FString &Name)
FString WingUtils::UnsanitizeName(const FString &InName)
{
FString Result = Name;
SanitizeNameInPlace(Result);
return Result;
FString Name = InName;
for (int32 i = 0; i < Name.Len(); i++)
{
TCHAR c = Name[i];
if (c == L'·') c=' ';
if (c == L'') c='<';
if (c == L'') c='>';
if (c == L'') c=',';
Name[i] = c;
}
return Name;
}
FString WingUtils::SanitizeName(FName Name)
{
FString Result = Name.ToString();
SanitizeNameInPlace(Result);
return Result;
return SanitizeName(Name.ToString());
}
// ============================================================