RealDocs

FName::IsValidGroupName

function Core Since 4.0
#include "UObject/NameTypes.h"
Access: public Specifiers: const

Description

Validates that this FName is legal for use as a package or group name. Package names permit forward-slashes as path separators; group names do not.

Caveats & Gotchas

  • Despite the method name, the default (bIsGroupName=false) checks package name legality — not group legality. Pass true explicitly when validating group names to avoid checking the wrong rule set.
  • This method validates string content only; it does not verify that the corresponding package actually exists on disk or in the asset registry.

Signature

CORE_API bool IsValidGroupName( FText& OutReason, bool bIsGroupName=false ) const;

Parameters

Name Type Description Default
OutReason FText& If the check fails, receives a localised explanation of why the name is illegal.
bIsGroupName bool When true, validates against group name rules; when false, validates against package name rules. false

Return Type

bool

Example

Validate a package path before saving C++
FName ProposedPackage(TEXT("/Game/MyContent/NewAsset"));
FText ErrorMsg;
if (!ProposedPackage.IsValidGroupName(ErrorMsg, /*bIsGroupName=*/false))
{
    UE_LOG(LogTemp, Error, TEXT("Bad package name: %s"), *ErrorMsg.ToString());
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.