/
sdi-tool
/
SDI
Обзор
Документация
Войти
/
sdi-tool
/
SDI
Код
Пакеты
0
Релизы
0
Аналитика
dev
src/utils/FileUtil.h
83 строки
2 KB
WindR
Bump libtorrent to 2.1
06 ноя 2024, 20:33
06 ноя 2024, 20:33
2dff592
Код
Авторство
О чём код?
namespace path { bool IsSep(char c); TempStr GetExtTemp(const char* path); TempStr GetBaseNameTemp(const char* path); TempStr GetPathNoExtTemp(const char* path); TempStr GetDirTemp(const char* path); TempWStr GetDirTemp(const WCHAR* path); char* Join(Allocator* allocator, const char* path, const char* fileName); char* Join(const char* path, const char* fileName); WCHAR* Join(const WCHAR* path, const WCHAR* fileName, const WCHAR* fileName2 = nullptr); TempStr JoinTemp(const char* path, const char* fileName, const char* fileName2 = nullptr); TempWStr JoinTemp(const WCHAR* path, const WCHAR* fileName, const WCHAR* fileName2 = nullptr); bool IsDirectory(const char*); TempStr NormalizeTemp(const char* path); TempStr ShortPathTemp(const char* pathA); bool IsSame(const char* path1, const char* path2); bool HasVariableDriveLetter(const char* path); bool IsOnFixedDrive(const char* path); bool IsAbsolute(const char* path); bool Match(const char* path, const char* filter); enum Type { None, // path doesn't exist File, Dir, }; Type GetType(const char* path); } // namespace path TempStr GetTempFilePathTemp(const char* filePrefix = nullptr); TempStr GetPathInExeDirTemp(const char* fileName = nullptr); namespace file { bool Exists(const WCHAR* path); bool Exists(const char* path); FILE* OpenFILE(const char* path); HANDLE OpenReadOnly(const char*); ByteSlice ReadFileWithAllocator(const char* path, Allocator*); ByteSlice ReadFile(const char* path); int ReadN(const char* path, char* buf, size_t toRead); bool WriteFile(const char* path, const ByteSlice&); i64 GetSize(const char*); bool Delete(const char* path); FILETIME GetModificationTime(const char* path); bool SetModificationTime(const char* path, FILETIME lastMod); DWORD GetAttributes(const char* path); bool SetAttributes(const char* path, DWORD attrs); bool StartsWithN(const char* path, const char* s, size_t len); bool StartsWith(const char* path, const char* s); bool Copy(const char* dst, const char* src, bool dontOverwrite); } // namespace file namespace dir { bool Exists(const WCHAR* dir); bool Exists(const char*); bool Create(const char* dir); bool CreateForFile(const char* path); bool CreateAll(const char* dir); bool RemoveAll(const char* dir); } // namespace dir bool FileTimeEq(const FILETIME& a, const FILETIME& b);