aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-02-16 02:06:56 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:58 +0200
commit6d3c3132bbc0421c42e587b869984fd39f0b35a2 (patch)
treed503e2163f82293713bbe0773b79b1b3342c130b /include
parent04f7cf535992f05ea56c701f25a6adad564796ae (diff)
Fix cmake build library dependency order
Diffstat (limited to 'include')
-rw-r--r--include/FileUtil.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/FileUtil.hpp b/include/FileUtil.hpp
index d740fff..b88d58a 100644
--- a/include/FileUtil.hpp
+++ b/include/FileUtil.hpp
@@ -41,6 +41,14 @@ namespace sibs
// Return true if you want to continue iterating the remaining files, return false if you want to stop
using FileWalkCallbackFunc = std::function<bool(tinydir_file*)>;
+ struct FileWithTimestamp {
+ FileString filepath;
+ FileString extension;
+ struct timespec last_modified;
+ };
+
+ using SortedFileWalkCallbackFunc = std::function<bool(const FileWithTimestamp&)>;
+
enum class FileType
{
FILE_NOT_FOUND,
@@ -52,6 +60,7 @@ namespace sibs
void walkDir(const _tinydir_char_t *directory, FileWalkCallbackFunc callbackFunc);
void walkDirFiles(const _tinydir_char_t *directory, FileWalkCallbackFunc callbackFunc);
bool walkDirFilesRecursive(const _tinydir_char_t *directory, FileWalkCallbackFunc callbackFunc);
+ bool walkDirFilesRecursiveSortTimestamp(const _tinydir_char_t *directory, SortedFileWalkCallbackFunc callbackFunc);
Result<StringView> getFileContent(const _tinydir_char_t *filepath);
Result<bool> fileWrite(const _tinydir_char_t *filepath, StringView data);
Result<bool> fileOverwrite(const _tinydir_char_t *filepath, StringView data);