blob: 345c72aa660e0f7eb8227f3e42e7642214292c44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#ifndef SIBS_FILEUTIL_HPP
#define SIBS_FILEUTIL_HPP
#include "../external/tinydir.h"
#include "Result.hpp"
#include "StringView.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 walkDirFiles(const char *directory, FileWalkCallbackFunc callbackFunc);
Result<StringView> getFileContent(const char *filepath);
}
#endif //SIBS_FILEUTIL_HPP
|