// Returns the actual object name.
UFUNCTION(BlueprintPure, Category = "Utilities")
static FString GetObjectName(const UObject* Object);
// Returns the full path to the specified object.
UFUNCTION(BlueprintPure, Category="Utilities")
static FString GetPathName(const UObject* Object);
// Returns the display name (or actor label), for displaying as a debugging aid.
// Note: In editor builds, this is the actor label. In non-editor builds, this is the actual object name. This function should not be used to uniquely identify actors!
// It is not localized and should not be used for display to an end user of a game.
UFUNCTION(BlueprintPure, Category="Utilities")
static FString GetDisplayName(const UObject* Object);
// Returns the display name of a class
UFUNCTION(BlueprintPure, Category = "Utilities", meta = (DisplayName = "Get Display Name"))
static FString GetClassDisplayName(UClass* Class);
// Engine build number, for displaying to end users.
UFUNCTION(BlueprintPure, Category="Development", meta=(BlueprintThreadSafe))
static FString GetEngineVersion();
/** Get the name of the current game */
UFUNCTION(BlueprintPure, Category="Game", meta=(BlueprintThreadSafe))
static FString GetGameName();
/** Get the current user name from the OS */
UFUNCTION(BlueprintPure, Category="Utilities|Platform")
static FString GetPlatformUserName();
/** Returns the platform specific unique device id */
UFUNCTION(BlueprintPure, Category="Utilities|Platform", meta = (DeprecatedFunction, DeprecationMessage = "Use GetDeviceId instead"))
static FString GetUniqueDeviceId();
/** Returns the platform specific unique device id */
UFUNCTION(BlueprintPure, Category="Utilities|Platform")
static FString GetDeviceId();
/** Returns whether the world this object is in is the host or not */
UFUNCTION(BlueprintPure, Category="Networking", meta=(WorldContext="WorldContextObject") )
static bool IsServer(const UObject* WorldContextObject);
/** Returns whether this is running on a dedicated server */
UFUNCTION(BlueprintPure, Category="Networking", meta=(WorldContext="WorldContextObject"))
static bool IsDedicatedServer(const UObject* WorldContextObject);
/** Returns whether this game instance is stand alone (no networking). */
UFUNCTION(BlueprintPure, Category="Networking", meta=(WorldContext="WorldContextObject"))
static bool IsStandalone(const UObject* WorldContextObject);
/** Returns whether we're currently running in split screen (more than one local player). */
UFUNCTION(BlueprintPure, Category = "Utilities", meta = (WorldContext = "WorldContextObject"))
static bool IsSplitScreen(const UObject* WorldContextObject);
/** Returns whether this is a build that is packaged for distribution */
UFUNCTION(BlueprintPure, Category="Development", meta=(BlueprintThreadSafe))
static bool IsPackagedForDistribution();
/**
* Get the current game time, in seconds. This stops when the game is paused and is affected by slomo.
*
* @param WorldContextObject World context
*/
UFUNCTION(BlueprintPure, Category="Utilities|Time", meta=(WorldContext="WorldContextObject") )
static float GetGameTimeInSeconds(const UObject* WorldContextObject);
/** Returns the value of GFrameCounter, a running count of the number of frames that have occurred. */
UFUNCTION(BlueprintPure, Category = "Utilities")
static int64 GetFrameCount();
// Returns the full system path to a UObject
// If given a non-asset UObject, it will return an empty string
UFUNCTION(BlueprintPure, Category = "Utilities")
static FString GetSystemPath(const UObject* Object);
/** Get the directory of the current project */
UFUNCTION(BlueprintPure, Category="Utilities|Paths", meta=(BlueprintThreadSafe))
static FString GetProjectDirectory();
/** Get the content directory of the current project */
UFUNCTION(BlueprintPure, Category="Utilities|Paths", meta=(BlueprintThreadSafe))
static FString GetProjectContentDirectory();
/** Get the saved directory of the current project */
UFUNCTION(BlueprintPure, Category="Utilities|Paths", meta=(BlueprintThreadSafe))
static FString GetProjectSavedDirectory();
/** Get the current user dir from the OS */
UFUNCTION(BlueprintPure, Category = "Utilities|Platform")
static FString GetPlatformUserDir();
路径转换
/* Converts passed in filename to use a relative path */
UFUNCTION(BlueprintPure, Category="Utilities|Paths")
static FString ConvertToRelativePath(const FString& Filename);
/* Converts passed in filename to use a absolute path */
UFUNCTION(BlueprintPure, Category="Utilities|Paths")
static FString ConvertToAbsolutePath(const FString& Filename);
/* Convert all / and \ to TEXT("/") */
UFUNCTION(BlueprintPure, Category="Utilities|Paths", meta=(BlueprintThreadSafe))
static FString NormalizeFilename(const FString& InFilename);
/**
Path helpers for retrieving game dir, engine dir, etc.
*/
class CORE_API FPaths
{
public:
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
static FString ShaderWorkingDir();
/**
/**
/*
/*
/**
/**
/**
/**
/**
/**
/**
/**
/** Returns the directory for automation save files */
static FString AutomationDir();
/** Returns the directory for automation save files that are meant to be deleted every run */
static FString AutomationTransientDir();
/** Returns the directory for results of automation tests. May be deleted every run. */
static FString AutomationReportsDir();
/** Returns the directory for automation log files */
static FString AutomationLogDir();
/** Returns the directory for local files used in cloud emulation or support */
static FString CloudDir();
/** Returns the directory that contains subfolders for developer-specific content */
static FString GameDevelopersDir();
/** Returns The folder name for the developer-specific directory for the current user */
static FString GameUserDeveloperFolderName();
/** Returns The directory that contains developer-specific content for the current user */
static FString GameUserDeveloperDir();
/** Returns the directory for temp files used for diffing */
static FString DiffDir();
/**
/**
/**
/**
/**
/**
/**
/**
/**
/** Returns the directory where engine source code files are kept */
static FString EngineSourceDir();
/** Returns the directory where game source code files are kept */
static FString GameSourceDir();
/** Returns the directory where feature packs are kept */
static FString FeaturePackDir();
/**
/**
/**
/**
// Returns the filename (with extension), minus any path information.
static FString GetCleanFilename(const FString& InPath);
// Returns the filename (with extension), minus any path information.
static FString GetCleanFilename(FString&& InPath);
// Returns the same thing as GetCleanFilename, but without the extension
static FString GetBaseFilename(const FString& InPath, bool bRemovePath=true );
// Returns the same thing as GetCleanFilename, but without the extension
static FString GetBaseFilename(FString&& InPath, bool bRemovePath = true);
// Returns the path in front of the filename
static FString GetPath(const FString& InPath);
// Returns the path in front of the filename
static FString GetPath(FString&& InPath);
// Returns the leaf in the path
static FString GetPathLeaf(const FString& InPath);
// Returns the leaf in the path
static FString GetPathLeaf(FString&& InPath);
/** Changes the extension of the given filename (does nothing if the file has no extension) */
static FString ChangeExtension(const FString& InPath, const FString& InNewExtension);
/** Sets the extension of the given filename (like ChangeExtension, but also applies the extension if the file doesn't have one) */
static FString SetExtension(const FString& InPath, const FString& InNewExtension);
/** Returns true if this file was found, false otherwise */
static bool FileExists(const FString& InPath);
/** Returns true if this directory was found, false otherwise */
static bool DirectoryExists(const FString& InPath);
/** Returns true if this path represents a root drive or volume */
static bool IsDrive(const FString& InPath);
/** Returns true if this path is relative to another path */
static bool IsRelative(const FString& InPath);
/** Convert all / and \ to TEXT("/") */
static void NormalizeFilename(FString& InPath);
/**
/** Determines if a path is under a given directory */
static bool IsUnderDirectory(const FString& InPath, const FString& InDirectory);
/** Normalize all / and \ to TEXT("/") and remove any trailing TEXT("/") if the character before that is not a TEXT("/") or a colon */
static void NormalizeDirectoryName(FString& InPath);
/**
/**
/**
static void MakeStandardFilename(FString& InPath);
/** Takes an "Unreal" pathname and converts it to a platform filename. */
static void MakePlatformFilename(FString& InPath);
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/**
/** Gets the relative path to get from BaseDir to RootDirectory */
static const FString& GetRelativePathToRoot();
template
FORCEINLINE static FString Combine(PathTypes&&… InPaths)
{
const TCHAR* Paths[] = { GetTCharPtr(Forward
FString Out;
CombineInternal(Out, Paths, UE_ARRAY_COUNT(Paths));
return Out;
}
/**
protected:
static void CombineInternal(FString& OutPath, const TCHAR** Paths, int32 NumPaths);
private:
struct FStaticData;
FORCEINLINE static const TCHAR* GetTCharPtr(const TCHAR* Ptr)
{
return Ptr;
}
FORCEINLINE static const TCHAR* GetTCharPtr(const FString& Str)
{
return *Str;
}
/** Returns, if any, the value of the -userdir command line argument. This can be used to sandbox artifacts to a desired location */
static const FString& CustomUserDirArgument();
/** Returns, if any, the value of the -shaderworkingdir command line argument. This can be used to sandbox shader working files to a desired location */
static const FString& CustomShaderDirArgument();
};
手机扫一扫
移动阅读更方便
你可能感兴趣的文章