From 61d9e8699687342c2e32c32c8d4eb71760d5d290 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 26 Jun 2021 17:33:24 +0200 Subject: Use fork/exec instead of popen. Add Path class --- include/FileUtil.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'include/FileUtil.hpp') 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; -- cgit v1.2.3