diff options
Diffstat (limited to 'include/FileUtil.hpp')
-rw-r--r-- | include/FileUtil.hpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/FileUtil.hpp b/include/FileUtil.hpp new file mode 100644 index 0000000..402f5f1 --- /dev/null +++ b/include/FileUtil.hpp @@ -0,0 +1,24 @@ +#ifndef SIBS_FILEUTIL_HPP +#define SIBS_FILEUTIL_HPP + +#include "../external/tinydir.h" +#include "Result.hpp" +#include <functional> + +namespace sibs +{ + using FileWalkCallbackFunc = std::function<void(tinydir_file*)>; + + enum class FileType + { + FILE_NOT_FOUND, + REGULAR, + DIRECTORY + }; + + FileType getFileType(const char *path); + void walkDirectory(const char *directory, FileWalkCallbackFunc callbackFunc); + Result<std::string> getFileContent(const char *filepath); +} + +#endif //SIBS_FILEUTIL_HPP |