aboutsummaryrefslogtreecommitdiff
path: root/include/FileUtil.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2017-12-08 00:49:15 +0100
committerdec05eba <dec05eba@protonmail.com>2017-12-08 00:50:04 +0100
commitbf24f6fc48b4eebb06cdcd7029d1d31d4c6028dd (patch)
treeb9cb68dc44e002586a1e09aeb60bb42f75258758 /include/FileUtil.hpp
parent3fc89b69ff3fc937a0cde32c2fae9ce3b3cf1ebc (diff)
Added loading of project file and file validations
Next up: parse project.conf file
Diffstat (limited to 'include/FileUtil.hpp')
-rw-r--r--include/FileUtil.hpp24
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