chore: baseline usable version

This commit is contained in:
dela
2026-06-10 11:17:51 +08:00
commit a2f82a86b6
932 changed files with 172551 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#include "utils.h"
namespace fs = std::filesystem;
#ifdef _WIN32
# define _TSTR(X) L##X
# define tstrcmp wcscmp
#else
# define _TSTR(X) X
# define tstrcmp strcmp
#endif
namespace Utils {
std::filesystem::path cleanPath(const std::filesystem::path &path) {
fs::path result;
for (const auto &part : path) {
if (part == _TSTR("..")) {
if (!result.empty() && result.filename() != _TSTR("..")) {
result = result.parent_path();
} else {
result /= part;
}
} else if (part != _TSTR(".")) {
result /= part;
}
}
return result;
}
}