From bf24f6fc48b4eebb06cdcd7029d1d31d4c6028dd Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 8 Dec 2017 00:49:15 +0100 Subject: Added loading of project file and file validations Next up: parse project.conf file --- include/FileUtil.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/FileUtil.hpp (limited to 'include/FileUtil.hpp') 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 + +namespace sibs +{ + using FileWalkCallbackFunc = std::function; + + enum class FileType + { + FILE_NOT_FOUND, + REGULAR, + DIRECTORY + }; + + FileType getFileType(const char *path); + void walkDirectory(const char *directory, FileWalkCallbackFunc callbackFunc); + Result getFileContent(const char *filepath); +} + +#endif //SIBS_FILEUTIL_HPP -- cgit v1.2.3