aboutsummaryrefslogtreecommitdiff
path: root/include/FileUtil.hpp
diff options
context:
space:
mode:
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
index f2a1799..5bd4d33 100644
--- a/include/FileUtil.hpp
+++ b/include/FileUtil.hpp
@@ -38,6 +38,30 @@ namespace sibs
void replaceChar(FileString &input, wchar_t charToReplace, wchar_t charToReplaceWith);
#endif
+ class Path {
+ public:
+ Path(const FileString &str) : data(str) {}
+
+ Path& join(const _tinydir_char_t *str) {
+ data += TINYDIR_STRING("/");
+ data += str;
+ return *this;
+ }
+
+ Path& join(const Path &other) {
+ data += TINYDIR_STRING("/");
+ data += other.data;
+ return *this;
+ }
+
+ Path& append(const FileString &str) {
+ data += str;
+ return *this;
+ }
+
+ FileString data;
+ };
+
// 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*)>;