summaryrefslogtreecommitdiff
path: root/zen/file_access.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-04-03 09:56:38 -0400
committerB. Stack <bgstack15@gmail.com>2023-04-03 09:56:38 -0400
commit765e1bb3bdeb5c49f08543c20206e55c772e6b80 (patch)
tree920f288910890016e540213fe65f2d6f38aa82be /zen/file_access.h
parentadd upstream 12.1 (diff)
downloadFreeFileSync-765e1bb3bdeb5c49f08543c20206e55c772e6b80.tar.gz
FreeFileSync-765e1bb3bdeb5c49f08543c20206e55c772e6b80.tar.bz2
FreeFileSync-765e1bb3bdeb5c49f08543c20206e55c772e6b80.zip
add upstream 12.212.2
Diffstat (limited to 'zen/file_access.h')
-rw-r--r--zen/file_access.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/zen/file_access.h b/zen/file_access.h
index 5af8b879..f6ac3740 100644
--- a/zen/file_access.h
+++ b/zen/file_access.h
@@ -8,7 +8,6 @@
#define FILE_ACCESS_H_8017341345614857
#include <functional>
-#include <variant>
#include "file_path.h"
#include "file_error.h"
#include "serialize.h" //IoCallback
@@ -39,9 +38,9 @@ ItemType getItemType(const Zstring& itemPath); //throw FileError
//execute potentially SLOW folder traversal but distinguish error/not existing:
// - all child item path parts must correspond to folder traversal
// => we can conclude whether an item is *not* existing anymore by doing a *case-sensitive* name search => potentially SLOW!
-std::variant<ItemType, Zstring /*last existing parent path*/> getItemTypeIfExists(const Zstring& itemPath); //throw FileError
+std::optional<ItemType> getItemTypeIfExists(const Zstring& itemPath); //throw FileError
-bool itemExists(const Zstring& itemPath); //throw FileError
+inline bool itemExists(const Zstring& itemPath) { return static_cast<bool>(getItemTypeIfExists(itemPath)); } //throw FileError
enum class ProcSymlink
{
@@ -80,8 +79,7 @@ void createDirectoryIfMissingRecursion(const Zstring& dirPath); //throw FileErro
//symlink handling: follow
//expects existing source/target directories
-//reports "note-worthy" errors only
-void tryCopyDirectoryAttributes(const Zstring& sourcePath, const Zstring& targetPath); //throw FileError
+void copyDirectoryAttributes(const Zstring& sourcePath, const Zstring& targetPath); //throw FileError
void copySymlink(const Zstring& sourcePath, const Zstring& targetPath); //throw FileError
bgstack15