#ifndef SIBS_FILEUTIL_HPP #define SIBS_FILEUTIL_HPP #include "../external/tinydir.h" #include "Result.hpp" #include "StringView.hpp" #include namespace sibs { using FileWalkCallbackFunc = std::function; enum class FileType { FILE_NOT_FOUND, REGULAR, DIRECTORY }; FileType getFileType(const char *path); void walkDir(const char *directory, FileWalkCallbackFunc callbackFunc); void walkDirFiles(const char *directory, FileWalkCallbackFunc callbackFunc); void walkDirFilesRecursive(const char *directory, FileWalkCallbackFunc callbackFunc); Result getFileContent(const char *filepath); Result fileOverwrite(const char *filepath, StringView data); const char* getHomeDir(); Result getCwd(); // Note: Will not delete created directories if this operation fails for some reason Result createDirectoryRecursive(const char *path); } #endif //SIBS_FILEUTIL_HPP