【UE4 C++】简单获取名称、状态、时间、帧数、路径与FPaths
基于UKismetSystemLibrary
获取各类名称
// 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);
FPaths —— 更全的路径
/**
* Path helpers for retrieving game dir, engine dir, etc.
*/
class CORE_API FPaths
{
public:
/**
* Should the "saved" directory structures be rooted in the user dir or relative to the "engine/game"
*/
static bool ShouldSaveToUserDir();
/**
* Returns the directory the application was launched from (useful for commandline utilities)
*/
static FString LaunchDir();
/**
* Returns the base directory of the "core" engine that can be shared across
* several games or across games & mods. Shaders and base localization files
* e.g. reside in the engine directory.
*
* @return engine directory
*/
static FString EngineDir();
/**
* Returns the root directory for user-specific engine files. Always writable.
*
* @return root user directory
*/
static FString EngineUserDir();
/**
* Returns the root directory for user-specific engine files which can be shared between versions. Always writable.
*
* @return root user directory
*/
static FString EngineVersionAgnosticUserDir();
/**
* Returns the content directory of the "core" engine that can be shared across
* several games or across games & mods.
*
* @return engine content directory
*/
static FString EngineContentDir();
/**
* Returns the directory the root configuration files are located.
*
* @return root config directory
*/
static FString EngineConfigDir();
/**
* Returns the Editor Settings directory of the engine
*
* @return Editor Settings directory.
*/
static FString EngineEditorSettingsDir();
/**
* Returns the intermediate directory of the engine
*
* @return content directory
*/
static FString EngineIntermediateDir();
/**
* Returns the saved directory of the engine
*
* @return Saved directory.
*/
static FString EngineSavedDir();
/**
* Returns the plugins directory of the engine
*
* @return Plugins directory.
*/
static FString EnginePluginsDir();
/**
* Returns the directory for default Editor UI Layout files of the engine
* @return Directory for default Editor UI Layout files.
*/
static FString EngineDefaultLayoutDir();
/**
* Returns the directory for project Editor UI Layout files of the engine
* @return Directory for project Editor UI Layout files.
*/
static FString EngineProjectLayoutDir();
/**
* Returns the directory for user-generated Editor UI Layout files of the engine
* @return Directory for user-generated Editor UI Layout files.
*/
static FString EngineUserLayoutDir();
/**
* Returns the base directory enterprise directory.
*
* @return enterprise directory
*/
static FString EnterpriseDir();
/**
* Returns the enterprise plugins directory
*
* @return Plugins directory.
*/
static FString EnterprisePluginsDir();
/**
* Returns the enterprise FeaturePack directory
*
* @return FeaturePack directory.
*/
static FString EnterpriseFeaturePackDir();
/**
* Returns the directory where engine platform extensions reside
*
* @return engine platform extensions directory
*/
static FString EnginePlatformExtensionsDir();
/**
* Returns the directory where the project's platform extensions reside
*
* @return project platform extensions directory
*/
static FString ProjectPlatformExtensionsDir();
/**
* Returns platform and restricted extensions that are present and valid (for platforms, it uses FDataDrivePlatformInfo to determine valid platforms, it doesn't just use what's present)
*
* @return BaseDir and usable extension directories under BaseDir (either Engine or Project)
*/
static TArray<FString> GetExtensionDirs(const FString& BaseDir, const FString& SubDir=FString());
/**
* Returns the root directory of the engine directory tree
*
* @return Root directory.
*/
static FString RootDir();
/**
* Returns the base directory of the current project by looking at FApp::GetProjectName().
* This is usually a subdirectory of the installation
* root directory and can be overridden on the command line to allow self
* contained mod support.
*
* @return base directory
*/
static FString ProjectDir();
/**
* Returns the root directory for user-specific game files.
*
* @return game user directory
*/
static FString ProjectUserDir();
/**
* Returns the content directory of the current game by looking at FApp::GetProjectName().
*
* @return content directory
*/
static FString ProjectContentDir();
/**
* Returns the directory the root configuration files are located.
*
* @return root config directory
*/
static FString ProjectConfigDir();
/**
* Returns the saved directory of the current game by looking at FApp::GetProjectName().
*
* @return saved directory
*/
static const FString& ProjectSavedDir();
/**
* Returns the intermediate directory of the current game by looking at FApp::GetProjectName().
*
* @return intermediate directory
*/
static FString ProjectIntermediateDir();
static FString ShaderWorkingDir();
/**
* Returns the plugins directory of the current game by looking at FApp::GetProjectName().
*
* @return plugins directory
*/
static FString ProjectPluginsDir();
/**
* Returns the mods directory of the current project by looking at FApp::GetProjectName().
*
* @return mods directory
*/
static FString ProjectModsDir();
/*
* Returns true if a writable directory for downloaded data that persists across play sessions is available
*/
static bool HasProjectPersistentDownloadDir();
/*
* Returns the writable directory for downloaded data that persists across play sessions.
*/
static FString ProjectPersistentDownloadDir();
/**
* Returns the directory the engine uses to look for the source leaf ini files. This
* can't be an .ini variable for obvious reasons.
*
* @return source config directory
*/
static FString SourceConfigDir();
/**
* Returns the directory the engine saves generated config files.
*
* @return config directory
*/
static FString GeneratedConfigDir();
/**
* Returns the directory the engine stores sandbox output
*
* @return sandbox directory
*/
static FString SandboxesDir();
/**
* Returns the directory the engine uses to output profiling files.
*
* @return log directory
*/
static FString ProfilingDir();
/**
* Returns the directory the engine uses to output screenshot files.
*
* @return screenshot directory
*/
static FString ScreenShotDir();
/**
* Returns the directory the engine uses to output BugIt files.
*
* @return screenshot directory
*/
static FString BugItDir();
/**
* Returns the directory the engine uses to output user requested video capture files.
*
* @return Video capture directory
*/
static FString VideoCaptureDir();
/**
* Returns the directory the engine uses to output logs. This currently can't
* be an .ini setting as the game starts logging before it can read from .ini
* files.
*
* @return log directory
*/
static FString ProjectLogDir();
/** 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 a list of engine-specific localization paths
*/
static const TArray<FString>& GetEngineLocalizationPaths();
/**
* Returns a list of editor-specific localization paths
*/
static const TArray<FString>& GetEditorLocalizationPaths();
/**
* Returns a list of property name localization paths
*/
static const TArray<FString>& GetPropertyNameLocalizationPaths();
/**
* Returns a list of tool tip localization paths
*/
static const TArray<FString>& GetToolTipLocalizationPaths();
/**
* Returns a list of game-specific localization paths
*/
static const TArray<FString>& GetGameLocalizationPaths();
/**
* Get the name of the platform-specific localization sub-folder
*/
static FString GetPlatformLocalizationFolderName();
/**
* Returns a list of restricted/internal folder names (without any slashes) which may be tested against full paths to determine if a path is restricted or not.
*/
static const TArray<FString>& GetRestrictedFolderNames();
/**
* Determines if supplied path uses a restricted/internal subdirectory. Note that slashes are normalized and character case is ignored for the comparison.
*/
static bool IsRestrictedPath(const FString& InPath);
/**
* Returns the saved directory that is not game specific. This is usually the same as
* EngineSavedDir().
*
* @return saved directory
*/
static FString GameAgnosticSavedDir();
/** 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();
/**
* Checks whether the path to the project file, if any, is set.
*
* @return true if the path is set, false otherwise.
*/
static bool IsProjectFilePathSet();
/**
* Gets the path to the project file.
*
* @return Project file path.
*/
static FString GetProjectFilePath();
/**
* Sets the path to the project file.
*
* @param NewGameProjectFilePath - The project file path to set.
*/
static void SetProjectFilePath( const FString& NewGameProjectFilePath );
/**
* Gets the extension for this filename.
*
* @param bIncludeDot if true, includes the leading dot in the result
*
* @return the extension of this filename, or an empty string if the filename doesn't have an extension.
*/
static FString GetExtension( const FString& InPath, bool bIncludeDot=false );
// 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);
/**
* Checks if two paths are the same.
*
* @param PathA First path to check.
* @param PathB Second path to check.
*
* @returns True if both paths are the same. False otherwise.
*/
static bool IsSamePath(const FString& PathA, const FString& PathB);
/** 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);
/**
* Takes a fully pathed string and eliminates relative pathing (eg: annihilates ".." with the adjacent directory).
* Assumes all slashes have been converted to TEXT('/').
* For example, takes the string:
* BaseDirectory/SomeDirectory/../SomeOtherDirectory/Filename.ext
* and converts it to:
* BaseDirectory/SomeOtherDirectory/Filename.ext
*/
static bool CollapseRelativeDirectories(FString& InPath);
/**
* Removes duplicate slashes in paths.
* Assumes all slashes have been converted to TEXT('/').
* For example, takes the string:
* BaseDirectory/SomeDirectory//SomeOtherDirectory////Filename.ext
* and converts it to:
* BaseDirectory/SomeDirectory/SomeOtherDirectory/Filename.ext
*/
static void RemoveDuplicateSlashes(FString& InPath);
/**
* Make fully standard "Unreal" pathname:
* - Normalizes path separators [NormalizeFilename]
* - Removes extraneous separators [NormalizeDirectoryName, as well removing adjacent separators]
* - Collapses internal ..'s
* - Makes relative to Engine\Binaries\<Platform> (will ALWAYS start with ..\..\..)
*/
static FString CreateStandardFilename(const FString& InPath);
static void MakeStandardFilename(FString& InPath);
/** Takes an "Unreal" pathname and converts it to a platform filename. */
static void MakePlatformFilename(FString& InPath);
/**
* Assuming both paths (or filenames) are relative to the same base dir, modifies InPath to be relative to InRelativeTo
*
* @param InPath Path to change to be relative to InRelativeTo
* @param InRelativeTo Path to use as the new relative base
* @returns true if InPath was changed to be relative
*/
static bool MakePathRelativeTo( FString& InPath, const TCHAR* InRelativeTo );
/**
* Converts a relative path name to a fully qualified name relative to the process BaseDir().
*/
static FString ConvertRelativePathToFull(const FString& InPath);
/**
* Converts a relative path name to a fully qualified name relative to the process BaseDir().
*/
static FString ConvertRelativePathToFull(FString&& InPath);
/**
* Converts a relative path name to a fully qualified name relative to the specified BasePath.
*/
static FString ConvertRelativePathToFull(const FString& BasePath, const FString& InPath);
/**
* Converts a relative path name to a fully qualified name relative to the specified BasePath.
*/
static FString ConvertRelativePathToFull(const FString& BasePath, FString&& InPath);
/**
* Converts a relative path name to a fully qualified name relative to the specified BasePath.
*/
static FString ConvertRelativePathToFull(FString&& BasePath, const FString& InPath);
/**
* Converts a relative path name to a fully qualified name relative to the specified BasePath.
*/
static FString ConvertRelativePathToFull(FString&& BasePath, FString&& InPath);
/**
* Converts a normal path to a sandbox path (in Saved/Sandboxes).
*
* @param InSandboxName The name of the sandbox.
*/
static FString ConvertToSandboxPath( const FString& InPath, const TCHAR* InSandboxName );
/**
* Converts a sandbox (in Saved/Sandboxes) path to a normal path.
*
* @param InSandboxName The name of the sandbox.
*/
static FString ConvertFromSandboxPath( const FString& InPath, const TCHAR* InSandboxName );
/**
* Creates a temporary filename with the specified prefix.
*
* @param Path The file pathname.
* @param Prefix The file prefix.
* @param Extension File extension ('.' required).
*/
static FString CreateTempFilename( const TCHAR* Path, const TCHAR* Prefix = TEXT(""), const TCHAR* Extension = TEXT(".tmp") );
/**
* Returns a string containing all invalid characters as dictated by the operating system
*/
static FString GetInvalidFileSystemChars();
/**
* Returns a string that is safe to use as a filename because all items in
* GetInvalidFileSystemChars() are removed
*/
static FString MakeValidFileName(const FString& InString, const TCHAR InReplacementChar=0);
/**
* Validates that the parts that make up the path contain no invalid characters as dictated by the operating system
* Note that this is a different set of restrictions to those imposed by FPackageName
*
* @param InPath - path to validate
* @param OutReason - optional parameter to fill with the failure reason
*/
static bool ValidatePath( const FString& InPath, FText* OutReason = nullptr );
/**
* Parses a fully qualified or relative filename into its components (filename, path, extension).
*
* @param Path [out] receives the value of the path portion of the input string
* @param Filename [out] receives the value of the filename portion of the input string
* @param Extension [out] receives the value of the extension portion of the input string
*/
static void Split( const FString& InPath, FString& PathPart, FString& FilenamePart, FString& ExtensionPart );
/** Gets the relative path to get from BaseDir to RootDirectory */
static const FString& GetRelativePathToRoot();
template <typename... PathTypes>
FORCEINLINE static FString Combine(PathTypes&&... InPaths)
{
const TCHAR* Paths[] = { GetTCharPtr(Forward<PathTypes>(InPaths))... };
FString Out;
CombineInternal(Out, Paths, UE_ARRAY_COUNT(Paths));
return Out;
}
/**
* Frees any memory retained by FPaths.
*/
static void TearDown();
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();
};
参考
【UE4 C++】简单获取名称、状态、时间、帧数、路径与FPaths的更多相关文章
- js获取 gif 的帧数
使用 javascript 获取 GIF 图的帧数,如果帧数过大,则不让传到服务器 这里是使用一个插件: github地址为: https://github.com/buzzfeed/libgif-j ...
- LODOP获取打印状态码和时间列表
之前有博文介绍获取打印状态码和打印状态码的含义,相关博文:LODOP获取打印机状态码和状态码含义测试.此外 ,也有获取状态码及其变化的方法,可以获取打印状态码的列表,列表包含每个状态和每个状态的时间. ...
- 【Linux学习】 写一个简单的Makefile编译源码获取当前系统时间
打算学习一下Linux,这两天先看了一下gcc的简单用法以及makefile的写法,今天是周末,天气闷热超市,早晨突然发现住处的冰箱可以用了,于是先出去吃了点东西,然后去超市买了一坨冰棍,老冰棍居多, ...
- React Native之Fetch简单封装、获取网络状态
1.Fetch的使用 fetch的使用非常简单,只需传入请求的url fetch('https://facebook.github.io/react-native/movies.json'); 当然是 ...
- 牛客网Java刷题知识点之File对象常用功能:获取文件名称、获取文件路径、获取文件大小、获取文件修改时间、创建与删除、判断、重命名、查看系统根目录、容量获取、获取某个目录下内容、过滤器
不多说,直接上干货! 获取文件名称.获取文件路径.获取文件大小.获取文件修改时间 FileMethodDemo.java package zhouls.bigdata.DataFeatureSelec ...
- JS简单获取当前日期时间的方法(yyyy-MM-dd hh:mm:ss)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xht ...
- Python+requests 发送简单请求--》获取响应状态--》获取请求响应数据
Python+requests 发送简单请求-->获取响应状态-->获取请求响应数据 1.环境:安装了Python和vscode编译器(Python自带的编译器也ok).fiddler抓包 ...
- C#开发BIMFACE系列14 服务端API之批量获取转换状态详情
系列目录 [已更新最新开发文章,点击查看详细] 上一篇<C#开发BIMFACE系列13 服务端API之获取转换状态>中介绍了根据文件ID查询单个文件的转换状态. 本文介绍批量获取转 ...
- C#开发BIMFACE系列13 服务端API之获取转换状态
系列目录 [已更新最新开发文章,点击查看详细] 在<C#开发BIMFACE系列12 服务端API之文件转换>中详细介绍了7种文件转换的方法.发起源文件/模型转换后,转换过程可能成功 ...
随机推荐
- sql常用查询命令
目录 SQL Server常用查询命令: 查看当前时间 查询所有数据库名 查询当前使用的数据库名 查询前几条数据 去重查询 字段换名 查询不等于 查询在两个值之间数据 查询条件或 模糊匹配查询 查询为 ...
- CentOS7搭建sftp
openssh-server自带sftp服务 1.添加组: groupadd sftp 2.添加不可登录的sftp用户 useradd -u 1001 -g sftp -s /sbin/no ...
- 【Python学习】print语句
一.print 可以向屏幕上输出信息,print 后面一个空格再加上''中间放入要输出的内容. 二.print可以用逗号分隔语句,但是每有一个逗号就会出来一个空格. 1 >>> pr ...
- 学习PHP中的国际化功能来查看货币及日期信息
做为一门在世界范围内广泛使用的编程语言,国际化能力往往是衡量一个编程语言是否能够大范围流行的重要内容.特别是对于 PHP 这种以 Web 页面编程为主战场的语言来说,国际化能力更是重中之重.在 PHP ...
- AT4353-[ARC101D]Robots and Exits【LIS】
正题 题目链接:https://www.luogu.com.cn/problem/AT4353 题目大意 数轴上有\(n\)个球\(m\)个洞,每次可以将所有球左移或者右移,球到洞的位置会掉下去. 求 ...
- P4780-Phi的反函数【dfs】
正题 题目链接:https://www.luogu.com.cn/problem/P4780 题目大意 给出\(n\),求一个最小的\(x\)满足\(\varphi(x)=n\). 若不存在或者大于\ ...
- POJ3734-Blocks【EGF】
正题 题目链接:http://poj.org/problem?id=3734 题目大意 用思种颜色给\(n\)个格子染色,要求前两种颜色出现偶数次,求方案. \(1\leq T\leq 100,1\l ...
- ThreadLocal基本使用和内存泄漏分析
ThreadLocal基础部分 ThreadLoal的作用 保存线程的独立变量,即每个线程维护一份.这种变量在线程的生命周期内起作用,减少同一个线程内多个函数之间公共变量传递麻烦. 使用场景 需要给不 ...
- PHP的SPL扩展库(一)数据结构
SPL 库也叫做 PHP 标准库,主要就是用于解决典型问题的一组接口或类的集合.这些典型问题包括什么呢?比如我们今天要讲的数据结构,还有一些设计模式的实现,就像我们之前讲过的观察者模式相关的接口在 S ...
- Vite插件开发纪实:vite-plugin-monitor(下)
前言 上一篇介绍了Vite启动,HMR等时间的获取. 但各阶段详细的耗时信息,只能通过debug的日志获取 本文就实现一下debug日志的拦截 插件效果预览 --debug做了什么 项目启动指令 vi ...