🛰️航天仿真算法库 SpaceAST 0.4.0
载入中...
搜索中...
未找到
Path.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstUtil/StringView.hpp"
25#include <string>
26
27AST_NAMESPACE_BEGIN
28
34inline bool aIsPathSeparator(char c)
35{
36 #ifdef _WIN32
37 return c == '/' || c == '\\';
38 #else
39 return c == '/';
40 #endif
41}
42
43AST_UTIL_CAPI bool aPathIsRelative(StringView path);
44
45
49AST_UTIL_CAPI bool aPathIsAbsolute(StringView path);
50
51
52#ifdef _WIN32
61AST_UTIL_API std::wstring aMakeWin32Path(StringView path);
62
63
71AST_UTIL_CAPI errc_t aCreateJunction(StringView targetPath, StringView junctionPath);
72
73#endif
74
84AST_UTIL_CAPI errc_t aCreateSymbolicLink(StringView targetPath, StringView linkPath, bool isDirectory);
85
86
90AST_UTIL_API std::string aTryGetShortPath(StringView path);
91
92
95AST_NAMESPACE_END
bool aPathIsAbsolute(StringView path)
路径是否是绝对路径,语义与 std::filesystem::path::is_absolute 一致
定义 Path.cpp:56
std::string aTryGetShortPath(StringView path)
尝试获取短路径
定义 Path.cpp:446
errc_t aCreateSymbolicLink(StringView targetPath, StringView linkPath, bool isDirectory)
创建符号链接
定义 Path.cpp:292